Reloading configuration on-the-fly

Gary Every gevery at gmail.com
Fri Jul 1 20:33:20 CEST 2011


I wrote a script for checking first, then reloading nagios. It's pretty
simple:

<snip>
#!/bin/bash

cd /etc/nagios
/usr/bin/nagios -v nagios.cfg
RETVAL=$?
if [ "$RETVAL" = "0" ]
then
service nagios reload
exit 0
else
echo "#########   ERROR IN CONFIG   ##############"
echo "# Please fix the above issue and try again #"
echo "############################################"
exit 1
fi

</snip>


On Fri, Jul 1, 2011 at 11:08 AM, Edwin Zoeller
<Edwin.Zoeller at ama-assn.org>wrote:

> Also, if on Linux OS, make it a service and all you have to do is issue:
> service Nagios reload
>
>
> -----Original Message-----
> From: Jim Avery [mailto:jim at jimavery.me.uk]
> Sent: Friday, July 01, 2011 10:49 AM
> To: Nagios Users List
> Subject: Re: [Nagios-users] Reloading configuration on-the-fly
>
> On 1 July 2011 16:22, nag ios <nagiostool at gmail.com> wrote:
> > can u let me know the on-fly process in detail.....????
>
>
> You can send a HUP signal to the Nagios daemon to tell it to re-read the
> configuration.
>
> Make sure you verify the configs first though:
>
> /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
>
> Then:
>
> kill -1 `cat /usr/local/nagios/var/nagios.lock`
>
> ------------------------------------------------------------------------
> ------
> All of the data generated in your IT infrastructure is seriously
> valuable.
> Why? It contains a definitive record of application performance,
> security threats, fraudulent activity, and more. Splunk takes this data
> and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> 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
>
>
> ------------------------------------------------------------------------------
> All of the data generated in your IT infrastructure is seriously valuable.
> Why? It contains a definitive record of application performance, security
> threats, fraudulent activity, and more. Splunk takes this data and makes
> sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-d2d-c2
> _______________________________________________
> 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
>



-- 
Gary Every
"Pay it Forward!"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110701/147a51a7/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
-------------- next part --------------
_______________________________________________
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