mirror of
https://github.com/opinkerfi/nagios-plugins.git
synced 2024-11-21 18:03:45 +01:00
new check_nagios scripts added
This commit is contained in:
parent
359d5d3cc6
commit
c3b021f1dc
20
check_nagios/check_nagios_needs_reload
Executable file
20
check_nagios/check_nagios_needs_reload
Executable file
@ -0,0 +1,20 @@
|
||||
#!/usr/bin/python
|
||||
# Checks if nagios service needs a reload
|
||||
|
||||
import sys
|
||||
try:
|
||||
from pynag.Parsers import config
|
||||
|
||||
c = config(cfg_file='/etc/nagios/nagios.cfg')
|
||||
c.parse()
|
||||
result = c.needs_reparse()
|
||||
|
||||
if result == True:
|
||||
print "Warning - Nagios configuration has changed since last restart"
|
||||
sys.exit(1)
|
||||
else:
|
||||
print "OK - Nagios service has been restarted since last config change"
|
||||
sys.exit(0)
|
||||
except Exception, e:
|
||||
print "Unknown - Error running script: %s" % e
|
||||
sys.exit(3)
|
10
check_nagios/check_nagios_plugin_existance
Executable file
10
check_nagios/check_nagios_plugin_existance
Executable file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import sys,os
|
||||
sys.path.append('/opt/pynag')
|
||||
from pynag import Model
|
||||
|
||||
all_commands = Model.Command.objects.all
|
||||
for c in all_commands:
|
||||
print c.command_line
|
||||
|
@ -1,2 +1,4 @@
|
||||
command[check_nagios_configuration]=/usr/lib64/nagios/plugins/check_nagios_configuration
|
||||
command[check_nagios_ghostservices]=/usr/lib64/nagios/plugins/check_nagios_ghostservices
|
||||
command[check_nagios_needs_reload]=/usr/lib64/nagios/plugins/check_nagios_needs_reload
|
||||
command[check_nagios_plugin_existance]=/usr/lib64/nagios/plugins/check_nagios_plugin_existance
|
||||
|
Loading…
Reference in New Issue
Block a user