Plugin that will test nagios.cfg

Thomas Guyot-Sionnest dermoth at aei.ca
Fri Jun 22 21:30:53 CEST 2007


On 22/06/07 10:23 AM, Hari Sekhon wrote:
> 
>>
>> One everyone uses init scripts. Nagios can also be restarted via
>> signals, web interface and directly trough the command pipe. Any of
>> these methods won't do any sanity checking.
>>
>>   
> Do you mean "Not everyone uses init script"?

Yes of course :)

>> The init script does pretty much what I put in my bash example (and even
>> more sanity checking)... BTW it checks the config on restarts too, so
>> maybe you're running an old version...
>>
>>   
> nagios 2.5 as I mentioned. not too old I think.
> 
> It does check on restart, but the difference is that nagios is stopped
> so it can't start with the broken config, therefore it is no longer
> running, whereas if I do a reload instead then nagios is still running
> and I get the error checking but nagios is still up with the old config
> until I fix the new config and do another reload. Nagios basically stays
> up and keeps it's existing config if the new config doesn't pass the
> pre-flight check.

>From a 2-3 month old cvs checkout:

        restart)
                printf "Running configuration check..."
                $NagiosBin -v $NagiosCfgFile > /dev/null 2>&1;
                if [ $? -eq 0 ]; then
                        echo "done"
                        $0 stop
                        $0 start
                else
                        #$NagiosBin -v $NagiosCfgFile
                        echo " FAILED!  Restart aborted.  Check your
Nagios configuration."
                        exit 1
                fi
                ;;



Thomas
> 
> -h
> 
> 
> 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list