[Pkg-nagios-changes] [pkg-nagios] r2096 - in nagios-plugins/trunk/debian: . patches
Jan Wagner
waja at alioth.debian.org
Thu Jul 11 12:45:52 UTC 2013
Author: waja
Date: 2013-07-11 12:45:52 +0000 (Thu, 11 Jul 2013)
New Revision: 2096
Added:
nagios-plugins/trunk/debian/patches/12_check_smtp_double_threshold.dpatch
Modified:
nagios-plugins/trunk/debian/changelog
nagios-plugins/trunk/debian/patches/00list
Log:
check_smtp: double threshold
Modified: nagios-plugins/trunk/debian/changelog
===================================================================
--- nagios-plugins/trunk/debian/changelog 2013-07-11 11:36:37 UTC (rev 2095)
+++ nagios-plugins/trunk/debian/changelog 2013-07-11 12:45:52 UTC (rev 2096)
@@ -1,6 +1,8 @@
nagios-plugins (1.4.16-3) UNRELEASED; urgency=low
* Fixed check_squid* command definitions
+ * Add double threshold to check_smtp (LP: #318703)
+ - 12_check_smtp_double_threshold.dpatch
-- Jan Wagner <waja at cyconet.org> Wed, 10 Jul 2013 15:16:26 +0200
Modified: nagios-plugins/trunk/debian/patches/00list
===================================================================
--- nagios-plugins/trunk/debian/patches/00list 2013-07-11 11:36:37 UTC (rev 2095)
+++ nagios-plugins/trunk/debian/patches/00list 2013-07-11 12:45:52 UTC (rev 2096)
@@ -1,6 +1,7 @@
02_check_icmp_links.dpatch
05_fix_gets_undefined_in_iso_c11.dpatch
+# commited upstream
10_check_apt_perfdata.dpatch
11_check_nt_npe.dpatch
-# commited upstream
+12_check_smtp_double_threshold.dpatch
Added: nagios-plugins/trunk/debian/patches/12_check_smtp_double_threshold.dpatch
===================================================================
--- nagios-plugins/trunk/debian/patches/12_check_smtp_double_threshold.dpatch (rev 0)
+++ nagios-plugins/trunk/debian/patches/12_check_smtp_double_threshold.dpatch 2013-07-11 12:45:52 UTC (rev 2096)
@@ -0,0 +1,73 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 12_check_smtp_double_threshold.dpatch by Roman Fiedler
+##
+## From 9839a1b9945400bb4a00a1dd9858d1c98267b284 Mon Sep 17 00:00:00 2001
+## From: Jan Wagner <waja at cyconet.org>
+## Date: Thu, 11 Jul 2013 14:11:09 +0200
+## Subject: [PATCH] Fixed SF.net bug 2555775, threshold can be double for
+## check_smtp
+##
+## DP: Adds threshold in double to check_smtp
+
+ at DPATCH@
+diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
+index 79fa482..d477a51 100644
+--- a/plugins/check_smtp.c
++++ b/plugins/check_smtp.c
+@@ -99,9 +99,9 @@ enum {
+ char *authtype = NULL;
+ char *authuser = NULL;
+ char *authpass = NULL;
+-int warning_time = 0;
++double warning_time = 0;
+ int check_warning_time = FALSE;
+-int critical_time = 0;
++double critical_time = 0;
+ int check_critical_time = FALSE;
+ int verbose = 0;
+ int use_ssl = FALSE;
+@@ -417,9 +417,9 @@ enum {
+ elapsed_time = (double)microsec / 1.0e6;
+
+ if (result == STATE_OK) {
+- if (check_critical_time && elapsed_time > (double) critical_time)
++ if (check_critical_time && elapsed_time > critical_time)
+ result = STATE_CRITICAL;
+- else if (check_warning_time && elapsed_time > (double) warning_time)
++ else if (check_warning_time && elapsed_time > warning_time)
+ result = STATE_WARNING;
+ }
+
+@@ -552,21 +552,19 @@ enum {
+ nresponses++;
+ break;
+ case 'c': /* critical time threshold */
+- if (is_intnonneg (optarg)) {
+- critical_time = atoi (optarg);
+- check_critical_time = TRUE;
+- }
++ if (!is_nonnegative (optarg))
++ usage4 (_("Critical time must be a positive"));
+ else {
+- usage4 (_("Critical time must be a positive integer"));
++ critical_time = strtod (optarg, NULL);
++ check_critical_time = TRUE;
+ }
+ break;
+ case 'w': /* warning time threshold */
+- if (is_intnonneg (optarg)) {
+- warning_time = atoi (optarg);
+- check_warning_time = TRUE;
+- }
++ if (!is_nonnegative (optarg))
++ usage4 (_("Warning time must be a positive"));
+ else {
+- usage4 (_("Warning time must be a positive integer"));
++ warning_time = strtod (optarg, NULL);
++ check_warning_time = TRUE;
+ }
+ break;
+ case 'v': /* verbose */
+--
+1.8.1.6
+
More information about the Pkg-nagios-changes
mailing list