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.
I am using Nagiosql frontend (3.4) for the core (4.2.4). I noticed "Restart Nagios - Do it" not actually restarting the nagios daemon. Doing some research on that, I got below code which I can try through cli.
#!/bin/sh
# This is a sample shell script showing how you can submit the RESTART_PROGRAM command
# to Nagios. Adjust variables to fit your environment as necessary.
now=`date +%s`
commandfile='/usr/local/nagios/var/rw/nagios.cmd'
/bin/printf "[%lu] RESTART_PROGRAM\n" $now > $commandfile
However, even after running the above script, I see it makes no difference. I see this in the log when i run the script ,
You may need to refresh your browser or clarify how you tested. I tested by making a small change to a hostname, ran the restart script, and then refreshed the page and could see the change was applied.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Apologies for the delayed response. The way I am testing is, after I hit "Restart Nagios" in nagioql, I login to "thruk" to see if there is any changes being reflected but I see none. However I can see after running "service nagios restart" through cli.
Are you sure nagiosql is in fact running the RESTART_PROGRAM command? Is it successfully writing the config changes to disk(/usr/local/nagios/etc/objects/) before doing so?
Given both nagiosql and thruk are third party tools, a better test of the nagios system would be to make a change to a config file(usr/local/nagios/etc/objects/), run the script again, and then look for the change in the Nagios web interface.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.