Wrong System Status

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mopp
Posts: 64
Joined: Thu Aug 20, 2015 7:15 am

Wrong System Status

Post 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 :-)
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Wrong System Status

Post 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.
Be sure to check out the Knowledgebase for helpful articles and solutions!
mopp
Posts: 64
Joined: Thu Aug 20, 2015 7:15 am

Re: Wrong System Status

Post by mopp »

Yes, it is the same bug.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Wrong System Status

Post by rkennedy »

Sounds good - I'll leave this thread open should you have further questions once 5.4.1 is released.
Former Nagios Employee
Locked