summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Woodson <mwoodson@gmail.com>2015-09-25 12:07:25 -0400
committerMatt Woodson <mwoodson@gmail.com>2015-09-25 12:07:25 -0400
commitcdd6dd0d1c5dafa142e6890b8d27cf909d779a85 (patch)
tree0317414fdd391ad652413280aff86017d6a087c4
parent34465b6edd45ea34b98563cd772cb28eb2265bde (diff)
parent19f91f7b7844ec3c89d8ee0e6a6c08655e897266 (diff)
downloadopenshift-cdd6dd0d1c5dafa142e6890b8d27cf909d779a85.tar.gz
openshift-cdd6dd0d1c5dafa142e6890b8d27cf909d779a85.tar.bz2
openshift-cdd6dd0d1c5dafa142e6890b8d27cf909d779a85.tar.xz
openshift-cdd6dd0d1c5dafa142e6890b8d27cf909d779a85.zip
Merge pull request #615 from openshift/dynamic_filesystem
added support for dynamic keys and items
-rw-r--r--roles/lib_zabbix/tasks/create_template.yml28
-rw-r--r--roles/os_zabbix/vars/template_os_linux.yml18
2 files changed, 46 insertions, 0 deletions
diff --git a/roles/lib_zabbix/tasks/create_template.yml b/roles/lib_zabbix/tasks/create_template.yml
index fd0cdd46f..b4821bdc7 100644
--- a/roles/lib_zabbix/tasks/create_template.yml
+++ b/roles/lib_zabbix/tasks/create_template.yml
@@ -52,3 +52,31 @@
url: "{{ item.url | default(None, True) }}"
with_items: template.ztriggers
when: template.ztriggers is defined
+
+- name: Create Discoveryrules
+ zbx_discoveryrule:
+ zbx_server: "{{ server }}"
+ zbx_user: "{{ user }}"
+ zbx_password: "{{ password }}"
+ name: "{{ item.name }}"
+ key: "{{ item.key }}"
+ lifetime: "{{ item.lifetime }}"
+ template_name: "{{ template.name }}"
+ description: "{{ item.description | default('', True) }}"
+ with_items: template.zdiscoveryrules
+ when: template.zdiscoveryrules is defined
+
+- name: Create Item Prototype
+ zbx_itemprototype:
+ zbx_server: "{{ server }}"
+ zbx_user: "{{ user }}"
+ zbx_password: "{{ password }}"
+ name: "{{ item.name }}"
+ key: "{{ item.key }}"
+ discoveryrule_key: "{{ item.discoveryrule_key }}"
+ value_type: "{{ item.value_type }}"
+ template_name: "{{ template.name }}"
+ applications: "{{ item.applications }}"
+ description: "{{ item.description | default('', True) }}"
+ with_items: template.zitemprototypes
+ when: template.zitemprototypes is defined
diff --git a/roles/os_zabbix/vars/template_os_linux.yml b/roles/os_zabbix/vars/template_os_linux.yml
index 3173c79b2..84a7740b0 100644
--- a/roles/os_zabbix/vars/template_os_linux.yml
+++ b/roles/os_zabbix/vars/template_os_linux.yml
@@ -191,6 +191,24 @@ g_template_os_linux:
- Disk
value_type: float
+
+ zdiscoveryrules:
+ - name: disc.filesys
+ key: disc.filesys
+ lifetime: 1
+ template_name: Template OS Linux
+ description: "Dynamically register the filesystems"
+
+ zitemprototypes:
+ - discoveryrule_key: disc.filesys
+ template_name: Template OS Linux
+ name: "disc.filesys.full.{#OSO_FILESYS}"
+ key: "disc.filesys.full[{#OSO_FILESYS}]"
+ value_type: float
+ description: "PCP filesys.full option. This is the percent full returned from pcp filesys.full"
+ applications:
+ - Disk
+
ztriggers:
- name: 'Filesystem: / has less than 10% free on {HOST.NAME}'
expression: '{Template OS Linux:filesys.full.xvda2.last()}>90'