Browse Source

Merge branch 'master' into update-regex-for-test-and-output-of-check_icmp

Dylan Anderson 1 year ago
parent
commit
e5ee60f61e
3 changed files with 9 additions and 6 deletions
  1. 3 0
      NEWS
  2. 5 5
      plugins-scripts/check_mailq.pl
  3. 1 1
      plugins-scripts/t/check_file_age.t

+ 3 - 0
NEWS

@@ -1,4 +1,7 @@
 This file documents the major additions and syntax changes between releases.
+2.4.10 2024-04-30
+	FIXES
+	check_mailq: Add config directory option and update pattern matching for exim mailservers (#754)
 
 2.4.9 2024-03-21
 	FIXES

+ 5 - 5
plugins-scripts/check_mailq.pl

@@ -489,13 +489,13 @@ elsif ( $mailq eq "qmail" ) {
 elsif ( $mailq eq "exim" ) {
 	## open mailq 
 	if ( defined $utils::PATH_TO_MAILQ && -x $utils::PATH_TO_MAILQ ) {
-		if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ | " ) ) {
-			print "ERROR: could not open $utils::PATH_TO_MAILQ \n";
+		if (! open (MAILQ, "$sudo $utils::PATH_TO_MAILQ$mailq_args 2>&1 | " ) ) {
+			print "ERROR: could not open $utils::PATH_TO_MAILQ$mailq_args\n";
 			exit $ERRORS{'UNKNOWN'};
 		}
 	}elsif( defined $utils::PATH_TO_MAILQ){
 		unless (-x $utils::PATH_TO_MAILQ) {
-			print "ERROR: $utils::PATH_TO_MAILQ is not executable by (uid $>:gid($)))\n";
+			print "ERROR: $utils::PATH_TO_MAILQ$mailq_args is not executable by (uid $>:gid($)))\n";
 			exit $ERRORS{'UNKNOWN'};
 		}
 	} else {
@@ -507,14 +507,14 @@ elsif ( $mailq eq "exim" ) {
 	    #22m  1.7K 19aEEr-0007hx-Dy <> *** frozen ***
             #root@exlixams.glups.fr
 
-	    if (/\s[\w\d]{6}-[\w\d]{6}-[\w\d]{2}\s/) { # message id 19aEEr-0007hx-Dy
+	    if ( (/\s[\w\d]{6}-[\w\d]{6}-[\w\d]{2}\s/) || (/\s[\w\d]{6}-[\w\d]{11}-[\w\d]{4}\s/) ) { # message id 19aEEr-0007hx-Dy or 16VDhn-000000001bo-D342
 		$msg_q++ ;
 	    }
 	}
 	close(MAILQ) ;
 
 	if ( $? ) {
-		print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ",$/;
+		print "CRITICAL: Error code ".($?>>8)." returned from $utils::PATH_TO_MAILQ$mailq_args",$/;
 		exit $ERRORS{CRITICAL};
 	}
 	if ($msg_q < $opt_w) {

+ 1 - 1
plugins-scripts/t/check_file_age.t

@@ -12,7 +12,7 @@ my $successOutput = '/^FILE_AGE OK: /';
 my $warningOutput = '/^FILE_AGE WARNING: /';
 my $criticalOutput = '/^FILE_AGE CRITICAL: /';
 my $unknownOutput = '/^FILE_AGE UNKNOWN: /';
-my $performanceOutput = '/ \| age=[0-9]+s;[0-9]+;[0-9]+ size=[0-9]+B;[0-9]+;[0-9]+;0$/';
+my $performanceOutput = '/ \| age=[0-9]+s;[0-9]+;[0-9]+ size=[0-9]+B;[0-9]+;[0-9]+;0  $/';
 
 my $result;
 my $temp_file = "/tmp/check_file_age.tmp";