Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Does your /etc/init.d/nagios have checkconfig="true"? If so it does do a config verification, however any output is redirected to a file for logging (/tmp/.configtest.XXXXXXXX)
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
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
;;
*)
echo "Usage: nagios {start|stop|restart|reload|force-reload|status|check}"
exit 1
;;
esac
# End of this script
On the 3.05b version - when a reload command was executed, the config files were checked for errors and if there were any problems it would not reload .
Looks like I would need to change the current version reload settings to match that of the old reload settings to accomplish this?
I would tend to agree, the 3.05 one looks correct. As a side note, the init scripts are a part of several bug fixes that are being worked on or have already been completed for core.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
I upgraded to 4.0.4 last week and noticed right away that the configuration check that I was used to seeing in 3.0b5 upon a nagios service reload was working again in the new version.