summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Diaz <jdiaz@redhat.com>2016-02-09 14:48:54 -0500
committerJoel Diaz <jdiaz@redhat.com>2016-02-24 15:10:10 -0500
commit51b33151b6265d6049b9b39cbb25b6a4522ef7e5 (patch)
treea83dbc641ed44f62087028eff0794fb5e99f6d98
parent8ed73ca866da18963a7868eb1d0f66ba63a0d425 (diff)
downloadopenshift-51b33151b6265d6049b9b39cbb25b6a4522ef7e5.tar.gz
openshift-51b33151b6265d6049b9b39cbb25b6a4522ef7e5.tar.bz2
openshift-51b33151b6265d6049b9b39cbb25b6a4522ef7e5.tar.xz
openshift-51b33151b6265d6049b9b39cbb25b6a4522ef7e5.zip
remote heal action for OVS down
-rwxr-xr-xplaybooks/adhoc/zabbix_setup/oo-config-zaio.yml4
-rw-r--r--roles/lib_zabbix/tasks/create_template.yml14
-rw-r--r--roles/os_zabbix/vars/template_openshift_node.yml31
3 files changed, 48 insertions, 1 deletions
diff --git a/playbooks/adhoc/zabbix_setup/oo-config-zaio.yml b/playbooks/adhoc/zabbix_setup/oo-config-zaio.yml
index ec28564cf..2f1d003ff 100755
--- a/playbooks/adhoc/zabbix_setup/oo-config-zaio.yml
+++ b/playbooks/adhoc/zabbix_setup/oo-config-zaio.yml
@@ -8,8 +8,12 @@
g_server: http://localhost/zabbix/api_jsonrpc.php
g_user: Admin
g_password: zabbix
+ g_zbx_scriptrunner_user: scriptrunner
+ g_zbx_scriptrunner_bastion_host: specialhost.example.com
roles:
- role: os_zabbix
ozb_server: "{{ g_server }}"
ozb_user: "{{ g_user }}"
ozb_password: "{{ g_password }}"
+ ozb_scriptrunner_user: "{{ g_zbx_scriptrunner_user }}"
+ ozb_scriptrunner_bastion_host: "{{ g_zbx_scriptrunner_bastion_host }}"
diff --git a/roles/lib_zabbix/tasks/create_template.yml b/roles/lib_zabbix/tasks/create_template.yml
index 61344357a..783249c3a 100644
--- a/roles/lib_zabbix/tasks/create_template.yml
+++ b/roles/lib_zabbix/tasks/create_template.yml
@@ -61,6 +61,20 @@
with_items: template.ztriggers
when: template.ztriggers is defined
+- name: Create Actions
+ zbx_action:
+ zbx_server: "{{ server }}"
+ zbx_user: "{{ user }}"
+ zbx_password: "{{ password }}"
+ state: "{{ item.state | default('present', True) }}"
+ name: "{{ item.name }}"
+ status: "{{ item.status | default('enabled', True) }}"
+ escalation_time: "{{ item.escalation_time }}"
+ conditions_filter: "{{ item.conditions_filter }}"
+ operations: "{{ item.operations }}"
+ with_items: template.zactions
+ when: template.zactions is defined
+
- name: Create Discoveryrules
zbx_discoveryrule:
zbx_server: "{{ server }}"
diff --git a/roles/os_zabbix/vars/template_openshift_node.yml b/roles/os_zabbix/vars/template_openshift_node.yml
index ff65ef158..252339366 100644
--- a/roles/os_zabbix/vars/template_openshift_node.yml
+++ b/roles/os_zabbix/vars/template_openshift_node.yml
@@ -47,4 +47,33 @@ g_template_openshift_node:
url: 'https://github.com/openshift/ops-sop/blob/node/V3/Alerts/openshift_node.asciidoc'
priority: high
-
+ zactions:
+ - name: '[HEAL] OVS may not be running on {HOST.NAME}'
+ status: disabled
+ escalation_time: 60
+ conditions_filter:
+ calculation_type: "and/or"
+ conditions:
+ - conditiontype: maintenance status
+ operator: not in
+ - conditiontype: trigger name
+ operator: like
+ value: "[HEAL] OVS may not be running on"
+ - conditiontype: trigger value
+ operator: "="
+ value: PROBLEM
+ operations:
+ - esc_step_from: 1
+ esc_step_to: 1
+ esc_period: 0
+ operationtype: remote command
+ opcommand:
+ command: 'ssh -i /etc/openshift_tools/scriptrunner_id_rsa {{ ozb_scriptrunner_user }}@{{ ozb_scriptrunner_bastion_host }} remote-healer --host \"{HOST.NAME}\" --trigger \"{TRIGGER.NAME}\" --trigger-val \"{TRIGGER.VALUE}\"'
+ execute_on: "zabbix server"
+ type: 'custom script'
+ target_hosts:
+ - target_type: 'zabbix server'
+ opconditions:
+ - conditiontype: 'event acknowledged'
+ operator: '='
+ value: 'not acknowledged'