RESTART_PROGRAM ext command not working

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

RESTART_PROGRAM ext command not working

Postby Pradeeps » Wed Dec 05, 2018 12:20 pm

Hello Folk,

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.

Code: Select all
#!/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 ,

Code: Select all
Dec  5 16:34:17 nagios-core-4 nagios: EXTERNAL COMMAND: RESTART_PROGRAM;
Dec  5 16:34:17 nagios-core-4 nagios: PROGRAM_RESTART event encountered, restarting...


but its not actually restarting the daemon. Can anyone give your ideas if am missing anything?
Pradeeps
 
Posts: 24
Joined: Thu Dec 22, 2016 11:05 am

Re: RESTART_PROGRAM ext command not working

Postby cdienger » Thu Dec 06, 2018 2:37 pm

It is performing a reload. It's like running "service nagios reload" instead of "service nagios restart".
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 2191
Joined: Tue Feb 07, 2017 11:26 am

Re: RESTART_PROGRAM ext command not working

Postby Pradeeps » Mon Dec 10, 2018 4:13 pm

That makes sense now. However, I dont see any new changes being reflected.
Pradeeps
 
Posts: 24
Joined: Thu Dec 22, 2016 11:05 am

Re: RESTART_PROGRAM ext command not working

Postby cdienger » Tue Dec 11, 2018 5:38 pm

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.
User avatar
cdienger
Support Tech
 
Posts: 2191
Joined: Tue Feb 07, 2017 11:26 am


Return to Nagios Core

Who is online

Users browsing this forum: dhirajsrajput, Google [Bot], Mahantesh, mouli449 and 30 guests