Plugin that will test nagios.cfg
Hari Sekhon
hpsekhon at googlemail.com
Fri Jun 22 12:51:06 CEST 2007
did you see my last email regarding this and reload vs restart?
also, something I forgot to add, here is a very basic shell test that I
run through cron to check nagios is up and email me if not:
$PLUGIN_DIR/check_nagios -F $NAGIOS_STATUS_LOG -e 5 -C $NAGIOS_BINARY > $LOG
if [ $? != 0 ]; then
/bin/mail -s "Nagios may not be running!" $RECIPIENT < $LOG >
/dev/null
fi
obviously you need to set the $VARIABLES to the paths of your nagios
binary, log file, plugin directory where the check_nagios plugin is located.
Hope that helps.
-h
Hari Sekhon
Arno Lehmann wrote:
> Hi,
>
> 21.06.2007 23:20,, Patrick Morris wrote::
>
>> Arno Lehmann schrieb am Donnerstag, den 21. Juni 2007:
>>
>>
>>> Hi,
>>>
>>> chiel schrieb:
>>>
>>>> I'm looking for a plugin that will check if the nagios.cfg is ok.
>>>> So besecauly run this command: "/usr/local/nagios/bin/nagios -v
>>>> /usr/local/nagios/etc/nagios.cfg". Is there a plugin for this?
>>>>
>>> Wouldn't it be better to check this in the cron job itself? Nagios
>>> won't help you much if it crashes because of a broken config.
>>>
>>> The cron job could, naturally, report problems as passive results to
>>> Nagios...
>>>
>> Nagios will never crash because of a broken config if it's running;
>> it just won't load that config. Checking from a cron job works, too,
>> but there's no reason Nagios can't also check to see if the on-disk
>> config is valid.
>>
>
> Well, I've seen Nagios crash on a broken config. Even if this is a bug
> which should (and perhaps is) fixed, I would not rely on that
> behaviour if I can easily avoid that.
>
> Thus my recommendation...
>
> Arno
>
> -------------------------------------------------------------------------
> 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
>
>
-------------------------------------------------------------------------
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