[Pkg-nagios-changes] [pkg-nagios-plugins] 335/413: check_smtp: double threshold

Jan Wagner waja at moszumanska.debian.org
Tue Nov 26 23:13:39 UTC 2013


This is an automated email from the git hooks/post-receive script.

waja pushed a commit to branch master
in repository pkg-nagios-plugins.

commit 2d7c36b1c66e6af37206ec73d3c308bd4da02b94
Author: Jan Wagner <waja at cyconet.org>
Date:   Thu Jul 11 12:45:52 2013 +0000

    check_smtp: double threshold
---
 debian/changelog                                   |  2 +
 debian/patches/00list                              |  3 +-
 .../patches/12_check_smtp_double_threshold.dpatch  | 73 ++++++++++++++++++++++
 3 files changed, 77 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 5702ab2..5520d52 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
 
diff --git a/debian/patches/00list b/debian/patches/00list
index 1c221a1..90845a7 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -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
 
diff --git a/debian/patches/12_check_smtp_double_threshold.dpatch b/debian/patches/12_check_smtp_double_threshold.dpatch
new file mode 100644
index 0000000..1379d2a
--- /dev/null
+++ b/debian/patches/12_check_smtp_double_threshold.dpatch
@@ -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
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-nagios-plugins.git



More information about the Pkg-nagios-changes mailing list