[Nagiosplug-devel] Check_disk plugin update

Thomas Guyot-Sionnest dermoth at aei.ca
Fri Nov 7 21:45:48 CET 2008

Hash: SHA1

Erik Welch wrote:
> Ah, the benefits of unit testing. Proves me wrong when I so desperately deserve it :-).  My testing consisted of running it in my limited environment and it worked like a charm.  (This is what happens when you have a perl/python programmer learn enough C to try and debug a problem).  Your suggestion to rebuild the mount_list worked perfectly.
> On a system that had 120 mounts (115 automounts), there doesn't seem to be much of a performance hit, though I only check one path at a time. I umounted the test volume before each run, and did a couple runs of each binary, dropped the first time result of each, and averaged the times.  Let me know if you want anything more than the output of time for perf testing.
> $ time ./check_disk.badautofs -vvvv -w 5% -c 1% -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:|
> real    0m0.018s
> user    0m0.000s
> sys     0m0.000s
> $ time plugins/check_disk -vvvv -w 5% -c 1% -p /home/userdir
> calling stat on /home/userdir
> Thresholds(pct) for /home/userdir warn: 5.000000 crit 1.000000
> calling stat on /home/userdir
> For /home/userdir, total=2129920, available=1047858, available_to_root=1047858, used=1082062, fsp.fsu_files=4133162, fsp.fsu_ffree=4031761
> For /home/userdir, used_pct=51 free_pct=49 used_units=33814 free_units=32745 total_units=66560 used_inodes_pct=3 free_inodes_pct=97 fsp.fsu_blocksize=32768 mult=1048576
> Freespace_units result=0
> Freespace% result=0
> Usedspace_units result=0
> Usedspace_percent result=0
> Usedinodes_percent result=0
> Freeinodes_percent result=0
> DISK OK - free space: /home/userdir 32745 MB (49% inode=97%);| /home/userdir=33814MB;63232;65894;0;66560
> real    0m0.027s
> user    0m0.000s
> sys     0m0.000s
> Another thing that I've found is that the version of automount is important.
> One of my test systems RHEL R3U2 (kernel 2.4.21-47 automount v4.1.3-154) and none of the check_disk versions work. The stat() never seems to mount the volume. I'm not going to troubleshoot this as this is an old crufty system.
> The patched check_disk works on both my RedHat 7.2 (kernel 2.4.35 automount v3.1.7) and CentOS 4.5 (kernel, automount v5.0.2) systems.

Thanks. The mount_path will be rebuilt on each "-p" invocation... I'll
do some testing myself, but if you don't see any big difference with and
without the patch applied when specifying 10-15 path elements I'd say
it's fine.

> Can you run the attached patch through your unit tests to see if I break anything new?

Will do tonight and keep you in the loop.

> I couldn't find a way to add an ARGV to manage the repopulation of mount_list as it needs to happen during process_arguments() in the "case 'p'" section before the np_set_best_match() is executed, but I also couldn't spend much time on this now that I have a working solution...

Easy; I'll take care of it if needed. ;)


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


More information about the Devel mailing list