diff options
Diffstat (limited to 'web/attachments/116576-check_nt.c.patch')
-rw-r--r-- | web/attachments/116576-check_nt.c.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/web/attachments/116576-check_nt.c.patch b/web/attachments/116576-check_nt.c.patch new file mode 100644 index 0000000..30a4653 --- /dev/null +++ b/web/attachments/116576-check_nt.c.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | --- plugins/check_nt.c.orig 2005-01-20 17:17:40.000000000 -0500 | ||
2 | +++ plugins/check_nt.c 2005-01-20 18:01:43.000000000 -0500 | ||
3 | @@ -43,6 +43,7 @@ | ||
4 | #define CHECK_MEMUSE 7 | ||
5 | #define CHECK_COUNTER 8 | ||
6 | #define CHECK_FILEAGE 9 | ||
7 | +#define CHECK_FREEDISKSPACE 10 | ||
8 | #define MAX_VALUE_LIST 30 | ||
9 | |||
10 | #define PORT 1248 | ||
11 | @@ -185,7 +186,7 @@ | ||
12 | return_code=STATE_OK; | ||
13 | } | ||
14 | |||
15 | - else if(vars_to_check==CHECK_USEDDISKSPACE){ | ||
16 | + else if(vars_to_check==CHECK_USEDDISKSPACE || vars_to_check==CHECK_FREEDISKSPACE){ | ||
17 | |||
18 | return_code=STATE_UNKNOWN; | ||
19 | if (check_value_list==TRUE) { | ||
20 | @@ -210,9 +211,13 @@ | ||
21 | free_disk_space / 1073741824, (free_disk_space / total_disk_space)*100); | ||
22 | |||
23 | |||
24 | - if(check_critical_value==TRUE && percent_used_space >= critical_value) | ||
25 | + if(check_critical_value==TRUE && ( | ||
26 | + (vars_to_check==CHECK_USEDDISKSPACE && percent_used_space >= critical_value) || | ||
27 | + (vars_to_check==CHECK_FREEDISKSPACE && free_disk_space / 1048576 <= critical_value))) | ||
28 | return_code=STATE_CRITICAL; | ||
29 | - else if (check_warning_value==TRUE && percent_used_space >= warning_value) | ||
30 | + else if (check_warning_value==TRUE && ( | ||
31 | + (vars_to_check==CHECK_USEDDISKSPACE && percent_used_space >= warning_value) || | ||
32 | + (vars_to_check==CHECK_FREEDISKSPACE && free_disk_space / 1048576 <= warning_value))) | ||
33 | return_code=STATE_WARNING; | ||
34 | else | ||
35 | return_code=STATE_OK; | ||
36 | @@ -477,6 +482,8 @@ | ||
37 | vars_to_check=CHECK_COUNTER; | ||
38 | else if(!strcmp(optarg,"FILEAGE")) | ||
39 | vars_to_check=CHECK_FILEAGE; | ||
40 | + else if(!strcmp(optarg,"FREEDISKSPACE")) | ||
41 | + vars_to_check=CHECK_FREEDISKSPACE; | ||
42 | else | ||
43 | return ERROR; | ||
44 | break; | ||
45 | @@ -541,7 +548,9 @@ | ||
46 | " Thresholds are percentage and up to 10 requests can be done in one shot. ie: -l 60,90,95,120,90,95\n" | ||
47 | " UPTIME = Get the uptime of the machine. No specific parameters. No warning or critical threshold\n" | ||
48 | " USEDDISKSPACE = Size and percentage of disk use. Request a -l parameter containing the drive letter only.\n" | ||
49 | - " Warning and critical thresholds can be specified with -w and -c.\n" | ||
50 | + " Warning and critical thresholds can be specified (in percentage used) with -w and -c.\n" | ||
51 | + " FREEDISKSPACE = Size and percentage of disk use. Request a -l parameter containing the drive letter only.\n" | ||
52 | + " Warning and critical thresholds can be specified (in megabytes free) with -w and -c.\n" | ||
53 | " MEMUSE = Memory use. Warning and critical thresholds can be specified with -w and -c.\n" | ||
54 | " SERVICESTATE = Check the state of one or several services. Request a -l parameters with the following syntax:\n" | ||
55 | " -l <service1>,<service2>,<service3>,... You can specify -d SHOWALL in case you want to see working services\n" | ||