[Nagiosplug-devel] check_disk error on AIX 5.x with new /proc line in df output

Birkinbine, Brian brian.birkinbine at citigroup.com
Fri Jun 6 12:58:07 CEST 2003

I'm having problems with check_disk on AIX 5.1
I'm using nagios-plugins-1.3.0-beta3 on AIX 5.1

Here is the error I'm getting when using check_disk on AIX 5.1
	Unable to read output:
	/usr/bin/df -Pk
	/proc                   -         -         -       -  /proc

Apparently in AIX 5.1 (and AIX 5.2), there is a new line in the df output
that is not liked by the sscanf at line 99 of check_disk.c
Here is the new line in AIX 5.1 that shows the proc filesystem
/proc                   -         -         -       -  /proc

around line 99 of check_disk.c
if (sscanf (input_buffer, "%s %d %d %d %d%% %s", file_system,
                     &total_disk, &used_disk, &free_disk, &usp, mntp) == 6
                    sscanf (input_buffer, "%s %*s %d %d %d %d%% %s",
                                 &total_disk, &used_disk, &free_disk, &usp,
mntp) == 6) {

Basically, the sscanf fails and the if condition fails because the new /proc
format includes non %d compatible types (the - (dashes))

A hack workaround that I used was to just get rid of the else block at line
123 so the script wouldn't exit and continue processing the rest of the
output of df.  Not the best scenario, but allows me to get proper results

- - -
Brian Birkinbine

More information about the Devel mailing list