Page 1 of 1

Wrong System Status

Posted: Mon Jan 16, 2017 9:54 am
by mopp
Nagios XI 5.4.0
URL: /nagiosxi/admin/?xiwindow=sysstat.php
Database Backend: Is Not Running

Code: Select all

# php /usr/local/nagiosxi/cron/sysstat.php
DB BACKEND:
Array
(
    [last_checkin] => 2017-01-16 15:36:23
    [bytes_processed] => 21154022
    [entries_processed] => 38572
    [connect_time] => 2017-01-16 14:56:44
    [disconnect_time] => 0000-00-00 00:00:00
)
CMDLINE=/etc/init.d/nagios status
nagios (pid 1619) is running...
OUTPUT=nagios (pid 1619) is running...
RETURNCODE=0
CMDLINE=/etc/init.d/npcd status
NPCD running (pid 1508).
OUTPUT=NPCD running (pid 1508).
RETURNCODE=0
CMDLINE=systemctl status ndo2db
sh: systemctl: command not found
OUTPUT=
RETURNCODE=127
DAEMONS:
Array
(
    [nagioscore] => Array
        (
            [daemon] => nagios
            [output] => nagios (pid 1619) is running...
            [return_code] => 0
            [status] => 0
        )

    [pnp] => Array
        (
            [daemon] => npcd
            [output] => NPCD running (pid 1508).
            [return_code] => 0
            [status] => 0
        )

    [ndoutils] => Array
        (
            [daemon] => ndo2db
            [output] =>
            [return_code] => 127
            [status] => 1
        )

)
Chcked the file /usr/local/nagiosxi/cron/sysstat.php line 144:

Code: Select all

if (file_exists('/usr/lib/systemd')) {
I installed a RPM package which puts a file in /usr/lib/systemd. Some packages which are build for old init scripts and systemd are doing this.
The problem is the Nagios appliance does not have the command systemctl, so the check will fail. I don' t understand why the other daemon checks are okay, but anyway the systemd detection is not perfect this way. This check should be better, but not perfect.

Code: Select all

if (file_exists('/bin/systemctl')) {
If you accept this is a bug and fix it you can close the thread :-)

Re: Wrong System Status

Posted: Mon Jan 16, 2017 12:32 pm
by bwallace
Good catch and yes, this is a bug which will be fixed in 5.4.1 as mentioned on the last page of this thread (see reply from jomann)
https://support.nagios.com/forum/viewto ... 0&start=30

Read it over and I'll leave this thread open in the meantime just in case you find your situation differs, but It seems to be the same thing to me.

Re: Wrong System Status

Posted: Tue Jan 17, 2017 2:27 am
by mopp
Yes, it is the same bug.

Re: Wrong System Status

Posted: Tue Jan 17, 2017 10:25 am
by rkennedy
Sounds good - I'll leave this thread open should you have further questions once 5.4.1 is released.