Plugin that will test nagios.cfg
Arno Lehmann
al at its-lehmann.de
Thu Jun 21 22:43:38 CEST 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...
> I want this because I reload the nagios config every 15 minutes through
> a cronjob. And I want to be notified if there is a error in the config.
> The reason of using a cronjob is that custom programs populate/change my
> .cfg files
Look:
elf:~ # /usr/local/nagios2/bin/nagios -v /etc/passwd >/dev/null 2>&1;
echo $?
254
elf:~ # /usr/local/nagios2/bin/nagios -v /etc/nagios2/nagios.cfg
>/dev/null 2>&1; echo $?
0
So, just do a configuration test, and reload only if the result code
is zero, otherwise inform the operator.
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