--- plugins/check_nt.c.orig 2005-01-20 17:17:40.000000000 -0500 +++ plugins/check_nt.c 2005-01-20 18:01:43.000000000 -0500 @@ -43,6 +43,7 @@ #define CHECK_MEMUSE 7 #define CHECK_COUNTER 8 #define CHECK_FILEAGE 9 +#define CHECK_FREEDISKSPACE 10 #define MAX_VALUE_LIST 30 #define PORT 1248 @@ -185,7 +186,7 @@ return_code=STATE_OK; } - else if(vars_to_check==CHECK_USEDDISKSPACE){ + else if(vars_to_check==CHECK_USEDDISKSPACE || vars_to_check==CHECK_FREEDISKSPACE){ return_code=STATE_UNKNOWN; if (check_value_list==TRUE) { @@ -210,9 +211,13 @@ free_disk_space / 1073741824, (free_disk_space / total_disk_space)*100); - if(check_critical_value==TRUE && percent_used_space >= critical_value) + if(check_critical_value==TRUE && ( + (vars_to_check==CHECK_USEDDISKSPACE && percent_used_space >= critical_value) || + (vars_to_check==CHECK_FREEDISKSPACE && free_disk_space / 1048576 <= critical_value))) return_code=STATE_CRITICAL; - else if (check_warning_value==TRUE && percent_used_space >= warning_value) + else if (check_warning_value==TRUE && ( + (vars_to_check==CHECK_USEDDISKSPACE && percent_used_space >= warning_value) || + (vars_to_check==CHECK_FREEDISKSPACE && free_disk_space / 1048576 <= warning_value))) return_code=STATE_WARNING; else return_code=STATE_OK; @@ -477,6 +482,8 @@ vars_to_check=CHECK_COUNTER; else if(!strcmp(optarg,"FILEAGE")) vars_to_check=CHECK_FILEAGE; + else if(!strcmp(optarg,"FREEDISKSPACE")) + vars_to_check=CHECK_FREEDISKSPACE; else return ERROR; break; @@ -541,7 +548,9 @@ " Thresholds are percentage and up to 10 requests can be done in one shot. ie: -l 60,90,95,120,90,95\n" " UPTIME = Get the uptime of the machine. No specific parameters. No warning or critical threshold\n" " USEDDISKSPACE = Size and percentage of disk use. Request a -l parameter containing the drive letter only.\n" - " Warning and critical thresholds can be specified with -w and -c.\n" + " Warning and critical thresholds can be specified (in percentage used) with -w and -c.\n" + " FREEDISKSPACE = Size and percentage of disk use. Request a -l parameter containing the drive letter only.\n" + " Warning and critical thresholds can be specified (in megabytes free) with -w and -c.\n" " MEMUSE = Memory use. Warning and critical thresholds can be specified with -w and -c.\n" " SERVICESTATE = Check the state of one or several services. Request a -l parameters with the following syntax:\n" " -l ,,,... You can specify -d SHOWALL in case you want to see working services\n"