sysstat_subsys.php giving errors - RHEL8 iostat (4.1.9)

This support forum board is for questions relating to Nagios Fusion.
Locked
zebee
Posts: 7
Joined: Wed Aug 14, 2019 4:54 pm

sysstat_subsys.php giving errors - RHEL8 iostat (4.1.9)

Post by zebee »

In fusion 4.1.9 I am seeing errors in the sysstat_subsys.php log:
PHP Notice: Undefined offset: 1 in /usr/local/nagiosfusion/cron/sysstat_subsys.php on line 102

that is because iostat in Rhel8 is different to previous versions:
[root@mondevappla002 log]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.4 (Ootpa)
[root@mondevappla002 log]# echo "###########"; /usr/bin/iostat -c 5 2 | tail --lines=2 | head --lines=1; echo "##########"
###########

##########
[root@mondevappla002 log]#

as you can see the iostat command as uses in sysstat_subsys.php produces no output.

this is the same command on a Rhel7 box:

Here’s R7
[zebeejohnstone@ztest7 tmp]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.9 (Maipo)
[zebeejohnstone@ztest7 tmp]$ echo "##########"; /usr/bin/iostat -c 5 2 | tail --lines=2 | head --lines=1; echo "###############"
##########
0.30 0.00 0.20 0.00 0.00 99.50
###############
[zebeejohnstone@ztest7 tmp]$

In case you don't have an R8 box handy for the fix:
here is iostat on R8
[root@mondevappla002 log]# /usr/bin/iostat -c 5 2
Linux 4.18.0-305.7.1.el8_4.x86_64 (mondevappla002) 21/07/21 _x86_64_ (2 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle
4.86 0.02 0.88 0.04 0.00 94.20


avg-cpu: %user %nice %system %iowait %steal %idle
0.20 0.00 0.20 0.10 0.00 99.50


[root@mondevappla002 log]#
compared to R7
[zebeejohnstone@ztest7 tmp]$ iostat 5 2
Linux 3.10.0-1160.11.1.el7.x86_64 (ztest7.nix.au.singtelgroup.net) 07/21/21 _x86_64_ (2 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle
0.70 0.00 0.23 0.00 0.00 99.06

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
fd0 0.00 0.01 0.00 83284 0
sda 0.60 2.27 8.93 34054060 133619255
dm-0 0.58 0.26 8.53 3839136 127652592
dm-1 0.11 0.04 0.40 627500 5947820
dm-2 0.06 1.44 0.00 21571592 0

avg-cpu: %user %nice %system %iowait %steal %idle
0.10 0.00 0.10 0.00 0.00 99.80

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
fd0 0.00 0.00 0.00 0 0
sda 0.20 0.00 4.80 0 24
dm-0 0.20 0.00 4.80 0 24
dm-1 0.00 0.00 0.00 0 0
dm-2 0.00 0.00 0.00 0 0

[zebeejohnstone@ztest7 tmp]$
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: sysstat_subsys.php giving errors - RHEL8 iostat (4.1.9)

Post by gsmith »

Hi


Thanks for that information.

I have submitted a bug report to the developers.

Thanks again
Locked