[Fusion Error in RHEL 9] Undefined array key 1 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 102
Posted: Mon May 06, 2024 5:01 am
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.
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.