[Nagios-devel] Patch for check_nt.c
g.vickers at qut.edu.au
Thu Dec 4 21:51:59 UTC 2003
Please find attached my patch for version 220.127.116.11 of check_nt.c. This patch
adds the ability to check disk space based on the amount of Mb left on a
partition. I wrote this because 1% of a 100Gb partition is still a lot of
The command line option is -m or --mb. The logic behind the checks is
reversed against the percentage checks: the percentage method checks
against the amount of disk space used; the Mb method checks against the
amount of free space left.
I could have got the same functionality from NRPE_NT or by using a 3rd
party solution, but I haven't had cause to deploy NRPE_NT yet, so I decided
to patch check_nt.c.
I used Mb values rather than Gb values because of the use of the unsigned
long type for the percentage values, which are used extensively through out
check_nt.c. So rather than rewrite a lot of check_nt.c so you could
specify, say, -w 1.2 (Gb), I decided to use Mb value on the command line.
(Debugging revealed that when a float value is converted into an unsigned
long, you would get a negative value in that unsigned long - not good when
checking remaining disk space!)
Yves: I've submitted this patch to sourceforge.
Computer Systems Officer
Student Support and Systems,
Teaching and Learning Support Systems,
Queensland University of Technology,
Kelvin Grove Campus,
CRICOS No 00213J
Ph: 07 3864 8276 Fax: 07 3864 5425
Mob: 0416 001 674 SD: #66147
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4110 bytes
Desc: not available
More information about the Nagios-devel