1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-22 02:13:44 +01:00

new check_nagios scripts added

This commit is contained in:
Pall Sigurdsson 2011-12-02 09:46:11 +00:00
parent 359d5d3cc6
commit c3b021f1dc
3 changed files with 32 additions and 0 deletions

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

View 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

View File

@ -1,2 +1,4 @@
command[check_nagios_configuration]=/usr/lib64/nagios/plugins/check_nagios_configuration 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_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