# HG changeset patch # User Matthias Förste # Date 1521471375 -3600 # Node ID 0a525189554dc0776968f85bb475051f899cb31a # Parent a0ce6426f63b7fda610c048e24867e727d3e5fd6 moved to git diff -r a0ce6426f63b -r 0a525189554d Makefile.in --- a/Makefile.in Wed Jan 20 10:55:43 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -SCRIPTS = check_mailq -CLEANFILES = ${SCRIPTS} Makefile -DESTDIR = -prefix = !prefix! - -plugindir = ${prefix}/lib/nagios/plugins/ius - -.PHONY: all clean install - -all: ${SCRIPTS} - -clean: - -rm -f ${CLEANFILES} - -install: all - install -d -m 0755 ${DESTDIR}/${plugindir} - install -m 0755 $(SCRIPTS) ${DESTDIR}/${plugindir}/ - -%: %.pl - @perl -c $< - @cp -f $< $@ - @chmod +x $@ - -%: %.sh - @cp -f $< $@ - @chmod +x $@ diff -r a0ce6426f63b -r 0a525189554d README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README Mon Mar 19 15:56:15 2018 +0100 @@ -0,0 +1,1 @@ +moved to git diff -r a0ce6426f63b -r 0a525189554d check_mailq.pl --- a/check_mailq.pl Wed Jan 20 10:55:43 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -#! /usr/bin/perl -w -# $Id$ -# $URL$ - -use strict; -use warnings; - -use File::Basename; -use Getopt::Long; -use POSIX qw(:sys_wait_h); -use lib "/usr/lib/nagios/plugins"; -use utils qw (%ERRORS &print_revision &support); - -sub print_help(); -sub print_usage(); - -my $ME = basename $0; -my ( $opt_w, $opt_c, $opt_s, $opt_V, $opt_h, $opt_b ); -my ( $result, $mailq ); - -$opt_s = "86400"; -$opt_w = "10"; -$opt_c = "20"; -$opt_b = "/usr/sbin/exipick"; - -Getopt::Long::Configure('bundling'); -GetOptions( - "V" => \$opt_V, - "version" => \$opt_V, - "h" => \$opt_h, - "help" => \$opt_h, - "b=s" => \$opt_b, - "binary" => \$opt_b, - "s=i" => \$opt_s, - "seconds" => \$opt_s, - "w=i" => \$opt_w, - "warning=i" => \$opt_w, - "c=i" => \$opt_c, - "critical=i" => \$opt_c -); - -if ($opt_V) { - print_revision( $ME, "1.1" ); - exit $ERRORS{"OK"}; -} - -if ($opt_h) { - print_help(); - exit $ERRORS{"OK"}; -} - -if ( $opt_w > $opt_c ) { - print - "MAILQ CRITICAL: Warning (-w) cannot be greater than Critical (-c)!\n"; - exit $ERRORS{"CRITICAL"}; -} - -# check exipick binary -unless ( -x $opt_b ) { - print "MAILQ CRITICAL: exipick not found or not executable - $opt_b\n"; - exit $ERRORS{"CRITICAL"}; -} - -$SIG{CHLD} = sub { - while (waitpid(-1, WNOHANG) > 0) {}; -}; - -# check the mailq -die "Can't fork: $!" unless defined (my $pid = open(F, "-|")); -if ($pid) { - =~ /^(\d+).*/; - $mailq = $1; - close F; -} else { - exec $opt_b, '-o', $opt_s, '-c', @ARGV - or die "can't exec $opt_b: $!"; -} - -SWITCH: { - $mailq < $opt_w and $result = "OK", last; - $mailq >= $opt_c and $result = "CRITICAL", last; - $mailq >= $opt_w and $result = "WARNING", last; -} - -print -"MAILQ $result: ($mailq) queued mails older than $opt_s sec.|unsent=$mailq;$opt_w;$opt_c;0;0\n"; -exit $ERRORS{$result}; - -sub print_usage() { - print "Usage:\n"; - print " $ME [-b ] [-s ] [-w ] [-c ] [ [ ... ]]\n"; - print " $ME [-h | --help]\n"; - print " $ME [-V | --version]\n"; -} - -sub print_help() { - print_revision( $ME, "1.1" ); - print "Copyright (c) 2008 Christian Arnold\n"; - print "Copyright (c) 2015 Matthias Förste\n\n"; - print "This plugin checks the number of messages, which are longer than\n"; - print "an specified time holding in the mail queue.\n\n"; - print_usage(); - print "\n"; - print " -b, --binary \n"; - print " Path of exipick binary (default: /usr/sbin/exipick)\n"; - print " -s, --seconds \n"; - print " Age of messages in seconds in the mail queue (default: 86400) one day\n"; - print " -w, --warning \n"; - print " Min. number of messages in the mail queue to generate warning alert (default: 10)\n"; - print " -c, --critical \n"; - print " Min. number of messages in the mail queue to generate critical alert (default: 20)\n"; - print "\n"; - print "Note: This plugin only works with exim4.\n\n"; - support(); -} diff -r a0ce6426f63b -r 0a525189554d configure --- a/configure Wed Jan 20 10:55:43 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -#! /bin/sh - -prefix=/usr/local - -tmp=`getopt -n $0 -o p: -l prefix: -- "$@"` -eval set -- $tmp - -while true; do - o="$1"; shift - case "$o" in - -p|--prefix) prefix="$1"; shift;; - --) break;; - esac -done - -perl -pe "s{!prefix!}{$prefix}g" < Makefile.in > Makefile diff -r a0ce6426f63b -r 0a525189554d debian/changelog --- a/debian/changelog Wed Jan 20 10:55:43 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -nagios-plugin-mailq (1.2) stable oldstable oldoldstable; urgency=medium - - * fixed dependencies - - -- Matthias Förste Wed, 20 Jan 2016 10:15:44 +0100 - -nagios-plugin-mailq (1.1) stable oldstable oldoldstable; urgency=medium - - * allow more criterions to be passed to exipick - * several cleanups - - -- Matthias Förste Thu, 17 Dec 2015 16:05:03 +0100 - -nagios-plugin-mailq (1.0-1) stable; urgency=low - - * Initial release - - -- Christian Arnold Wed, 11 Jun 2008 10:35:32 +0200 - diff -r a0ce6426f63b -r 0a525189554d debian/compat --- a/debian/compat Wed Jan 20 10:55:43 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -5 diff -r a0ce6426f63b -r 0a525189554d debian/control --- a/debian/control Wed Jan 20 10:55:43 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -Source: nagios-plugin-mailq -Section: admin -Priority: extra -Maintainer: Matthias Förste -Build-Depends: debhelper (>= 7), autotools-dev, monitoring-plugins-common -Standards-Version: 3.9.6 - -Package: nagios-plugin-mailq -Architecture: all -Depends: ${misc:Depends}, ${perl:Depends}, monitoring-plugins-common | nagios-plugins-basic, exim4-base -Description: nagios plugin to check mail queue - This plugin checks the number of messages, which are longer than - an specified time holding in the mail queue. diff -r a0ce6426f63b -r 0a525189554d debian/copyright --- a/debian/copyright Wed Jan 20 10:55:43 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -This package was debianized by Christian Arnold on -Wed, 11 Jun 2008 10:35:32 +0200. - -It was downloaded from: - https://ssl.schlittermann.de/hg/ius/nagios/nagios-plugin-mailq/ - -Upstream Authors: - Christian Arnold - Matthias Förste - -Copyright: - Copyright (C) 2008-2013 Christian Arnold - Copyright (C) 2015 Matthias Förste - -License: - - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this package; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -On Debian systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL'. - -The Debian packaging is: - (C) 2008, Christian Arnold - (C) 2015, Matthias Förste - -and is licensed under the GPL, see above. diff -r a0ce6426f63b -r 0a525189554d debian/dirs --- a/debian/dirs Wed Jan 20 10:55:43 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ -usr/bin -usr/sbin diff -r a0ce6426f63b -r 0a525189554d debian/docs diff -r a0ce6426f63b -r 0a525189554d debian/rules --- a/debian/rules Wed Jan 20 10:55:43 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -%: - dh $@ diff -r a0ce6426f63b -r 0a525189554d debian/source/format --- a/debian/source/format Wed Jan 20 10:55:43 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +0,0 @@ -3.0 (native)