Add check_lock
This commit is contained in:
parent
92600123f7
commit
f039f3d655
3 changed files with 20 additions and 0 deletions
1
files/nagios/client/check_lock.cfg
Normal file
1
files/nagios/client/check_lock.cfg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
command[check_lock]=/usr/lib/nagios/plugins/check_lock
|
17
files/nagios/client/scripts/check_lock
Executable file
17
files/nagios/client/scripts/check_lock
Executable file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import fcntl
|
||||||
|
import sys
|
||||||
|
|
||||||
|
try:
|
||||||
|
f = open('/mnt/koji/.nagios_test', 'r')
|
||||||
|
f.close()
|
||||||
|
f = open('/mnt/koji/.nagios_test', 'w')
|
||||||
|
except IOError:
|
||||||
|
print "Could not create file"
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
|
fcntl.flock(f, fcntl.LOCK_EX)
|
||||||
|
f.close()
|
||||||
|
print "File Locked Successfully"
|
||||||
|
sys.exit(0)
|
|
@ -22,6 +22,7 @@
|
||||||
with_items:
|
with_items:
|
||||||
- check_postfix_queue
|
- check_postfix_queue
|
||||||
- check_raid.py
|
- check_raid.py
|
||||||
|
- check_lock
|
||||||
|
|
||||||
# create dirs
|
# create dirs
|
||||||
# puppet used to make /var/spool/nagios (owned by nagios.nagios) mode 750
|
# puppet used to make /var/spool/nagios (owned by nagios.nagios) mode 750
|
||||||
|
@ -50,6 +51,7 @@
|
||||||
- check_disk.cfg
|
- check_disk.cfg
|
||||||
- check_swap.cfg
|
- check_swap.cfg
|
||||||
- check_postfix_queue.cfg
|
- check_postfix_queue.cfg
|
||||||
|
- check_lock.cfg
|
||||||
notify:
|
notify:
|
||||||
- restart nrpe
|
- restart nrpe
|
||||||
tags:
|
tags:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue