forked from infra/ansible
Zabbix: Add koji check_lock script
Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
This commit is contained in:
parent
c4a96be6cc
commit
449ddd529b
3 changed files with 29 additions and 1 deletions
19
roles/koji_hub/files/nagios-plugin.py
Normal file
19
roles/koji_hub/files/nagios-plugin.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
from __future__ import print_function
|
||||
import fcntl
|
||||
import sys
|
||||
|
||||
try:
|
||||
f = open('/mnt/koji/.nagios_test', 'r')
|
||||
f.close()
|
||||
f = open('/mnt/koji/.nagios_test', 'w')
|
||||
except IOError as e:
|
||||
print(e)
|
||||
print("Could not create file")
|
||||
sys.exit(2)
|
||||
|
||||
fcntl.flock(f, fcntl.LOCK_EX)
|
||||
f.close()
|
||||
print("File Locked Successfully")
|
||||
sys.exit(0)
|
||||
|
|
@ -1,2 +1,2 @@
|
|||
UserParameter=koji.builds.failed,curl --silent http://localhost/koji/builds|grep -c failed.png
|
||||
UserParameter=koji.locks,/usr/lib64/nagios/plugins/check_lock
|
||||
UserParameter=koji.locks,/usr/lib/zabbix/check_lock.py
|
||||
|
|
|
|||
|
|
@ -485,6 +485,15 @@
|
|||
- koji_hub
|
||||
- koji_hub/oomd
|
||||
|
||||
- name: Install old Nagios-style check_lock plugin where Zabbix can find it
|
||||
ansible.builtin.copy:
|
||||
src: nagios-plugin.py
|
||||
dest: /usr/lib/zabbix/check_lock.py
|
||||
mode: '0755'
|
||||
tags:
|
||||
- koji_hub
|
||||
- zabbix_agent
|
||||
|
||||
- name: Install Zabbix agent config drop-in
|
||||
ansible.builtin.copy:
|
||||
src: zabbix-agent-dropin
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue