Page 1 of 1

disbale SMS alert

Posted: Wed May 05, 2010 7:01 am
by samengr
Hi guys,

I have nagios working in my office. Problem is if I make any changes in config and restart the service I get sms alerts. All I wanted to know is there any good way by taking all nagios config in maintenance mode so I shouldnt get any sms alert for that time?

Today I replace the sms entry in contacts.cfg with a temp email id.

define contact{
contact_name ABCSMS
alias ABCSMS
service_notification_period workhours
host_notification_period workhours
service_notification_options c,r
host_notification_options d,r
service_notification_commands notify-by-sms
host_notification_commands host-notify-by-sms
# email 07---------.nqsgq---@24xgateway.com
email abc@officedomain.com
}
After making changes I restarted the nagios service and tested every thing was fine. but when I put the sms gateway back in contacts.cfg and restarted the nagios service I got 1000 sms again ... :-( As restarting nagios send alerts that these services/hosts are down .....

If we make any changes in contacts.cfg do we have to restart the nagios service?

Many thanks in advance.

Sam

Re: disbale SMS alert

Posted: Thu May 06, 2010 8:32 am
by samengr
A normal rule is that when you make modifications to the Nagios configuration files you have to restart Nagios. When you make modifications to the objects files, you just have to reload Nagios.

When I reload nagios it finds like unable to read any host and all services are down and then it throws huge number of SMS alert to me. All I can't understand if I run /etc/init.d/nagios reload then it shouldnt behave like this. I mean just read the new changes in config but shouldn't break the existing sessions.

Any help?

Re: disbale SMS alert

Posted: Thu May 06, 2010 8:34 am
by samengr
See the reload module in /etc/init.d/nagios script

reload|force-reload)
printf "Running configuration check..."
$NagiosBin -v $NagiosCfgFile > /dev/null 2>&1;
if [ $? -eq 0 ]; then
echo "done"
if test ! -f $NagiosRunFile; then
$0 start
else
NagiosPID=`head -n 1 $NagiosRunFile`
if status_nagios > /dev/null; then
printf "Reloading nagios configuration..."
killproc_nagios nagios -HUP
echo "done"
else
$0 stop
$0 start
fi
fi
else
#$NagiosBin -v $NagiosCfgFile
echo " FAILED! Reload aborted. Check your Nagios configuration."
exit 1
fi