Hi team, I just want to use the Nagios for monitoring the routers/switch for my company. but found one challenge in nagios as whenever i am adding new device(s) in the tool for start monitoring this devices I would need to restart the Nagios everytime.
I just need to know is there any other way to read the updated config without restart the nagios daemon. Any other parser/supplier who can provide the updated configuration to the nagios daemon without restarting.
Please revert to me if we overcome this limiations.
Thanks in Advance.
How to read updated config file without restart the daemon
-
- Posts: 1
- Joined: Wed Apr 08, 2015 2:30 pm
Re: How to read updated config file without restart the daem
This is not currently possible. Configs are only read into nagios at the start (or restart) of the process.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: How to read updated config file without restart the daem
Hi, abrist.
Best regards,
Daniel
What about the "reload" option?abrist wrote:This is not currently possible. Configs are only read into nagios at the start (or restart) of the process.
Code: Select all
# /etc/init.d/nagios
Usage: nagios {start|stop|restart|reload|force-reload|status|check}
Code: Select all
# 1999-07-09 Karl DeBisschop <kdebisschop@infoplease.com>
# - setup for autoconf
# - add reload function
(...)
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
pid_nagios
if status_nagios > /dev/null; then
printf "Reloading nagios configuration..."
killproc_nagios nagios -HUP
echo "done"
else
$0 stop
$0 start
fi
fi
else
echo " CONFIG ERROR! Reload aborted. Check your Nagios configuration."
exit 1
fi
;;
Daniel
-
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: How to read updated config file without restart the daem
HUP is the same as a restart to the Nagios Daemon. There is an aesthetic difference in that you maintain the same PID, but the man behind the curtain is doing the same thing.DanielB wrote:Code: Select all
if test ! -f $NagiosRunFile; then $0 start else pid_nagios if status_nagios > /dev/null; then printf "Reloading nagios configuration..." killproc_nagios nagios -HUP echo "done" else $0 stop $0 start fi