From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/116577-check_nt.c.patch | 65 +++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 web/attachments/116577-check_nt.c.patch (limited to 'web/attachments/116577-check_nt.c.patch') diff --git a/web/attachments/116577-check_nt.c.patch b/web/attachments/116577-check_nt.c.patch new file mode 100644 index 0000000..0d2daba --- /dev/null +++ b/web/attachments/116577-check_nt.c.patch @@ -0,0 +1,65 @@ +--- plugins/check_nt.c.orig 2005-01-20 17:27:47.000000000 -0500 ++++ plugins/check_nt.c 2005-01-20 18:01:41.000000000 -0500 +@@ -49,7 +49,8 @@ + CHECK_PROCSTATE, + CHECK_MEMUSE, + CHECK_COUNTER, +- CHECK_FILEAGE ++ CHECK_FILEAGE, ++ CHECK_FREEDISKSPACE + }; + + enum { +@@ -201,6 +202,7 @@ + break; + + case CHECK_USEDDISKSPACE: ++ case CHECK_FREEDISKSPACE: + + if (value_list==NULL) + output_message = strdup (_("missing -l parameters")); +@@ -212,8 +214,8 @@ + free_disk_space=atof(strtok(recv_buffer,"&")); + total_disk_space=atof(strtok(NULL,"&")); + percent_used_space = ((total_disk_space - free_disk_space) / total_disk_space) * 100; +- warning_used_space = ((float)warning_value / 100) * total_disk_space; +- critical_used_space = ((float)critical_value / 100) * total_disk_space; ++ warning_used_space = (vars_to_check==CHECK_FREEDISKSPACE)?(float)warning_value:((float)warning_value / 100) * total_disk_space; ++ critical_used_space = (vars_to_check==CHECK_FREEDISKSPACE)?(float)critical_value:((float)critical_value / 100) * total_disk_space; + + if (free_disk_space>=0) { + asprintf(&temp_string,_("%s:\\ - total: %.2f Gb - used: %.2f Gb (%.0f%%) - free %.2f Gb (%.0f%%)"), +@@ -223,9 +225,9 @@ + (total_disk_space - free_disk_space) / 1073741824, warning_used_space / 1073741824, + critical_used_space / 1073741824, total_disk_space / 1073741824); + +- if(check_critical_value==TRUE && percent_used_space >= critical_value) ++ if(check_critical_value==TRUE && free_disk_space <= critical_used_space) + return_code=STATE_CRITICAL; +- else if (check_warning_value==TRUE && percent_used_space >= warning_value) ++ else if (check_warning_value==TRUE && free_disk_space <= warning_used_space) + return_code=STATE_WARNING; + else + return_code=STATE_OK; +@@ -527,6 +529,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; +@@ -656,7 +660,11 @@ + printf (_("\ + USEDDISKSPACE = Size and percentage of disk use.\n\ + Request a -l parameter containing the drive letter only.\n\ +- Warning and critical thresholds can be specified with -w and -c.\n")); ++ Thresholds can be specified (in precentage used) with -w and -c.\n")); ++ printf (_("\ ++ FREEDISKSPACE = Size and percentage of disk use.\n\ ++ Request a -l parameter containing the drive letter only.\n\ ++ Thresholds can be specified (in megabytes free) with -w and -c.\n")); + printf (_("\ + MEMUSE = Memory use.\n\ + Warning and critical thresholds can be specified with -w and -c.\n")); -- cgit v1.2.3-74-g34f1