[packages/nagios-plugins] up to 2.0.3, security fixes

glen glen at pld-linux.org
Sun Apr 12 09:50:50 CEST 2015


commit 9f007f1c9bf54ef3ca192cd0ba1b5fc97a7a7582
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sun Apr 12 00:58:22 2015 +0300

    up to 2.0.3, security fixes

 mawk-workaround.patch | 168 ++++++++++++++++++++++++++++++++++++++++++++------
 nagios-plugins.spec   |   8 +--
 2 files changed, 153 insertions(+), 23 deletions(-)
---
diff --git a/nagios-plugins.spec b/nagios-plugins.spec
index 4b35e52..ee0f5d5 100644
--- a/nagios-plugins.spec
+++ b/nagios-plugins.spec
@@ -12,13 +12,13 @@
 Summary:	Host/service/network monitoring program plugins for Nagios
 Summary(pl.UTF-8):	Wtyczki do monitorowania hostów/usług/sieci dla Nagiosa
 Name:		nagios-plugins
-Version:	2.0.1
-Release:	2
+Version:	2.0.3
+Release:	1
 License:	GPL v3
 Group:		Networking
 Source0:	http://www.nagios-plugins.org/download/%{name}-%{version}.tar.gz
-# Source0-md5:	70daeb6d2d9ea7d41827488b80782a60
-# http://git.pld-linux.org/cgi-bin/cgit.cgi/projects/nagios-config.git/
+# Source0-md5:	6755765bab88b506181268ef7982595e
+# https://git.pld-linux.org/projects/nagios-config
 Source1:	%{name}-config-20140307.tar.bz2
 # Source1-md5:	de5c205501cb89c183193d4088d48222
 Source2:	nagios-utils.php
diff --git a/mawk-workaround.patch b/mawk-workaround.patch
index c71fd1e..12cbbab 100644
--- a/mawk-workaround.patch
+++ b/mawk-workaround.patch
@@ -6,37 +6,167 @@ mawk: run time error: regular expression compile failed (missing operand)
 /usr/lib/nullmailer' || -d '/usr/local/lib/nullmailer
         FILENAME="check_mailq.pl" FNR=627 NR=627
 
+however upstream removed autodetection (GRRR), revert that change
+https://nagios-plugins.org/nagios-plugins-2-0-3-released/
 
 this is resolved differently in monitoring-plugins:
 https://github.com/monitoring-plugins/monitoring-plugins/commit/c08d6a429ba0e0cd3642ba2c2fe85687472ee22f
 
---- nagios-plugins-2.0.1/plugins-scripts/check_mailq.pl~	2014-04-21 14:33:35.000000000 +0300
-+++ nagios-plugins-2.0.1/plugins-scripts/check_mailq.pl	2014-04-21 14:33:37.760719061 +0300
-@@ -610,17 +610,22 @@
- 		{
- 			$mailq = 'qmail';
+--- nagios-plugins-2.0.3/plugins-scripts/check_mailq.pl	2015-04-12 00:49:58.451674277 +0300
++++ nagios-plugins-2.0.1/plugins-scripts/check_mailq.pl	2015-04-12 00:49:01.892078238 +0300
+@@ -199,20 +199,20 @@
+ 	## now check the queue length(s)
+ 
+ 	if ($msg_q == 0) {
+-		$msg = "OK: mailq is empty";
++		$msg = "OK: $mailq mailq is empty";
+ 		$state = $ERRORS{'OK'};
+ 	} else {
+ 		print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose;
+ 	
+ 		# overall queue length
+ 		if ($msg_q < $opt_w) {
+-			$msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
++			$msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
+ 			$state = $ERRORS{'OK'};
+ 		}elsif ($msg_q >= $opt_w  && $msg_q < $opt_c) {
+-			$msg = "WARNING: mailq is $msg_q (threshold w = $opt_w)";
++			$msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
+ 			$state = $ERRORS{'WARNING'};
+ 		}else {
+-			$msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)";
++			$msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
+ 			$state = $ERRORS{'CRITICAL'};
  		}
--		elsif (-d '/var/lib/postfix' || -d '/var/local/lib/postfix'
--		       || -e '/usr/sbin/postfix' || -e '/usr/local/sbin/postfix')
+ 
+@@ -344,20 +344,20 @@
+ 
+         # check queue length(s)
+         if ($msg_q == 0){
+-                $msg = "OK: mailq reports queue is empty";
++                $msg = "OK: $mailq mailq reports queue is empty";
+                 $state = $ERRORS{'OK'};
+         } else {
+                 print "msg_q = $msg_q warn=$opt_w crit=$opt_c\n" if $verbose;
+ 
+                 # overall queue length
+                 if ($msg_q < $opt_w) {
+-                        $msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
++                        $msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
+                         $state = $ERRORS{'OK'};
+                 }elsif  ($msg_q >= $opt_w  && $msg_q < $opt_c) {
+-                        $msg = "WARNING: mailq is $msg_q (threshold w = $opt_w)";
++                        $msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
+                         $state = $ERRORS{'WARNING'};
+                 }else {
+-                        $msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)";
++                        $msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
+                         $state = $ERRORS{'CRITICAL'};
+                 }
+ 
+@@ -431,13 +431,13 @@
+ 		
+ 		# overall queue length
+ 		if ($msg_q < $opt_w) {
+-			$msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
++			$msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
+ 			$state = $ERRORS{'OK'};
+ 		}elsif ($msg_q >= $opt_w  && $msg_q < $opt_c) {
+-			$msg = "WARNING: mailq is $msg_q (threshold w = $opt_w)";
++			$msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
+ 			$state = $ERRORS{'WARNING'};
+ 		}else {
+-			$msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)";
++			$msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
+ 			$state = $ERRORS{'CRITICAL'};
+ 		}
+ 
+@@ -489,13 +489,13 @@
+ 		exit $ERRORS{CRITICAL};
+ 	}
+ 	if ($msg_q < $opt_w) {
+-		$msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
++		$msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
+ 		$state = $ERRORS{'OK'};
+ 	}elsif ($msg_q >= $opt_w  && $msg_q < $opt_c) {
+-		$msg = "WARNING: mailq is $msg_q (threshold w = $opt_w)";
++		$msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
+ 		$state = $ERRORS{'WARNING'};
+ 	}else {
+-		$msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)";
++		$msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
+ 		$state = $ERRORS{'CRITICAL'};
+ 	}
+ } # end of ($mailq eq "exim")
+@@ -526,13 +526,13 @@
+ 	}
+ 	close(MAILQ) ;
+ 	if ($msg_q < $opt_w) {
+-		$msg = "OK: mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
++		$msg = "OK: $mailq mailq ($msg_q) is below threshold ($opt_w/$opt_c)";
+ 		$state = $ERRORS{'OK'};
+ 	}elsif ($msg_q >= $opt_w  && $msg_q < $opt_c) {
+-		$msg = "WARNING: mailq is $msg_q (threshold w = $opt_w)";
++		$msg = "WARNING: $mailq mailq is $msg_q (threshold w = $opt_w)";
+ 		$state = $ERRORS{'WARNING'};
+ 	}else {
+-		$msg = "CRITICAL: mailq is $msg_q (threshold c = $opt_c)";
++		$msg = "CRITICAL: $mailq mailq is $msg_q (threshold c = $opt_c)";
+ 		$state = $ERRORS{'CRITICAL'};
+ 	}
+ } # end of ($mailq eq "nullmailer")
+@@ -605,7 +605,35 @@
+ 			exit $ERRORS{'UNKNOWN'};
+ 		}
+ 	}else{
+-		$mailq = 'sendmail' ;
++		if (defined $utils::PATH_TO_QMAIL_QSTAT
++		    && -x $utils::PATH_TO_QMAIL_QSTAT)
++		{
++			$mailq = 'qmail';
++		}
 +		elsif (-d '/var/lib/postfix'
 +			|| -d '/var/local/lib/postfix'
 +		       || -e '/usr/sbin/postfix'
 +			   || -e '/usr/local/sbin/postfix')
- 		{
- 			$mailq = 'postfix';
- 		}
--		elsif (-d '/usr/lib/exim4' || -d '/usr/local/lib/exim4'
--		       || -e '/usr/sbin/exim' || -e '/usr/local/sbin/exim')
++		{
++			$mailq = 'postfix';
++		}
 +		elsif (-d '/usr/lib/exim4'
 +			|| -d '/usr/local/lib/exim4'
 +		       || -e '/usr/sbin/exim'
 +			   || -e '/usr/local/sbin/exim')
- 		{
- 			$mailq = 'exim';
- 		}
--		elsif (-d '/usr/lib/nullmailer' || -d '/usr/local/lib/nullmailer'
++		{
++			$mailq = 'exim';
++		}
 +		elsif (-d '/usr/lib/nullmailer'
 +			|| -d '/usr/local/lib/nullmailer'
- 		       || -e '/usr/sbin/nullmailer-send'
- 		       || -e '/usr/local/sbin/nullmailer-send')
- 		{
++		       || -e '/usr/sbin/nullmailer-send'
++		       || -e '/usr/local/sbin/nullmailer-send')
++		{
++			$mailq = 'nullmailer';
++		}
++		else {
++			$mailq = 'sendmail';
++		}
+ 	}
+ 		
+ 	return $ERRORS{'OK'};
+@@ -628,7 +656,7 @@
+ 	print "-W (--Warning)   = Min. number of messages for same domain in queue to generate warning\n";
+ 	print "-C (--Critical)  = Min. number of messages for same domain in queue to generate critical alert ( W < C )\n";
+ 	print "-t (--timeout)   = Plugin timeout in seconds (default = $utils::TIMEOUT)\n";
+-	print "-M (--mailserver) = [ sendmail | qmail | postfix | exim | nullmailer ] (default = sendmail)\n";
++	print "-M (--mailserver) = [ sendmail | qmail | postfix | exim | nullmailer ] (default = autodetect)\n";
+ 	print "-h (--help)\n";
+ 	print "-V (--version)\n";
+ 	print "-v (--verbose)   = debugging output\n";
+@@ -636,6 +664,8 @@
+ 	print "Note: -w and -c are required arguments.  -W and -C are optional.\n";
+ 	print " -W and -C are applied to domains listed on the queues - both FROM and TO. (sendmail)\n";
+ 	print " -W and -C are applied message not yet preproccessed. (qmail)\n";
++	print " This plugin tries to autodetect which mailserver you are running,\n";
++	print " you can override the autodetection with -M.\n";
+ 	print " This plugin uses the system mailq command (sendmail) or qmail-stat (qmail)\n";
+ 	print " to look at the queues. Mailq can usually only be accessed by root or \n";
+ 	print " a TrustedUser. You will have to set appropriate permissions for the plugin to work.\n";
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nagios-plugins.git/commitdiff/9f007f1c9bf54ef3ca192cd0ba1b5fc97a7a7582



More information about the pld-cvs-commit mailing list