[Nagiosplug-devel] Bug and fix for the check_disk plugin

Thomas Guyot-Sionnest dermoth at aei.ca
Thu Nov 6 23:48:11 CET 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Erik Welch wrote:
> Bug in plugins/check_disk.c from nagios-plugins-1.4.12 (and prior)
> * $Id: check_disk.c 1991 2008-05-07 10:02:42Z dermoth $
>  
> The program collects the mounted filesystem data before it processes the
> command line arguments. This is a problem for multiple reasons:
> * Why spend cycles on the filesystem if there is an error or --help in
> the arguments?
> * The argument processing stats the -p options to mount them in an
> autofs environment, but they won't have been mounted yet...
>  
> Detailed output showing the autofs problem:
> $ sudo umount /home/userdir
> $ plugins/check_disk -w 5% -c 1% -vvvvv -e -p /home/userdir
> calling stat on /home/userdir
> Thresholds(pct) for /home/userdir warn: 5.000000 crit 1.000000
> calling stat on /home/userdir
> DISK UNKNOWN - free space:|
>  
> Simply changing the order of the mount_list creation does not fix the
> problem as process_arguments uses the mount list in calls to
> np_set_best_match(), but does nothing with the results.  I commented
> them and now the program works as it should.
>  
> Diff output:
> $ diff check_disk.c check_disk.c.new
> 193,194d192
> <   mount_list = read_file_system_list (0);
> <
> 200a199,200
>>   mount_list = read_file_system_list (0);
>>
> 642c642
> <       np_set_best_match(se, mount_list, exact_match);
> ---
>>       /* np_set_best_match(se, mount_list, exact_match); */
> 750c750
> <       np_set_best_match(path_select_list, mount_list, exact_match);
> ---
>>       /* np_set_best_match(path_select_list, mount_list, exact_match); */

Thank you for your bug report. Could you please send you patch as
unified diff (diff -u check_disk.c check_disk.c.new) and I will most
likely apply it to SVN.

Thanks

- --
Thomas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJE3Qq6dZ+Kt5BchYRAuwVAKDOc8uo8psVPA3TCtk6AlWZ18Cd6wCg2U7G
ZxCMP5az7p7lEWJhMVovcB4=
=5eDv
-----END PGP SIGNATURE-----




More information about the Devel mailing list