0

In the NagiosQL web GUI, section Tools -> Nagios Control, clicking the button the restart Nagios does not properly restart Nagios. This is evident if you look in /usr/local/nagios/var/rw after sending the restart request. Notice that "nagios.cmd"'s timestamp is updated but "live" and "nagios.qh" are old. This is not the case when restarting via command line (service nagios restart).

No errors are reported anywhere and the nagios.log has nothing.
My file permissions are correct for the rw directory:
drwxrws--- nagios nagcmd rw

user2423096
  • 53
  • 1
  • 8

2 Answers2

1

I've changed /usr/local/nagios/share/nagiosql/admin/verify.php at line 345 to look like:

$strCommandString = "[".mktime()."] RESTART_PROGRAM\n";

That solved the problem.

My versions are
Nagios Core: 4.2.4
NagiosQL: 3.2.0

0

I actually posted this just to answer my own question. I lost countless hours trying to find the answer, which I wrote down and now cannot find the source again. Hope this helps.

vi /usr/local/nagios/share/nagiosql/admin/verify.php

At line 345, change line “A” to look like line “B”:

A: $strCommandString = “[“.mktime().”] RESTART_PROGRAM;”.mktime();

B: $strCommandString = “[“.mktime().”] RESTART_PROGRAM;”.mktime().”\n”;

The problem is due to some sort of mismatch between NagiosQL's commands and how Nagios reads them. My versions are:

Nagios Core: 4.2.1

NagiosQL: 3.2.0

user2423096
  • 53
  • 1
  • 8