summaryrefslogtreecommitdiffstats
path: root/playbooks/adhoc/zabbix_setup
diff options
context:
space:
mode:
Diffstat (limited to 'playbooks/adhoc/zabbix_setup')
-rw-r--r--playbooks/adhoc/zabbix_setup/create_app.yml34
-rw-r--r--playbooks/adhoc/zabbix_setup/create_application.yml18
-rw-r--r--playbooks/adhoc/zabbix_setup/create_template.yml2
-rw-r--r--playbooks/adhoc/zabbix_setup/vars/template_os_linux.yml30
4 files changed, 1 insertions, 83 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