[Fusion Error in RHEL 9] Undefined array key 1 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 102

This support forum board is for questions relating to Nagios Fusion.
Post Reply
SBhambri
Posts: 10
Joined: Sun Mar 29, 2020 9:34 pm

[Fusion Error in RHEL 9] Undefined array key 1 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 102

Post by SBhambri »

o Alot of repeat errors in usr/local/nagiosfusion/var/log/sysstat_subsys.log.org in RHEL 9.
o Issue look to be due to changes in " /usr/bin/iostat" output.

### Error###

[root@xxxx /usr/local/nagiosfusion/var/log]# tail -50 sysstat_subsys.log.org
PHP Warning: Undefined array key 3 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 65
PHP Warning: Undefined array key 4 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 66
PHP Warning: Undefined array key 5 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 67
PHP Warning: Undefined array key 1 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 102
PHP Warning: Undefined array key 2 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 103
PHP Warning: Undefined array key 3 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 104
PHP Warning: Undefined array key 4 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 105
PHP Warning: Undefined array key 5 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 106
PHP Warning: Undefined array key 3 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 65
PHP Warning: Undefined array key 4 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 66

##########

###Issue###

o In file /usr/local/nagiosfusion/cron/sysstat_subsys.php, script refer to check 2 tail lines
// GET IOSTAT INFO
$cmdline = sprintf("/usr/bin/iostat -c 5 2 | tail --lines=2 | head --lines=1 | awk '{ print $1,$2,$3,$4,$5,$6 }'");
$output = array();
exec($cmdline, $output, $return_code);


o However, it returns blank in RHEL 9.
[root@RHEL9 log]# /usr/bin/iostat -c 5 2 | tail --lines=2 | head --lines=1 | awk '{ print $1,$2,$3,$4,$5,$6 }'

[root@RHEL9 log]#


o In RHEL 7, script works fine
[root@RHEL7 includes]# /usr/bin/iostat -c 5 2 | tail --lines=2 | head --lines=1 | awk '{ print $1,$2,$3,$4,$5,$6 }'
29.85 0.00 1.97 0.10 0.00 68.08
[root@RHEL7 includes]#


##########

##Workaround##
o Modify /usr/local/nagiosfusion/cron/sysstat_subsys.php, script refer to check 4 tail lines
// GET IOSTAT INFO
$cmdline = sprintf("/usr/bin/iostat -c 5 2 |tail --lines=4 | head --lines=1 | awk '{ print $1,$2,$3,$4,$5,$6 }'");
$output = array();
exec($cmdline, $output, $return_code);


o Output.
[root@RHEL9 log]# /usr/bin/iostat -c 5 2 | tail --lines=4 | head --lines=1 | awk '{ print $1,$2,$3,$4,$5,$6 }'
1.27 0.00 0.10 0.07 0.00 98.57
[root@RHEL9 log]#


#############

Hi Team, Please let me know if the above workaround will be persistent in future fusion upgrades.
User avatar
ajcoil
Posts: 59
Joined: Wed Aug 09, 2023 10:30 am

Re: [Fusion Error in RHEL 9] Undefined array key 1 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 102

Post by ajcoil »

Hello @SBhambri,

Thank you for reaching out!

Sorry to hear you ran into this issue, it should be resolved in a future release of Fusion.

I would recommend keeping an eye on the Fusion changelog to see when this fix has been addressed.

If you have any other questions, concerns, or issues, feel free to reach out!
Post Reply