diff options
author | Kenny Woodson <kwoodson@redhat.com> | 2015-08-12 12:47:32 -0400 |
---|---|---|
committer | Kenny Woodson <kwoodson@redhat.com> | 2015-08-12 14:50:51 -0400 |
commit | 75170e2f6558dc9df9bfdb93dbf2bf9b13c1bce5 (patch) | |
tree | f6ae69114c3099ef3dde4b3da9a759e052a02b6d | |
parent | f6f21d3a639323045fb98b59babeaca8ceb54c65 (diff) | |
download | openshift-75170e2f6558dc9df9bfdb93dbf2bf9b13c1bce5.tar.gz openshift-75170e2f6558dc9df9bfdb93dbf2bf9b13c1bce5.tar.bz2 openshift-75170e2f6558dc9df9bfdb93dbf2bf9b13c1bce5.tar.xz openshift-75170e2f6558dc9df9bfdb93dbf2bf9b13c1bce5.zip |
zbx item now uses key as default name. Clean up.
-rw-r--r-- | playbooks/adhoc/zabbix_setup/create_app.yml | 34 | ||||
-rw-r--r-- | playbooks/adhoc/zabbix_setup/create_application.yml | 18 | ||||
-rw-r--r-- | playbooks/adhoc/zabbix_setup/create_template.yml | 2 | ||||
-rw-r--r-- | playbooks/adhoc/zabbix_setup/vars/template_os_linux.yml | 30 | ||||
-rw-r--r-- | roles/os_zabbix/library/zbx_item.py | 2 |
5 files changed, 2 insertions, 84 deletions
diff --git a/playbooks/adhoc/zabbix_setup/create_app.yml b/playbooks/adhoc/zabbix_setup/create_app.yml deleted file mode 100644 index 3a08b2301..000000000 --- a/playbooks/adhoc/zabbix_setup/create_app.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -- hosts: localhost - gather_facts: no - vars_files: - - vars/template_heartbeat.yml - - vars/template_os_linux.yml - vars: - g_zserver: http://oso-rhel7-zabbix-web.kwoodsontest2.opstest.online.openshift.com/zabbix/api_jsonrpc.php - g_zuser: Admin - g_zpassword: zabbix - roles: - - ../roles/os_zabbix - post_tasks: - - zbxapi: - server: "{{ g_zserver }}" - user: "{{ g_zuser }}" - password: "{{ g_zpassword }}" - zbx_class: Template - state: list - params: - output: extend - register: templates - - - debug: var=templates - - - name: Create app - include: create_application.yml - vars: - ctp_template: "{{ g_template_heartbeat }}" - ctp_zserver: "{{ g_zserver }}" - ctp_zuser: "{{ g_zuser }}" - ctp_zpassword: "{{ g_zpassword }}" - - diff --git a/playbooks/adhoc/zabbix_setup/create_application.yml b/playbooks/adhoc/zabbix_setup/create_application.yml deleted file mode 100644 index aa6c40ed8..000000000 --- a/playbooks/adhoc/zabbix_setup/create_application.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -- debug: var=ctp_template - -- name: Create Application - zbxapi: - server: "{{ ctp_zserver }}" - user: "{{ ctp_zuser }}" - password: "{{ ctp_zpassword }}" - zbx_class: Application - state: present - params: - name: "{{ ctp_template.application['name'] }}" - hostid: 10085 - search: - name: "{{ ctp_template.application['name'] }}" - register: ctp_created_application - -- debug: var=ctp_created_application diff --git a/playbooks/adhoc/zabbix_setup/create_template.yml b/playbooks/adhoc/zabbix_setup/create_template.yml index 60fb27666..50fff53b2 100644 --- a/playbooks/adhoc/zabbix_setup/create_template.yml +++ b/playbooks/adhoc/zabbix_setup/create_template.yml @@ -32,8 +32,8 @@ server: "{{ ctp_zserver }}" user: "{{ ctp_zuser }}" password: "{{ ctp_zpassword }}" - name: "{{ item.name }}" key: "{{ item.key }}" + name: "{{ item.name | default(item.key, true) }}" value_type: "{{ item.value_type | default('int') }}" template_name: "{{ ctp_template.name }}" with_items: ctp_template.zitems diff --git a/playbooks/adhoc/zabbix_setup/vars/template_os_linux.yml b/playbooks/adhoc/zabbix_setup/vars/template_os_linux.yml index 6fab08879..9cc038ffa 100644 --- a/playbooks/adhoc/zabbix_setup/vars/template_os_linux.yml +++ b/playbooks/adhoc/zabbix_setup/vars/template_os_linux.yml @@ -3,118 +3,88 @@ g_template_os_linux: name: Template OS Linux zitems: - key: kernel.uname.sysname - name: kernel.uname.sysname value_type: string - key: kernel.all.cpu.wait.total - name: kernel.all.cpu.wait.total value_type: int - key: kernel.all.cpu.irq.hard - name: kernel.all.cpu.irq.hard value_type: int - key: kernel.all.cpu.idle - name: kernel.all.cpu.idle value_type: int - key: kernel.uname.distro - name: kernel.uname.distro value_type: string - key: kernel.uname.nodename - name: kernel.uname.nodename value_type: string - key: kernel.all.cpu.irq.soft - name: kernel.all.cpu.irq.soft value_type: int - key: kernel.all.load.15_minute - name: kernel.all.load.15_minute value_type: float - key: kernel.all.cpu.sys - name: kernel.all.cpu.sys value_type: int - key: kernel.all.load.5_minute - name: kernel.all.load.5_minute value_type: float - key: mem.freemem - name: mem.freemem value_type: int - key: kernel.all.cpu.nice - name: kernel.all.cpu.nice value_type: int - key: mem.util.bufmem - name: mem.util.bufmem value_type: int - key: swap.used - name: swap.used value_type: int - key: kernel.all.load.1_minute - name: kernel.all.load.1_minute value_type: float - key: kernel.uname.version - name: kernel.uname.version value_type: string - key: swap.length - name: swap.length value_type: int - key: mem.physmem - name: mem.physmem value_type: int - key: kernel.all.uptime - name: kernel.all.uptime value_type: int - key: swap.free - name: swap.free value_type: int - key: mem.util.used - name: mem.util.used value_type: int - key: kernel.all.cpu.user - name: kernel.all.cpu.user value_type: int - key: kernel.uname.machine - name: kernel.uname.machine value_type: string - key: hinv.ncpu - name: hinv.ncpu value_type: int - key: mem.util.cached - name: mem.util.cached value_type: int - key: kernel.all.cpu.steal - name: kernel.all.cpu.steal value_type: int - - key: kernel.all.pswitch - name: kernel.all.pswitch value_type: int - key: kernel.uname.release - name: kernel.uname.release value_type: string - key: proc.nprocs - name: proc.nprocs value_type: int diff --git a/roles/os_zabbix/library/zbx_item.py b/roles/os_zabbix/library/zbx_item.py index 6cfb16d48..57ec06463 100644 --- a/roles/os_zabbix/library/zbx_item.py +++ b/roles/os_zabbix/library/zbx_item.py @@ -119,7 +119,7 @@ def main(): module.exit_json(changed=True, results=content['result'], state="absent") if state == 'present': - params = {'name': module.params['name'], + params = {'name': module.params.get('name', module.params['key']), 'key_': key, 'hostid': templateid, 'type': module.params['zabbix_type'], |