> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:nagios-users- > [EMAIL PROTECTED] On Behalf Of Hari Sekhon > Sent: Friday, June 22, 2007 9:24 AM > To: Thomas Guyot-Sionnest > Cc: nagios-users@lists.sourceforge.net > Subject: Re: [Nagios-users] Plugin that will test nagios.cfg > > > > > > 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"? > > > 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.
I'd say you're using a broken init script then. It's very clear that nagios verifies the config and only stops and starts if verification is OK. 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 ;; -- Marc ------------------------------------------------------------------------- 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@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