Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [Nagios-users] Plugin that will test nagios.cfg

From: Arno Lehmann <al(at)its-lehmann.de>
Date: Thu Jun 21 2007 - 16:43:38 EDT


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

Do you need help?X

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



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 Received on Thu Jun 21 16:44:01 2007

This archive was generated by hypermail 2.1.8 : Thu Jun 21 2007 - 16:50:02 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library