1
0
Fork 0
forked from infra/ansible

Zabbix: Add koji check_lock script

Signed-off-by: Greg Sutcliffe <fedora@emeraldreverie.org>
This commit is contained in:
Greg Sutcliffe 2026-07-01 17:01:24 +01:00
commit 449ddd529b
Signed by: gwmngilfen
SSH key fingerprint: SHA256:dNHcz65ApR68w2TkCIAXDBdt4oNL62Fyx48U7dXWuk0
3 changed files with 29 additions and 1 deletions

View 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)

View file

@ -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

View file

@ -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