I/O Wait Checks

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
andyb4u
Posts: 114
Joined: Tue Aug 15, 2017 1:58 am

I/O Wait Checks

Post by andyb4u »

Hi,

I've been asked to find out how the command check_xi_nagiosxiserver using --mode=iowait calculates I/O wait and is this any different from how I/O wait is calculated by using check_nrpe with check_cpu_stats?
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

Re: I/O Wait Checks

Post by dchurch »

check_xi_nagiosxiserver ultimately queries the recorded value in the database (xi_systat table).

IO Wait is collected on a delay and stored in a single record in the database that gets overwritten. How this is collected can be seen in /usr/local/nagiosxi/cron/sysstat.php around line 232:

Code: Select all

/usr/bin/iostat -c 5 2 | grep -v '^ *$' | tail -1 | awk '{ print $1,$2,$3,$4,$5,$6 }'
This is then split into component parts, serialized and stored in the database.

check_nrpe with check_cpu_stats calls the script at /usr/local/nagios/libexec/check_cpu_stats.sh

This collects IO Wait data around line 118:

Code: Select all

    Linux ) CPU_REPORT=`iostat -c 5 2 |  tr -s ' ' ';' | sed '/^$/d' | tail -1`
            CPU_USER=`echo $CPU_REPORT | cut -d ";" -f 2`
            CPU_SYSTEM=`echo $CPU_REPORT | cut -d ";" -f 4`
            CPU_IOWAIT=`echo $CPU_REPORT | cut -d ";" -f 5`
            CPU_IDLE=`echo $CPU_REPORT | cut -d ";" -f 7`
Since NRPE isn't dependent on a database, the method of retrieval is necessarily different.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
Locked