Checking configuration with restarting?

C. Bensend benny at bennyvision.com
Mon Nov 4 20:23:49 CET 2002


On Mon, Nov 04, 2002 at 01:06:44PM -0600, Rob King wrote:
> Hey everyone,
>     Right, I knew about that. The issue is that when I do that, Nagios 
> still restarts - and if there's an error in the configuration files, the 
> CGI's all show inaccurate information.
> 
>     Is there any way to test the configuration without restarting?

Hey Rob,

	I wrote two short scripts named 'preflight' and
'reload', and placed them in the Nagios user's $PATH.  I
am in the habit of doing a 'preflight' after making config
changes, and then doing a 'reload' (all of this as the
user Nagios is running as) to restart Nagios.

preflight:

#!/bin/bash

/path/to/nagios/bin/nagios -v /path/to/nagios/etc/nagios.cfg


reload:

#!/bin/bash

kill -HUP `cat /path/to/nagios/var/nagios.lock`


HTH,

Benny


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There's always time for Cheerios...


-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com




More information about the Users mailing list