From 1e2387474a449452b78520b9ad96a8b4b5e99722 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Wed, 17 Apr 2019 19:07:19 +0200 Subject: initial commit of source fetch --- .../check_ajp/return_critical_on_failed_connection | 79 +++++++++ .../patches/check_backuppc/use_nagios_plugins | 34 ++++ .../debian/patches/check_bgpstate/epn | 10 ++ .../debian/patches/check_clamav/clamav_locations | 73 ++++++++ .../debian/patches/check_cups/ParseDateDelta | 11 ++ .../debian/patches/check_cups/epn | 8 + .../debian/patches/check_cups/monitoring-plugin | 46 +++++ .../patches/check_drbd/fix_for_oos_and_cosmetic | 62 +++++++ .../debian/patches/check_email_delivery/epn | 45 +++++ .../debian/patches/check_email_delivery/paths | 27 +++ .../debian/patches/check_haproxy/epn | 8 + .../debian/patches/check_haproxy/monitoring-plugin | 48 ++++++ .../debian/patches/check_haproxy_stats/interpreter | 16 ++ .../debian/patches/check_httpd_status/epn | 9 + .../patches/check_httpd_status/htdigest_auth | 17 ++ .../patches/check_httpd_status/monitoring-plugin | 49 ++++++ .../patches/check_imap_quota/syntax_error_fix | 17 ++ .../debian/patches/check_libs/config_path | 11 ++ .../debian/patches/check_libs/lsof-speedup | 27 +++ .../debian/patches/check_libs/space_before_deleted | 12 ++ .../debian/patches/check_libvirt/fix_uom | 26 +++ .../debian/patches/check_libvirt/monitoring-plugin | 48 ++++++ .../debian/patches/check_lm_sensors/interpreter | 8 + .../patches/check_lm_sensors/manpage_whatis_fix | 12 ++ .../patches/check_lm_sensors/spelling_errors | 11 ++ .../debian/patches/check_memory/monitoring-plugin | 43 +++++ .../debian/patches/check_memory/new_free | 53 ++++++ .../debian/patches/check_nfsmounts/nfs4_support | 11 ++ .../patches/check_nfsmounts/nfs_write_location | 20 +++ .../debian/patches/check_nfsmounts/perl_module | 43 +++++ .../debian/patches/check_printer/debian_bts | 17 ++ .../debian/patches/check_printer/epn | 8 + .../check_printer/use_data_dumper_if_needed | 18 ++ .../debian/patches/check_printer/use_nagios_plugin | 38 +++++ .../debian/patches/check_raid/no_epn | 8 + .../prefer_cciss_vol_status_over_hpacucli | 15 ++ .../debian/patches/check_rbl/additional_rbls | 45 +++++ .../debian/patches/check_rbl/interpreter | 8 + .../patches/check_smstools/monitoring-plugin | 46 +++++ .../debian/patches/check_smstools/operator_siglvl | 30 ++++ .../debian/patches/check_snmp_environment/epn | 10 ++ .../debian/patches/check_snmp_time/epn | 8 + .../debian/patches/check_uptime/missing_backslash | 16 ++ .../debian/patches/check_v46/no_epn | 9 + .../debian/patches/check_varnish/fix_for_v56 | 186 +++++++++++++++++++++ .../debian/patches/check_webinject/epn | 9 + .../dsa/check_cert_expire_dir_check_name_fix | 14 ++ .../debian/patches/dsa/check_packages-inifile | 13 ++ .../debian/patches/dsa/check_packages_,_fix | 30 ++++ .../debian/patches/dsa/check_packages_location | 11 ++ .../dsa/check_running_kernel_jessie_centos_fix | 42 +++++ .../debian/patches/dsa/epn | 8 + .../debian/patches/dsa/status_directory | 22 +++ .../patches/percona-nagios-plugins/fix_bashism | 8 + .../debian/patches/series | 54 ++++++ 55 files changed, 1557 insertions(+) create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_ajp/return_critical_on_failed_connection create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_backuppc/use_nagios_plugins create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_bgpstate/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_clamav/clamav_locations create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/ParseDateDelta create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/monitoring-plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_drbd/fix_for_oos_and_cosmetic create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_email_delivery/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_email_delivery/paths create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy/monitoring-plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy_stats/interpreter create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/htdigest_auth create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_imap_quota/syntax_error_fix create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/config_path create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/lsof-speedup create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/space_before_deleted create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libvirt/fix_uom create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libvirt/monitoring-plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/interpreter create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/manpage_whatis_fix create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/spelling_errors create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_memory/monitoring-plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_memory/new_free create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/nfs4_support create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/nfs_write_location create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/perl_module create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/debian_bts create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/use_data_dumper_if_needed create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/use_nagios_plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_raid/no_epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_raid/prefer_cciss_vol_status_over_hpacucli create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_rbl/additional_rbls create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_rbl/interpreter create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_smstools/monitoring-plugin create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_smstools/operator_siglvl create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_snmp_environment/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_snmp_time/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_uptime/missing_backslash create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_v46/no_epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_varnish/fix_for_v56 create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_webinject/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_cert_expire_dir_check_name_fix create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages-inifile create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages_,_fix create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages_location create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_running_kernel_jessie_centos_fix create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/epn create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/status_directory create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/percona-nagios-plugins/fix_bashism create mode 100644 nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/series (limited to 'nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches') diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_ajp/return_critical_on_failed_connection b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_ajp/return_critical_on_failed_connection new file mode 100644 index 0000000..80f18f4 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_ajp/return_critical_on_failed_connection @@ -0,0 +1,79 @@ +--- a/check_ajp/check_ajp ++++ b/check_ajp/check_ajp +@@ -7,6 +7,7 @@ + # + # check_ajp - nagios plugin for jboss monitoring + # Copyright (C) 2010 Michel Rode ++# Copyright (C) 2013 Bernd Zeimetz + # + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +@@ -30,6 +31,8 @@ use strict; + use Getopt::Long; + use Socket; + use Time::HiRes 'time'; ++use IO::Socket; ++ + + my $app = ''; + my $port = '8009'; +@@ -37,9 +40,14 @@ my $warntime = '1.5'; + my $crittime = '3'; + my $timeout = '10'; + +-my ($iaddr, $paddr, $proto, $sock, $time1, $time2); ++my ($sock, $time1, $time2); + my $pong = 'null'; + ++sub conndie{ ++ my $msg = shift; ++ print "CRITICAL : $msg\n"; ++ exit 2; ++} + sub xdie{ + my $msg = shift; + printf STDERR "Usage: check_ajp --app ip.of.the.app [--port 8009 --warn 1 --crit 2 --timeout 5]\n\n"; +@@ -49,6 +57,10 @@ sub xdie{ + + GetOptions("app=s" => \$app, "port=s" => \$port, "warn=f" => \$warntime, "crit=f" => \$crittime, "timeout=f" => \$timeout); + ++if ($app eq '') { ++ xdie('--app not given') ++} ++ + my $ping = pack 'C5' # Format template. + , 0x12, 0x34 # Magic number for server->container packets. + , 0x00, 0x01 # 2 byte int length of payload. +@@ -61,24 +73,23 @@ my $expected = pack 'C5' # Format tem + , 0x09 # Type of packet. 9 = CPong reply. + ; + +-$iaddr = inet_aton($app) || xdie("No host given !"); +-$paddr = sockaddr_in($port, $iaddr) || xdie("Wrong port !"); +-$proto = getprotobyname 'tcp'; +- + $time1 = time(); + + eval { + local $SIG{ALRM} = sub { die "alarm\n" }; + alarm($timeout); +- socket $sock, PF_INET, SOCK_STREAM, $proto || xdie("socket !"); +- connect $sock, $paddr || xdie("connect !"); +- syswrite $sock, $ping || xdie("syswrite !"); +- sysread $sock, $pong, 5 || xdie("sysread !"); ++ $sock = IO::Socket::INET->new(Proto => "tcp", ++ PeerAddr => $app, ++ PeerPort => $port) || conndie($@); ++ $sock->autoflush(1); ++ print $sock $ping; ++ $sock->recv($pong,5); ++ close $sock; + alarm(0); + }; + + if ($@) { +- die unless $@ eq "alarm\n"; ++ conndie($@) unless $@ eq "alarm\n"; + $time2 = (time() - $time1); + printf "CRITICAL - AJP - Timeout after %1.0fs\n",$time2; + exit 2; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_backuppc/use_nagios_plugins b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_backuppc/use_nagios_plugins new file mode 100644 index 0000000..15bcf2a --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_backuppc/use_nagios_plugins @@ -0,0 +1,34 @@ +diff --git a/check_backuppc/check_backuppc-1.1.0/check_backuppc b/check_backuppc/check_backuppc-1.1.0/check_backuppc +index d8ea383..c994c20 100755 +--- a/check_backuppc/check_backuppc-1.1.0/check_backuppc ++++ b/check_backuppc/check_backuppc-1.1.0/check_backuppc +@@ -32,7 +32,28 @@ no utf8; + + # Nagios + use lib "NAGIOS_LIB"; +-use utils qw(%ERRORS $TIMEOUT); ++sub load_module { ++ my @names = @_; ++ my $module; ++ for my $name (@names) { ++ my $file = $name; ++ # requires need either a bare word or a file name ++ $file =~ s{::}{/}gsxm; ++ $file .= '.pm'; ++ eval { ++ require $file; ++ $name->import(qw(%ERRORS)); ++ $module = $name; ++ }; ++ last if $module; ++ } ++ return $module; ++} ++ ++my $plugin_module; ++BEGIN { ++ $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' ); ++} + use POSIX qw(strftime difftime); + use Getopt::Long; + Getopt::Long::Configure('bundling'); diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_bgpstate/epn b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_bgpstate/epn new file mode 100644 index 0000000..3ef7667 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_bgpstate/epn @@ -0,0 +1,10 @@ +diff --git a/check_bgpstate/check_bgpstate b/check_bgpstate/check_bgpstate +index 645d750..6ddf8bf 100644 +--- a/check_bgpstate/check_bgpstate ++++ b/check_bgpstate/check_bgpstate +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + # + # check_bgpstate.pl - nagios plugin + # diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_clamav/clamav_locations b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_clamav/clamav_locations new file mode 100644 index 0000000..c857987 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_clamav/clamav_locations @@ -0,0 +1,73 @@ +--- a/check_clamav/check_clamav ++++ b/check_clamav/check_clamav +@@ -16,18 +16,18 @@ + # + ################################################################################ + # This script is used to compare the version and signature level of the +-# currently running clamd daemon with the latest available versions listed in ++# currently running clamscan daemon with the latest available versions listed in + # the TXT record for current.cvd.clamav.net. + # + # In order to use this script, you might need to make the following adjustments: + # - Set the "use lib" path correctly (where utils.pm is located.) +-# - Set the path to your clamd binary in $clamd_cmd. ++# - Set the path to your clamscan binary in $clamscan_cmd. + # + # This plugin requires the Net::DNS Perl module. + ################################################################################ + + # Plugin directory / home of utils.pm. +-use lib "/usr/local/libexec/nagios"; ++use lib "/usr/lib/nagios/plugins"; + use utils qw(%ERRORS &print_revision &support &usage); + use Getopt::Long qw(:config no_ignore_case bundling); + use File::Basename; +@@ -35,8 +35,8 @@ use Net::DNS; + + use strict; + +-# Path to installed clamd binary. +-my $clamd_cmd = "/usr/local/sbin/clamd"; ++# Path to installed clamscan binary. ++my $clamscan_cmd = "/usr/bin/clamscan"; + + # Leave the rest of this alone: + my $prog_name = basename $0; +@@ -153,28 +153,28 @@ if ($vers_val != 0) { + } + + # Make sure the binary exists. +-if (-x $clamd_cmd) { +- &print_debug("Found clamd at $clamd_cmd"); ++if (-x $clamscan_cmd) { ++ &print_debug("Found clamscan at $clamscan_cmd"); + } else { +- &print_debug("Can't execute clamd at $clamd_cmd"); +- die("FATAL: Unable to execute $clamd_cmd"); ++ &print_debug("Can't execute clamscan at $clamscan_cmd"); ++ die("FATAL: Unable to execute $clamscan_cmd"); + } + + &print_debug("Threshhold values: warning=$warn_val, critical=$crit_val"); + + # Should return something like: ClamAV 0.87.1/1205/Wed Dec 7 07:00:48 2005 +-chomp(my $clamd_ver = `$clamd_cmd -V`); ++chomp(my $clamscan_ver = `$clamscan_cmd -V`); + + # Should return something like: 0.87.1:34:1206:1134072033:1 + chomp(my $dnstxt_ver = &lookup_current()); + +-# Parse what we get from clamd -V and our DNS query +-my @clamdresults = split(/\//,$clamd_ver); ++# Parse what we get from clamscan -V and our DNS query ++my @clamscanresults = split(/\//,$clamscan_ver); + my @txtresults = split(/:/,$dnstxt_ver); + + # Get the currently running ClamAV sig level and cvd date out of this +-my $local_latest_daily = $clamdresults[1]; +-my $local_latest_date = $clamdresults[2]; ++my $local_latest_daily = $clamscanresults[1]; ++my $local_latest_date = $clamscanresults[2]; + + &print_debug("Local daily.cvd dated $local_latest_date"); + &print_debug("Local daily.cvd version = $local_latest_daily"); diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/ParseDateDelta b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/ParseDateDelta new file mode 100644 index 0000000..2383896 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/ParseDateDelta @@ -0,0 +1,11 @@ +--- a/check_cups/check_cups ++++ b/check_cups/check_cups +@@ -395,7 +395,7 @@ + + my( $age, $jobs ) = ( $warning{$queue}->{age}, $warning{$queue}->{jobs} ); + +- my( $prettyage ) = prettyDelta( parseDateDelta( "$age minutes" ) ); ++ my( $prettyage ) = prettyDelta( ParseDateDelta( "$age minutes" ) ); + + my( @messages ); + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/epn b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/epn new file mode 100644 index 0000000..cd836f4 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/epn @@ -0,0 +1,8 @@ +--- a/check_cups/check_cups ++++ b/check_cups/check_cups +@@ -1,4 +1,5 @@ + #!/usr/bin/perl ++# nagios: -epn + + =head1 NAME + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/monitoring-plugin b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/monitoring-plugin new file mode 100644 index 0000000..ec3439e --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_cups/monitoring-plugin @@ -0,0 +1,46 @@ +--- a/check_cups/check_cups ++++ b/check_cups/check_cups +@@ -39,13 +39,33 @@ + # http://search.cpan.org/~rgarcia/perl-5.6.2/pod/perllexwarn.pod + no warnings qw( redefine prototype ); + ++sub load_module { ++ my @names = @_; ++ my $module; ++ for my $name (@names) { ++ my $file = $name; ++ # requires need either a bare word or a file name ++ $file =~ s{::}{/}gsxm; ++ $file .= '.pm'; ++ eval { ++ require $file; ++ $name->import(); ++ $module = $name; ++ }; ++ last if $module; ++ } ++ return $module; ++} ++ ++my $plugin_module; ++ + BEGIN { + + # use Opsview libs + use lib '/usr/local/nagios/perl/lib'; + use lib '/usr/local/nagios/lib'; + +- use Nagios::Plugin; ++ $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' ); + + use Data::Dumper; + +@@ -95,7 +115,7 @@ + This plugin was written at The Harvard-MIT Data Center + (http://www.hmdc.harvard.edu) by Steve Huff (). + LICENSE +-my( $plugin ) = Nagios::Plugin->new( ++my( $plugin ) = $plugin_module->new( + shortname => 'check_cups', + usage => $usagemsg, + version => '0.2', diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_drbd/fix_for_oos_and_cosmetic b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_drbd/fix_for_oos_and_cosmetic new file mode 100644 index 0000000..317555b --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_drbd/fix_for_oos_and_cosmetic @@ -0,0 +1,62 @@ +commit b04bdeb025c77e34fdf8ed9eab2f222240297ca3 +Author: Stanislav German-Evtushenko +Date: Mon Mar 3 08:11:31 2014 +0300 + + check_drbd: add check for oos and cosmetic + + 1) add check for out of sync sectors (report WARNING for non-zero value) + 2) cosmetic: sort device list while processing + +--- a/check_drbd/check_drbd ++++ b/check_drbd/check_drbd +@@ -12,7 +12,7 @@ use Getopt::Long; + my $drbd_proc='/proc/drbd'; + my $drbd_devices=0; + my ($drbd_expect, $drbd_role, $drbd_version, $debug_mode); +-my (%options, %cs, %st, %ld, %ds, %check, %warning, %critical); ++my (%options, %cs, %st, %ld, %ds, %oos, %check, %warning, %critical); + + my $prog_name=basename($0); + my $prog_revision='0.5.3'; +@@ -210,10 +210,17 @@ sub parse_proc { + } else { + $input = "STDIN"; + } ++ my $devnum; + while(<$input>) { + if (/^version: (\d+).(\d+)/) { + $drbd_version = "$1.$2"; + } ++ if (/^\s?(\d+):.*/) { ++ $devnum = $1; ++ } ++ if (defined($devnum) and /\soos:(\d+)/) { ++ $oos{$devnum} = $1; ++ } + if (/^\s?(\d+):.* cs:(\w+)/) { + $cs{$1} = $2; + } +@@ -248,11 +255,11 @@ sub parse_drbd_devices { + # + my @devices; + if ($drbd_devices =~ /^all$/i) { +- for my $device ( keys %cs ) { ++ for my $device ( sort keys %cs ) { + push(@devices,$device); + } + } elsif ($drbd_devices =~ /^configured$/i) { +- for my $device ( keys %cs ) { ++ for my $device ( sort keys %cs ) { + next if ($cs{$device} eq "Unconfigured"); + push(@devices,$device); + } +@@ -264,6 +271,9 @@ sub parse_drbd_devices { + &myexit('UNKNOWN',"Could not find device $device"); + } + $check{$device} = 1; ++ if (defined($oos{$device}) and $oos{$device} > 0) { ++ &myexit('WARNING',"Out of sync on device $device: $oos{$device} sectors"); ++ } + } + if (int(keys %check) == 0) { + &myexit('UNKNOWN',"No configured devices found"); diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_email_delivery/epn b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_email_delivery/epn new file mode 100644 index 0000000..02d5424 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_email_delivery/epn @@ -0,0 +1,45 @@ +--- a/check_email_delivery/src/check_email_delivery ++++ b/check_email_delivery/src/check_email_delivery +@@ -1,4 +1,6 @@ + #!/usr/bin/perl ++# nagios: -epn ++ + use strict; + my $VERSION = '0.7.1'; + my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +--- a/check_email_delivery/src/check_imap_quota ++++ b/check_email_delivery/src/check_imap_quota +@@ -1,4 +1,6 @@ + #!/usr/bin/perl ++# nagios: -epn ++ + use strict; + my $VERSION = '0.2'; + my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +--- a/check_email_delivery/src/check_imap_receive ++++ b/check_email_delivery/src/check_imap_receive +@@ -1,4 +1,6 @@ + #!/usr/bin/perl ++# nagios: -epn ++ + use strict; + my $VERSION = '0.7.5'; + my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; +--- a/check_email_delivery/src/check_smtp_send ++++ b/check_email_delivery/src/check_smtp_send +@@ -1,4 +1,6 @@ + #!/usr/bin/perl ++# nagios: -epn ++ + use strict; + use POSIX qw(strftime); + my $VERSION = '0.7.3'; +--- a/check_email_delivery/src/imap_ssl_cert ++++ b/check_email_delivery/src/imap_ssl_cert +@@ -1,4 +1,6 @@ + #!/usr/bin/perl ++# nagios: -epn ++ + use strict; + my $VERSION = '0.1'; + my $COPYRIGHT = 'Copyright (C) 2005-2011 Jonathan Buhacoff '; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_email_delivery/paths b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_email_delivery/paths new file mode 100644 index 0000000..e4c8fc6 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_email_delivery/paths @@ -0,0 +1,27 @@ +Author: Tom Jampen +Description: + Patches check_email_delivery and check_email_delivery_epn to use debian + specific paths. + +--- a/check_email_delivery/src/check_email_delivery ++++ b/check_email_delivery/src/check_email_delivery +@@ -63,7 +63,7 @@ my $default_warn = 15; + my $default_wait = 5; + my $default_timeout = 60; + my $time_hires = ""; +-my $libexec = "/usr/local/nagios/libexec"; ++my $libexec = "/usr/lib/nagios/plugins"; + my $ok; + $ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, +--- a/check_email_delivery/src/check_email_delivery_epn ++++ b/check_email_delivery/src/check_email_delivery_epn +@@ -61,7 +61,7 @@ my $default_warn = 15; + my $default_wait = 5; + my $default_timeout = 60; + my $time_hires = ""; +-my $libexec = "/usr/local/nagios/libexec"; ++my $libexec = "/usr/lib/nagios/plugins"; + my $ok; + $ok = Getopt::Long::GetOptions( + "V|version"=>\$show_version, diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy/epn b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy/epn new file mode 100644 index 0000000..1514373 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy/epn @@ -0,0 +1,8 @@ +--- a/check_haproxy/check_haproxy ++++ b/check_haproxy/check_haproxy +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + # + # Copyright (c) 2010 Stéphane Urbanovski + # diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy/monitoring-plugin b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy/monitoring-plugin new file mode 100644 index 0000000..8e47f4a --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy/monitoring-plugin @@ -0,0 +1,48 @@ +--- a/check_haproxy/check_haproxy ++++ b/check_haproxy/check_haproxy +@@ -31,7 +31,28 @@ + use Time::HiRes qw(time); # get microtime + use POSIX qw(mktime); + +-use Nagios::Plugin ; ++sub load_module { ++ my @names = @_; ++ my $module; ++ for my $name (@names) { ++ my $file = $name; ++ # requires need either a bare word or a file name ++ $file =~ s{::}{/}gsxm; ++ $file .= '.pm'; ++ eval { ++ require $file; ++ $name->import(); ++ $module = $name; ++ }; ++ last if $module; ++ } ++ return $module; ++} ++ ++my $plugin_module; ++BEGIN { ++ $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' ); ++} + + use LWP::UserAgent; # http client + use HTTP::Request; # used by LWP::UserAgent +@@ -53,7 +74,7 @@ + textdomain('nagios-plugins-perl'); + + +-my $np = Nagios::Plugin->new( ++my $np = $plugin_module->new( + version => $VERSION, + blurb => _gt('Plugin to check HAProxy stats url'), + usage => "Usage: %s [ -v|--verbose ] -u [-t ] [-U ] [-P ] [ -c|--critical= ] [ -w|--warning= ]", +@@ -319,4 +340,4 @@ + + Stéphane Urbanovski + +-=cut +\ No newline at end of file ++=cut diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy_stats/interpreter b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy_stats/interpreter new file mode 100644 index 0000000..8c533ec --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_haproxy_stats/interpreter @@ -0,0 +1,16 @@ +commit 7ecba59a47bf3a9276d4bb6ef3976ebc2d809e4d +Author: Jan Wagner +Date: Tue Jan 29 16:14:46 2019 +0100 + + Fixing interpreter + +diff --git a/check_haproxy_stats/check_haproxy_stats.pl b/check_haproxy_stats/check_haproxy_stats.pl +index 9698f78..f776bf6 100644 +--- a/check_haproxy_stats/check_haproxy_stats.pl ++++ b/check_haproxy_stats/check_haproxy_stats.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/env perl ++#/usr/bin/perl + # vim: se et ts=4: + + # diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/epn b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/epn new file mode 100644 index 0000000..661a495 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/epn @@ -0,0 +1,9 @@ +--- a/check_httpd_status/check_httpd_status ++++ b/check_httpd_status/check_httpd_status +@@ -1,4 +1,6 @@ + #!/usr/bin/perl -w ++# nagios: -epn ++# + ####################### check_httpd_status.pl ####################### + # Version : 1.3 + # Date : 06 Aug 2010 diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/htdigest_auth b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/htdigest_auth new file mode 100644 index 0000000..336b542 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/htdigest_auth @@ -0,0 +1,17 @@ +--- a/check_httpd_status/check_httpd_status ++++ b/check_httpd_status/check_httpd_status +@@ -213,7 +213,13 @@ + logD("Web URL : $url"); + + my $req = HTTP::Request->new( GET => $url ); +-if ( defined($o_user) ) { ++if ( defined($o_realm) ) { ++ if ( ! defined($o_port) ) { ++ $o_port = 80; ++ } ++ $ua->credentials("$o_host:$o_port", $o_realm, $o_user, $o_pass); ++} ++elsif ( defined($o_user) ) { + $req->authorization_basic($o_user, $o_pass); + } + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin new file mode 100644 index 0000000..dd8451a --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_httpd_status/monitoring-plugin @@ -0,0 +1,49 @@ +--- a/check_httpd_status/check_httpd_status ++++ b/check_httpd_status/check_httpd_status +@@ -34,8 +34,28 @@ + use POSIX qw(setlocale); + use Locale::gettext; + +-use Nagios::Plugin ; +- ++sub load_module { ++ my @names = @_; ++ my $module; ++ for my $name (@names) { ++ my $file = $name; ++ # requires need either a bare word or a file name ++ $file =~ s{::}{/}gsxm; ++ $file .= '.pm'; ++ eval { ++ require $file; ++ $name->import(); ++ $module = $name; ++ }; ++ last if $module; ++ } ++ return $module; ++} ++ ++my $plugin_module; ++BEGIN { ++ $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' ); ++} + use LWP::UserAgent; + use HTTP::Status; # get status_message() + use Time::HiRes qw(gettimeofday tv_interval); +@@ -92,7 +112,7 @@ + ); + + +-my $np = Nagios::Plugin->new( ++my $np = $plugin_module->new( + version => $VERSION, + blurb => _gt('Apache / Lighthttpd server status monitor for Nagios'), + usage => "Usage: %s [ -H [-p ] [-t ] [-w -c ] [-V] [-u ] [-U user -P pass -r realm]", +@@ -438,4 +458,4 @@ + Warn if less than 100 workers are available + Crit if less than 10 workers are available + EOT +-} +\ No newline at end of file ++} diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_imap_quota/syntax_error_fix b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_imap_quota/syntax_error_fix new file mode 100644 index 0000000..1c4d9b6 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_imap_quota/syntax_error_fix @@ -0,0 +1,17 @@ +commit efd3fb018c2b6d9aacc367ab29dc4b0089ba10a5 +Author: Paul Voss +Date: Fri Mar 14 10:43:30 2014 +0100 + + - fixed syntax error by added missing closing bracket as mentioned in issue #44 + +--- a/check_email_delivery/src/check_imap_quota ++++ b/check_email_delivery/src/check_imap_quota +@@ -153,7 +153,7 @@ eval { + } + if (!length($quotaUsed) && !length($quotaLimit)) { + print "no answer from imap host\n" if $verbose > 2; +- } elsif (!length($quotaUsed) || !length($quotaLimit) { ++ } elsif (!length($quotaUsed) || !length($quotaLimit)) { + print "incorrect answer from imap host\n"; + $imap->close(); + exit $status{UNKNOWN}; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/config_path b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/config_path new file mode 100644 index 0000000..330d637 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/config_path @@ -0,0 +1,11 @@ +--- a/check_libs/nagios-check-libs ++++ b/check_libs/nagios-check-libs +@@ -71,7 +71,7 @@ if ($params->{'version'}) { + }; + + if (! defined $params->{'config'}) { +- $params->{'config'} = '/etc/nagios/check-libs.conf'; ++ $params->{'config'} = '/etc/nagios-plugins/check-libs.conf'; + } elsif (! -e $params->{'config'}) { + dief("Config file $params->{'config'} does not exist.\n"); + } diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/lsof-speedup b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/lsof-speedup new file mode 100644 index 0000000..925aed4 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/lsof-speedup @@ -0,0 +1,27 @@ +--- a/check_libs/nagios-check-libs ++++ b/check_libs/nagios-check-libs +@@ -29,7 +29,7 @@ use Getopt::Long; + $ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/sbin'; + delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'}; + +-my $LSOF = '/usr/bin/lsof -F0'; ++my $LSOF = '/usr/bin/lsof -nPF0 -a +L1'; + my $VERSION = '0.2015012901'; + + # nagios exit codes +@@ -141,12 +141,12 @@ sub inVserver() { + + my $INVSERVER = inVserver(); + +-print STDERR "Running $LSOF -n\n" if $params->{'verbose'}; +-open (LSOF, "$LSOF -n|") or dief ("Cannot run $LSOF -n: $!\n"); ++print STDERR "Running $LSOF\n" if $params->{'verbose'}; ++open (LSOF, "$LSOF|") or dief ("Cannot run $LSOF: $!\n"); + my @lsof=; + close LSOF; + if ($CHILD_ERROR) { # program failed +- dief("$LSOF -n returned with non-zero exit code: ".($CHILD_ERROR / 256)."\n"); ++ dief("$LSOF returned with non-zero exit code: ".($CHILD_ERROR / 256)."\n"); + }; + + my ($process, $pid, $user); diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/space_before_deleted b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/space_before_deleted new file mode 100644 index 0000000..0840d48 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libs/space_before_deleted @@ -0,0 +1,12 @@ +diff -Nur a/check_libs/nagios-check-libs b/check_libs/nagios-check-libs +--- a/check_libs/nagios-check-libs ++++ b/check_libs/nagios-check-libs +@@ -170,7 +170,7 @@ + my $inode = $fields{i}; + my $path = $fields{n}; + if ($path =~ m/\.dpkg-/ || $path =~ m/\(deleted\)/ || $path =~ /path inode=/ || $path =~ m#/\.nfs# || $fd eq 'DEL') { +- $path =~ s/^\(deleted\)//; # in some cases "(deleted)" is at the beginning of the string ++ $path =~ s/^ ?\(deleted\)//; # in some cases "(deleted)" is at the beginning of the string + for my $i (@{$config->{'ignorelist'}}) { + my $ignore = eval($i); + next LINE if $ignore; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libvirt/fix_uom b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libvirt/fix_uom new file mode 100644 index 0000000..c192353 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libvirt/fix_uom @@ -0,0 +1,26 @@ +From ebbf45f0dcbe150f4f8ccb306c8e72e95dbe29d9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20L=C3=A4ssig?= +Date: Thu, 1 Dec 2016 13:42:17 +0100 +Subject: [PATCH] fix uom of check_libvirt + + * the actual unit of check_libvirt is 'units', which is not a valid UOM + (https://www.monitoring-plugins.org/doc/guidelines.html#AEN201) + so tools like icinga2 cannot interprete the performance data + * remove the UOM to an empty string + -> no unit specified - assume a number (int or float) of things + (eg, users, processes, load averages) +--- + check_libvirt/check_libvirt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/check_libvirt/check_libvirt ++++ b/check_libvirt/check_libvirt +@@ -246,7 +246,7 @@ + chop($output); + chop($output); + $output = $up . "/" . $cnt . " VMs up: " . $output; +- $np->add_perfdata(label => "vmcount", value => $up, uom => 'units', threshold => $np->threshold); ++ $np->add_perfdata(label => "vmcount", value => $up, uom => '', threshold => $np->threshold); + $result = $np->check_threshold(check => $up); + } + elsif (uc($command) eq "POOL") diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libvirt/monitoring-plugin b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libvirt/monitoring-plugin new file mode 100644 index 0000000..c51c873 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_libvirt/monitoring-plugin @@ -0,0 +1,48 @@ +diff --git a/check_libvirt/check_libvirt b/check_libvirt/check_libvirt +index 2029c9e..618d1ac 100755 +--- a/check_libvirt/check_libvirt ++++ b/check_libvirt/check_libvirt +@@ -27,11 +27,33 @@ + use strict; + use warnings; + use vars qw($PROGNAME $VERSION $output $result); +-use Nagios::Plugin; + use File::Basename; + use Sys::Virt; + use XML::Simple; + ++sub load_module { ++ my @names = @_; ++ my $module; ++ for my $name (@names) { ++ my $file = $name; ++ # requires need either a bare word or a file name ++ $file =~ s{::}{/}gsxm; ++ $file .= '.pm'; ++ eval { ++ require $file; ++ $name->import(); ++ $module = $name; ++ }; ++ last if $module; ++ } ++ return $module; ++} ++ ++my $plugin_module; ++BEGIN { ++ $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' ); ++} ++ + $PROGNAME = basename($0); + $VERSION = '0.1.0'; + my $spooldir="/opt/monitor/var/check_libvirt"; +@@ -41,7 +63,7 @@ if (!-d $spooldir) + mkdir($spooldir); + } + +-my $np = Nagios::Plugin->new( ++my $np = $plugin_module->new( + usage => "Usage: %s -H [ -N ]\n" + . " [-u -p ]\n" + . " -l [ -s ]\n" diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/interpreter b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/interpreter new file mode 100644 index 0000000..e46ed48 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/interpreter @@ -0,0 +1,8 @@ +--- a/check_lm_sensors/src/check_lm_sensors ++++ b/check_lm_sensors/src/check_lm_sensors +@@ -1,4 +1,4 @@ +-#!perl ++#!/usr/bin/perl + + # check_lm_sensors is a Nagios plugin to monitor the values of on board sensors and hard + # disk temperatures on Linux systems diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/manpage_whatis_fix b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/manpage_whatis_fix new file mode 100644 index 0000000..53290de --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/manpage_whatis_fix @@ -0,0 +1,12 @@ +--- a/check_lm_sensors/src/check_lm_sensors.pod ++++ b/check_lm_sensors/src/check_lm_sensors.pod +@@ -2,8 +2,7 @@ + + =head1 NAME + +-C is a Nagios plugin to monitor the values of on +-board sensors and hard disk temperatures on Linux systems ++C - Nagios plugin to monitor hardware sensors and disk temperatures + + =head1 DESCRIPTION + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/spelling_errors b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/spelling_errors new file mode 100644 index 0000000..b684280 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_lm_sensors/spelling_errors @@ -0,0 +1,11 @@ +--- a/check_lm_sensors/src/check_lm_sensors.pod ++++ b/check_lm_sensors/src/check_lm_sensors.pod +@@ -49,7 +49,7 @@ verbosity. + =head1 EXIT STATUS + + 0 if OK, 1 in case of a warning, 2 in case of a critical status and 3 +-in case of an unkown problem ++in case of an unknown problem + + =head1 DEPENDENCIES + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_memory/monitoring-plugin b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_memory/monitoring-plugin new file mode 100644 index 0000000..8303246 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_memory/monitoring-plugin @@ -0,0 +1,43 @@ +diff --git a/check_memory/check_memory b/check_memory/check_memory +index bf46711..4f272d1 100644 +--- a/check_memory/check_memory ++++ b/check_memory/check_memory +@@ -23,14 +23,36 @@ + use strict; + use warnings; + use vars qw($PROGNAME $VERSION $FREECMD $UNIT); +-use Nagios::Plugin; ++ ++sub load_module { ++ my @names = @_; ++ my $module; ++ for my $name (@names) { ++ my $file = $name; ++ # requires need either a bare word or a file name ++ $file =~ s{::}{/}gsxm; ++ $file .= '.pm'; ++ eval { ++ require $file; ++ $name->import(); ++ $module = $name; ++ }; ++ last if $module; ++ } ++ return $module; ++} ++ ++my $plugin_module; ++BEGIN { ++ $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' ); ++} + + $PROGNAME = "check_memory"; + $VERSION = '1.0.1'; + $FREECMD = '/usr/bin/free'; + $UNIT = 'M'; + +-my $np = Nagios::Plugin->new( ++my $np = $plugin_module->new( + usage => "Usage: %s [ -w ] [ -c ]\n" + . ' [ -u ]', + version => $VERSION, diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_memory/new_free b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_memory/new_free new file mode 100644 index 0000000..86f4335 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_memory/new_free @@ -0,0 +1,53 @@ +From df189de31d33f40b894c33482dbdf9f61eaf1177 Mon Sep 17 00:00:00 2001 +From: Simon Ruderich +Date: Tue, 26 Jul 2016 18:50:38 +0200 +Subject: [PATCH] Fixing for new free output. + +The output of free doesn't anymore contain the "buffers/cache" +line breaking the check_memory plugin. The attached patch uses +instead the new "available" column to calculate the free memory +as it seems to be a better estimation of free (usable) memory. +--- + check_memory/check_memory | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/check_memory/check_memory b/check_memory/check_memory +index 8369a9e..70d0514 100755 +--- a/check_memory/check_memory ++++ b/check_memory/check_memory +@@ -104,12 +104,23 @@ open(RESULT, "$FREECMD -b |") + or $np->nagios_exit('CRITICAL', "Could not run $FREECMD"); + + warn("Output from $FREECMD:\n") if ($verbose > 1); +-my ($used, $free); ++my $new_format = 0; ++my ($total, $used, $free); + while () { + warn(" $_") if ($verbose > 1); +- next unless (m#^\-/\+\ buffers/cache:\s*(\d+)\s+(\d+)#); +- $used = $1; +- $free = $2; ++ # New `free` output from procps doesn't provide "buffers/cache" anymore, but ++ # provides a better estimate of available memory ("available" column). ++ $new_format = 1 if m{^\s+total\s+used\s+free\s+shared\s+buff/cache\s+available$}; ++ ++ if ($new_format and /^Mem:\s+(\d+)\s+\d+\s+\d+\s+\d+\s+\d+\s+(\d+)$/) { ++ $total = $1; ++ $free = $2; # available column ++ $used = $total - $free; # used is everything which is not available ++ } elsif (m#^\-/\+\ buffers/cache:\s*(\d+)\s+(\d+)#) { ++ $used = $1; ++ $free = $2; ++ $total = $used + $free; ++ } + } + + close(RESULT); +@@ -117,7 +128,6 @@ alarm(0); + + $np->nagios_exit('CRITICAL', "Unable to interpret $FREECMD output") if (!defined($free)); + +-my $total = $used + $free; + if (defined($warning) && $warning =~ /^\d+%$/) { + if ($warning) { + $warning =~ s/%//; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/nfs4_support b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/nfs4_support new file mode 100644 index 0000000..482541f --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/nfs4_support @@ -0,0 +1,11 @@ +--- a/check_nfsmounts/check_nfsmounts ++++ b/check_nfsmounts/check_nfsmounts +@@ -101,7 +101,7 @@ + my @dirs=(); + my %mountmodes=(); + while(my $line=) { +- if($line =~ /^[^ ]+ [^ ]+ nfs /) { ++ if($line =~ /^[^ ]+ [^ ]+ nfs4? /) { + my @fields=split(/\s+/,$line); + my $mountpoint=$fields[1]; + push(@dirs,$mountpoint); diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/nfs_write_location b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/nfs_write_location new file mode 100644 index 0000000..feb3e23 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/nfs_write_location @@ -0,0 +1,20 @@ +--- a/check_nfsmounts/check_nfsmounts ++++ b/check_nfsmounts/check_nfsmounts +@@ -45,6 +45,7 @@ + } + + use Time::HiRes qw{time alarm}; ++use Sys::Hostname; + use Getopt::Long; + use strict; + +@@ -129,7 +130,8 @@ + if($pid==0) { + chdir $dir or &bad_mount($dir,$!); + if($writemode and exists($mountmodes{$dir}->{"rw"})) { +- open X,"> $dir/.nfscheck" or exit $?; ++ my $check_filename="$dir/.nfscheck_" . hostname; ++ open X,"> $check_filename" or exit $?; + print X $ENV{HOSTNAME}."\n".localtime()."\n"; # XXX Full disk may fail.. + close X or exit $?; + } diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/perl_module b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/perl_module new file mode 100644 index 0000000..86c8c81 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_nfsmounts/perl_module @@ -0,0 +1,43 @@ +diff --git a/check_nfsmounts/check_nfsmounts b/check_nfsmounts/check_nfsmounts +index fbfb1f8..51ed625 100644 +--- a/check_nfsmounts/check_nfsmounts ++++ b/check_nfsmounts/check_nfsmounts +@@ -21,14 +21,36 @@ + # along with this program. If not, see . + # + +-use utils qw{$TIMEOUT %ERRORS}; ++sub load_module { ++ my @names = @_; ++ my $module; ++ for my $name (@names) { ++ my $file = $name; ++ # requires need either a bare word or a file name ++ $file =~ s{::}{/}gsxm; ++ $file .= '.pm'; ++ eval { ++ require $file; ++ $name->import(qw(%ERRORS)); ++ $module = $name; ++ }; ++ last if $module; ++ } ++ return $module; ++} ++ ++my $plugin_module; ++BEGIN { ++ $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' ); ++} ++ + use Time::HiRes qw{time alarm}; + use Getopt::Long; + use strict; + + my $version="1.0"; + +-my $nfs_timeout=$TIMEOUT; ++my $nfs_timeout=15; + my $nfs_warn=-1; + my $writemode=0; + my $help=0; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/debian_bts b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/debian_bts new file mode 100644 index 0000000..73ff81a --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/debian_bts @@ -0,0 +1,17 @@ +--- a/check_printer/check_printer ++++ b/check_printer/check_printer +@@ -267,10 +267,10 @@ + if ($debug){ + print Dumper(\%status); + print "\n\n############ ATTENTION ############\n"; +- print "You have debug enabled. If asked to enable debug by the developer,\n"; +- print "please send all of the output, including your command line to\n"; +- print "ecrist\@secure-computing.net with the subject line 'check_printer DEBUG' along\n"; +- print "with a description of the problem you're experiencing.\n###################################\n"; ++ print "You have debug enabled. If asked to enable debug by the Debian Maintainer,\n"; ++ print "please send all of the output to the Debian Bug Tracking System, either by \n"; ++ print "replying to an existing bug or by opening a new bug.\n"; ++ + print '$Id: check_printer 363 2014-07-23 14:37:59Z ecrist $'."\n\n"; + } + if ($is_crit){ diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/epn b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/epn new file mode 100644 index 0000000..ea584db --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/epn @@ -0,0 +1,8 @@ +--- a/check_printer/check_printer ++++ b/check_printer/check_printer +@@ -1,4 +1,5 @@ + #!/usr/bin/perl ++# nagios: -epn + # + # Copyright (c) 2007,2011 Eric F Crist + # diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/use_data_dumper_if_needed b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/use_data_dumper_if_needed new file mode 100644 index 0000000..977338e --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/use_data_dumper_if_needed @@ -0,0 +1,18 @@ +--- a/check_printer/check_printer ++++ b/check_printer/check_printer +@@ -40,7 +40,6 @@ if ($OS =~ m/^\wBSD/){ + use lib "/usr/local/nagios/libexec"; + } + +-use Data::Dumper; + use Getopt::Long; + use Pod::Usage; + +@@ -109,6 +108,7 @@ foreach(@vars){ + } + + if ($debug){ ++ use Data::Dumper; + print Dumper(\@values); + } + my %finvalues; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/use_nagios_plugin b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/use_nagios_plugin new file mode 100644 index 0000000..36e7880 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_printer/use_nagios_plugin @@ -0,0 +1,38 @@ +diff --git a/check_printer/check_printer b/check_printer/check_printer +index 6d801de..da8e099 100644 +--- a/check_printer/check_printer ++++ b/check_printer/check_printer +@@ -33,11 +33,27 @@ + use strict; + use warnings; + +-my $OS = `uname`; +-if ($OS =~ m/^\wBSD/){ +- use lib "/usr/local/libexec/nagios"; +-} elsif ($OS =~ m/Linux/){ +- use lib "/usr/local/nagios/libexec"; ++sub load_module { ++ my @names = @_; ++ my $module; ++ for my $name (@names) { ++ my $file = $name; ++ # requires need either a bare word or a file name ++ $file =~ s{::}{/}gsxm; ++ $file .= '.pm'; ++ eval { ++ require $file; ++ $name->import(qw(%ERRORS)); ++ $module = $name; ++ }; ++ last if $module; ++ } ++ return $module; ++} ++ ++my $plugin_module; ++BEGIN { ++ $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' ); + } + + use Getopt::Long; + use Pod::Usage; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_raid/no_epn b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_raid/no_epn new file mode 100644 index 0000000..9ce8a44 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_raid/no_epn @@ -0,0 +1,8 @@ +--- a/check_raid/check_raid ++++ b/check_raid/check_raid +@@ -1,4 +1,5 @@ + #!/usr/bin/perl ++# nagios: -epn + + # This chunk of stuff was generated by App::FatPacker. To find the original + # file's code, look for the end of this BEGIN block or the string 'FATPACK' diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_raid/prefer_cciss_vol_status_over_hpacucli b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_raid/prefer_cciss_vol_status_over_hpacucli new file mode 100644 index 0000000..c8def56 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_raid/prefer_cciss_vol_status_over_hpacucli @@ -0,0 +1,15 @@ +--- a/check_raid/check_raid ++++ b/check_raid/check_raid +@@ -3975,8 +3975,10 @@ sub check { + package hpacucli; + use base 'plugin'; + +-# register +-push(@utils::plugins, __PACKAGE__); ++# register if cciss_vol_status is not available ++if (! utils::which('cciss_vol_status')) { ++ push(@utils::plugins, __PACKAGE__); ++} + + sub program_names { + __PACKAGE__; diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_rbl/additional_rbls b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_rbl/additional_rbls new file mode 100644 index 0000000..a804e84 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_rbl/additional_rbls @@ -0,0 +1,45 @@ +--- a/check_rbl/src/check_rbl.ini ++++ b/check_rbl/src/check_rbl.ini +@@ -95,6 +95,42 @@ + server=spam.dnsbl.anonmails.de + server=spambot.bls.digibase.ca + server=z.mailspike.net ++server=dul.dnsbl.borderware.com ++server=uribl.swinog.ch ++server=dnsbl.inps.de ++server=tor.dan.me.uk ++server=torexit.dan.me.uk ++server=combined.rbl.msrbl.net ++server=rbl.efnetrbl.org ++server=virbl.dnsbl.bit.nl ++server=relays.mail-abuse.org ++server=dev.null.dk ++server=blackholes.mail-abuse.org ++server=dialups.mail-abuse.org ++server=dul.orca.bc.ca ++server=blackholes.five-ten-sg.com ++server=rbl-plus.mail-abuse.org ++server=rbl.jp ++server=virus.rbl.jp ++server=dialup.blacklist.jippg.org ++server=blackholes.intersil.net ++server=assholes.madscience.nl ++server=blackholes.sandes.dk ++server=blocked.hilli.dk ++server=cart00ney.surriel.com ++server=dnsbl.antispam.or.id ++server=dsbl.dnsbl.net.au ++server=duinv.aupads.org ++server=rsbl.aupads.org ++server=intruders.docs.uu.se ++server=map.spam-rbl.com ++server=orvedb.aupads.org ++server=proxy.bl.gweep.ca ++server=pss.spambusters.org.ar ++server=rdts.dnsbl.net.au ++server=relays.bl.gweep.ca ++server=relays.bl.kundenserver.de ++server=spam.olsentech.net + + ; these are rather slow + ;server=bl.csma.biz diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_rbl/interpreter b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_rbl/interpreter new file mode 100644 index 0000000..f67e230 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_rbl/interpreter @@ -0,0 +1,8 @@ +--- a/check_rbl/src/check_rbl ++++ b/check_rbl/src/check_rbl +@@ -1,4 +1,4 @@ +-#!perl ++#!/usr/bin/perl + + # nagios: -epn + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_smstools/monitoring-plugin b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_smstools/monitoring-plugin new file mode 100644 index 0000000..1715f96 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_smstools/monitoring-plugin @@ -0,0 +1,46 @@ +diff --git a/check_smstools/bin/check_smstools b/check_smstools/bin/check_smstools +index a7a0336..707d289 100755 +--- a/check_smstools/bin/check_smstools ++++ b/check_smstools/bin/check_smstools +@@ -13,9 +13,31 @@ + + use strict; + use warnings; +-use Nagios::Plugin; + use POSIX; + ++sub load_module { ++ my @names = @_; ++ my $module; ++ for my $name (@names) { ++ my $file = $name; ++ # requires need either a bare word or a file name ++ $file =~ s{::}{/}gsxm; ++ $file .= '.pm'; ++ eval { ++ require $file; ++ $name->import(); ++ $module = $name; ++ }; ++ last if $module; ++ } ++ return $module; ++} ++ ++my $plugin_module; ++BEGIN { ++ $plugin_module = load_module( 'Monitoring::Plugin', 'Nagios::Plugin' ); ++} ++ + # Define regular expressions used to find the correct lines from + # the status file + my $signal_command = 'AT\+CSQ'; +@@ -45,7 +67,7 @@ my $timestamp; + my $np; + + sub init_plugin { +- $np = Nagios::Plugin->new(usage => "usage: %s"); ++ $np = $plugin_module->new(usage => "usage: %s"); + + $np->add_arg( + spec => 'warning|w=f', diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_smstools/operator_siglvl b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_smstools/operator_siglvl new file mode 100644 index 0000000..7c18cbd --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_smstools/operator_siglvl @@ -0,0 +1,30 @@ +From 75a6f801a18961b1abd169046a105813da6c3424 Mon Sep 17 00:00:00 2001 +From: ZyanKLee +Date: Thu, 28 Apr 2016 12:51:42 +0200 +Subject: [PATCH] operator string, siglvl + +operator string has a " at the end, too - removing it +siglvl at our modem is 31.99 - but still works +--- + check_smstools/bin/check_smstools | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/check_smstools/bin/check_smstools ++++ b/check_smstools/bin/check_smstools +@@ -191,6 +191,7 @@ + if ($result{'cmd'} =~ /$operator_command/) { + $operator = $result{'answer'}; + $operator =~ s/0,0,"//g; ++ $operator =~ s/"$//g; + } + } + # No need to parse the rest of the file, if signal +@@ -218,7 +219,7 @@ + $np->nagios_die("Unable to determine the modem signal strength."); + } + +- if (($siglvl < 0) or ($siglvl > 31)) { ++ if (($siglvl < 0) or ($siglvl > 32)) { + $np->nagios_die("Unable to determine the modem signal strength."); + } + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_snmp_environment/epn b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_snmp_environment/epn new file mode 100644 index 0000000..9273c79 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_snmp_environment/epn @@ -0,0 +1,10 @@ +diff --git a/check_snmp_environment/check_snmp_environment.pl b/check_snmp_environment/check_snmp_environment.pl +index 2be3fc0..6022fcb 100644 +--- a/check_snmp_environment/check_snmp_environment.pl ++++ b/check_snmp_environment/check_snmp_environment.pl +@@ -1,4 +1,5 @@ + #!/usr/bin/perl ++# nagios: -epn + # ============================================================================ + # ============================== INFO ======================================== + # ============================================================================ diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_snmp_time/epn b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_snmp_time/epn new file mode 100644 index 0000000..f78de4c --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_snmp_time/epn @@ -0,0 +1,8 @@ +--- a/check_snmp_time/check_snmp_time ++++ b/check_snmp_time/check_snmp_time +@@ -1,4 +1,5 @@ + #!/usr/bin/perl -w ++# nagios: -epn + ############################## check_snmp_time.pl ################# + my $Version='1.1'; + # Date : Dec 08 2010 diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_uptime/missing_backslash b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_uptime/missing_backslash new file mode 100644 index 0000000..e49d276 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_uptime/missing_backslash @@ -0,0 +1,16 @@ +diff --git a/check_uptime/check_uptime b/check_uptime/check_uptime +index e1e5b99..41b7f26 100644 +--- a/check_uptime/check_uptime ++++ b/check_uptime/check_uptime +@@ -540,7 +540,7 @@ if ($check_type==1) { # local + elsif ($uptime_output =~ /up\s+(\d+)\s+min/) { + ($days, $hrs, $mins) = (0,0,$1); + } +- elsif ($uptime_output =~ /up\s+(\d+)s+days?,s+(\d+)s+min/) { ++ elsif ($uptime_output =~ /up\s+(\d+)\s+days?,\s+(\d+)\s+min/) { + ($days, $hrs, $mins) = ($1,0,$2); + } + else { +diff --git a/dsa/checks/dsa-check-cert-expire-dir b/dsa/checks/dsa-check-cert-expire-dir +old mode 100755 +new mode 100644 diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_v46/no_epn b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_v46/no_epn new file mode 100644 index 0000000..cd0084f --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_v46/no_epn @@ -0,0 +1,9 @@ +--- a/check_v46/check_v46 ++++ b/check_v46/check_v46 +@@ -1,4 +1,6 @@ + #!/usr/bin/perl ++# nagios: -epn ++# + # + # check_v46 + # Nagios plugin wrapper for running the actual plugin for both / either of diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_varnish/fix_for_v56 b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_varnish/fix_for_v56 new file mode 100644 index 0000000..91c93fb --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_varnish/fix_for_v56 @@ -0,0 +1,186 @@ +From d53252d965aaa1889a8b56a681c464c6ca04f632 Mon Sep 17 00:00:00 2001 +From: Jean-Louis Dupond +Date: Sat, 23 Dec 2017 13:06:01 +0100 +Subject: [PATCH] Switch to new functions for Varnish 5.2 + +--- + check_varnish.c | 54 +++++++++++++++++++++++++++++++++++++++++-------- + configure.ac | 18 ++++++++++------- + 2 files changed, 57 insertions(+), 15 deletions(-) + +diff --git a/check_varnish/src/check_varnish.c b/check_varnish/src/check_varnish.c +index 809657c..83aacdc 100644 +--- a/check_varnish/src/check_varnish.c ++++ b/check_varnish/src/check_varnish.c +@@ -43,7 +43,7 @@ + #include + #include + +-#if defined(HAVE_VARNISHAPI_4) || defined(HAVE_VARNISHAPI_4_1) ++#if defined(HAVE_VARNISHAPI_4) || defined(HAVE_VARNISHAPI_4_1) || defined(HAVE_VARNISHAPI_5) + #include + #include + #elif defined(HAVE_VARNISHAPI_3) +@@ -185,7 +185,11 @@ check_stats_cb(void *priv, const struct VSC_point * const pt) + if (pt == NULL) + return(0); + +-#if defined(HAVE_VARNISHAPI_4_1) || defined(HAVE_VARNISHAPI_4) ++#if defined(HAVE_VARNISHAPI_5) ++ assert(sizeof(tmp) > (strlen(pt->name) + 1)); ++ snprintf(tmp, sizeof(tmp), "%s", pt->name); ++ p = priv; ++#elif defined(HAVE_VARNISHAPI_4_1) || defined(HAVE_VARNISHAPI_4) + assert(sizeof(tmp) > (strlen(pt->section->fantom->type) + 1 + + strlen(pt->section->fantom->ident) + 1 + + strlen(pt->desc->name) + 1)); +@@ -197,7 +201,9 @@ check_stats_cb(void *priv, const struct VSC_point * const pt) + pt->desc->name); + p = priv; + #endif +-#if defined(HAVE_VARNISHAPI_4_1) ++#if defined(HAVE_VARNISHAPI_5) ++ assert(!strcmp(pt->ctype, "uint64_t")); ++#elif defined(HAVE_VARNISHAPI_4_1) + assert(!strcmp(pt->desc->ctype, "uint64_t")); + #elif defined(HAVE_VARNISHAPI_4) + assert(!strcmp(pt->desc->fmt, "uint64_t")); +@@ -216,7 +222,9 @@ check_stats_cb(void *priv, const struct VSC_point * const pt) + #endif + if (strcmp(tmp, p->param) == 0) { + p->found = 1; +-#if defined(HAVE_VARNISHAPI_4) || defined(HAVE_VARNISHAPI_4_1) ++#if defined(HAVE_VARNISHAPI_5) ++ p->info = pt->sdesc; ++#elif defined(HAVE_VARNISHAPI_4) || defined(HAVE_VARNISHAPI_4_1) + p->info = pt->desc->sdesc; + #elif defined(HAVE_VARNISHAPI_3) + p->info = pt->desc; +@@ -237,7 +245,11 @@ check_stats_cb(void *priv, const struct VSC_point * const pt) + * Check the statistics for the requested parameter. + */ + static void ++#if defined(HAVE_VARNISHAPI_5) ++check_stats(struct vsc *vsc, struct vsm *vsm, char *param) ++#else + check_stats(struct VSM_data *vd, char *param) ++#endif + { + int status; + struct stat_priv priv; +@@ -245,7 +257,9 @@ check_stats(struct VSM_data *vd, char *param) + priv.found = 0; + priv.param = param; + +-#if defined(HAVE_VARNISHAPI_4) || defined(HAVE_VARNISHAPI_4_1) ++#if defined(HAVE_VARNISHAPI_5) ++ (void)VSC_Iter(vsc, vsm, check_stats_cb, &priv); ++#elif defined(HAVE_VARNISHAPI_4) || defined(HAVE_VARNISHAPI_4_1) + (void)VSC_Iter(vd, NULL, check_stats_cb, &priv); + #elif defined(HAVE_VARNISHAPI_3) + (void)VSC_Iter(vd, check_stats_cb, &priv); +@@ -315,18 +329,25 @@ usage(void) + int + main(int argc, char **argv) + { ++#if defined(HAVE_VARNISHAPI_5) ++ struct vsm *vd; ++ struct vsc *vsc; ++#else + struct VSM_data *vd; ++#endif + char *param = NULL; + int opt; + + setlocale(LC_ALL, ""); + + vd = VSM_New(); +-#if defined(HAVE_VARNISHAPI_3) ++#if defined(HAVE_VARNISHAPI_5) ++ vsc = VSC_New(); ++#elif defined(HAVE_VARNISHAPI_3) + VSC_Setup(vd); + #endif + +- while ((opt = getopt(argc, argv, VSC_ARGS "c:hn:p:vw:")) != -1) { ++ while ((opt = getopt(argc, argv, "c:hn:p:vw:")) != -1) { + switch (opt) { + case 'c': + if (parse_range(optarg, &critical) != 0) +@@ -336,7 +357,11 @@ main(int argc, char **argv) + help(); + break; + case 'n': ++#if defined(HAVE_VARNISHAPI_5) ++ VSC_Arg(vsc, opt, optarg); ++#else + VSC_Arg(vd, opt, optarg); ++#endif + break; + case 'p': + param = strdup(optarg); +@@ -349,13 +374,22 @@ main(int argc, char **argv) + usage(); + break; + default: ++#if defined(HAVE_VARNISHAPI_5) ++ if (VSC_Arg(vsc, opt, optarg) > 0) ++#else + if (VSC_Arg(vd, opt, optarg) > 0) ++#endif + break; + usage(); + } + } + +-#if defined(HAVE_VARNISHAPI_4) || defined(HAVE_VARNISHAPI_4_1) ++#if defined(HAVE_VARNISHAPI_5) ++ if (VSM_Attach(vd, -1) < 0) { ++ printf("varnish plugin: Cannot attach to varnish. %s", VSM_Error(vd)); ++ exit(1); ++ } ++#elif defined(HAVE_VARNISHAPI_4) || defined(HAVE_VARNISHAPI_4_1) + if (VSM_Open(vd)) + exit(1); + #elif defined(HAVE_VARNISHAPI_3) +@@ -377,7 +411,11 @@ main(int argc, char **argv) + if (!param) + usage(); + ++#if defined(HAVE_VARNISHAPI_5) ++ check_stats(vsc, vd, param); ++#else + check_stats(vd, param); ++#endif + + exit(0); + } +diff --git a/check_varnish/src/configure.ac b/check_varnish/src/configure.ac +index c7946c2..8b0b2ec 100644 +--- a/check_varnish/src/configure.ac ++++ b/check_varnish/src/configure.ac +@@ -21,13 +21,17 @@ AC_PROG_LIBTOOL + AC_PROG_MAKE_SET + + # Checks for libraries. +-PKG_CHECK_MODULES([VARNISHAPI], [varnishapi >= 4.1], +- [AC_DEFINE([HAVE_VARNISHAPI_4_1], [1], [Use VARNISHAPI v4.1])], +- [PKG_CHECK_MODULES([VARNISHAPI], [varnishapi >= 4], +- [AC_DEFINE([HAVE_VARNISHAPI_4], [1], [Use VARNISHAPI v4])], +- [PKG_CHECK_MODULES([VARNISHAPI], [varnishapi >= 3], +- [AC_DEFINE([HAVE_VARNISHAPI_3], [1], [Use VARNISHAPI v3])], +- [AC_MSG_ERROR([Could not find neither varnishapi v4 nor v3.])]) ++PKG_CHECK_MODULES([VARNISHAPI], [varnishapi >= 5.2], ++ [AC_DEFINE([HAVE_VARNISHAPI_5], [1], [Use VARNISHAPI v5])], ++ [PKG_CHECK_MODULES([VARNISHAPI], [varnishapi >= 4.1], ++ [AC_DEFINE([HAVE_VARNISHAPI_4_1], [1], [Use VARNISHAPI v4.1])], ++ [PKG_CHECK_MODULES([VARNISHAPI], [varnishapi >= 4], ++ [AC_DEFINE([HAVE_VARNISHAPI_4], [1], [Use VARNISHAPI v4])], ++ [PKG_CHECK_MODULES([VARNISHAPI], [varnishapi >= 3], ++ [AC_DEFINE([HAVE_VARNISHAPI_3], [1], [Use VARNISHAPI v3])], ++ [AC_MSG_ERROR([Could not find neither varnishapi v4 nor v3.])]) ++ ] ++ ) + ] + ) + ] diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_webinject/epn b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_webinject/epn new file mode 100644 index 0000000..203e5fd --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/check_webinject/epn @@ -0,0 +1,9 @@ +--- a/check_webinject/check_webinject ++++ b/check_webinject/check_webinject +@@ -1,5 +1,5 @@ + #!/usr/bin/perl +-# nagios: +epn ++# nagios: -epn + + package Webinject; + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_cert_expire_dir_check_name_fix b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_cert_expire_dir_check_name_fix new file mode 100644 index 0000000..6d8cb38 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_cert_expire_dir_check_name_fix @@ -0,0 +1,14 @@ +--- a/dsa/checks/dsa-check-cert-expire-dir ++++ b/dsa/checks/dsa-check-cert-expire-dir +@@ -26,9 +26,9 @@ + + sn="$0" + if [ "${sn%/*}" = "$sn" ]; then +- CERT_CHECK=dsa-check-cert-expire ++ CERT_CHECK=check_cert_expire + else +- CERT_CHECK="${sn%/*}/dsa-check-cert-expire" ++ CERT_CHECK="${sn%/*}/check_cert_expire" + fi + + if [ "$#" != 1 ] ; then diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages-inifile b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages-inifile new file mode 100644 index 0000000..056b70a --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages-inifile @@ -0,0 +1,13 @@ +--- a/dsa/checks/dsa-check-packages ++++ b/dsa/checks/dsa-check-packages +@@ -37,8 +37,8 @@ use strict; + use warnings; + use English; + +-my $IGNORE = "/etc/nagios/obsolete-packages-ignore"; +-my $IGNORED = "/etc/nagios/obsolete-packages-ignore.d"; ++my $IGNORE = "/etc/nagios-plugins/obsolete-packages-ignore"; ++my $IGNORED = "/etc/nagios-plugins/obsolete-packages-ignore.d"; + + my %CODE = ( + 'OK' => 0, diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages_,_fix b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages_,_fix new file mode 100644 index 0000000..a000369 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages_,_fix @@ -0,0 +1,30 @@ +--- a/dsa/checks/dsa-check-packages ++++ b/dsa/checks/dsa-check-packages +@@ -334,7 +334,7 @@ for my $form (@reportform) { + push @perfout, sprintf($form->{'perf'}, $num); + next unless ($num > 0); + if ($form->{'listpackages'}) { +- my $list = join(", ", keys %$pkgs); ++ my $list = join(" ", keys %$pkgs); + push @longout, sprintf($form->{'long'}, $num, $list); + } else { + push @longout, sprintf($form->{'long'}, $num); +@@ -344,15 +344,15 @@ for my $form (@reportform) { + }; + if (scalar keys %$packages) { + record('WARNING'); +- unshift @shortout, "unk: ".join(", ", keys %$packages); ++ unshift @shortout, "unk: ".join(" ", keys %$packages); + for my $status (sort {$b cmp $a} keys %$packages) { + my $pkgs = $packages->{$status}; +- my $list = join(", ", keys %$pkgs); ++ my $list = join(" ", keys %$pkgs); + unshift @longout, "Unknown package status $status: $list"; + }; + } + +-my $shortout = $EXITCODE.": ".join(", ", @shortout); ++my $shortout = $EXITCODE.": ".join(" ", @shortout); + my $longout = join("\n", @longout); + my $perfout = "|".join(" ", @perfout); + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages_location b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages_location new file mode 100644 index 0000000..eb71d75 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_packages_location @@ -0,0 +1,11 @@ +--- a/dsa/sbin/dsa-update-apt-status ++++ b/dsa/sbin/dsa-update-apt-status +@@ -78,7 +78,7 @@ fi + tmp=`tempfile` + trap "rm -f '$tmp'" exit + #/usr/share/dsa/apt-status-check --noupdate --timeout=600 > "$tmp" +-/usr/lib/nagios/plugins/dsa-check-packages > "$tmp" ++/usr/lib/nagios/plugins/check_packages > "$tmp" + result="$?" + case "$result" in + 0) diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_running_kernel_jessie_centos_fix b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_running_kernel_jessie_centos_fix new file mode 100644 index 0000000..e850e2f --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/check_running_kernel_jessie_centos_fix @@ -0,0 +1,42 @@ +--- a/dsa/checks/dsa-check-running-kernel ++++ b/dsa/checks/dsa-check-running-kernel +@@ -131,6 +131,11 @@ + filter="$3" + hdroff="$4" + ++ if ! which $filter >/dev/null; then ++ echo "UNKNOWN: filter command '$filter' missing, perhaps install xz-utils?" >&2 ++ exit $UNKNOWN ++ fi ++ + get_offset "$image" $header | head -n 5 | while read off; do + (if [ "$off" != 0 ]; then + dd ibs="$((off+hdroff))" skip=1 count=0 +@@ -182,9 +187,8 @@ + + searched="" + for on_disk in \ +- "/boot/vmlinuz-`uname -r`"\ +- "/boot/vmlinux-`uname -r`"\ +- "/boot/kfreebsd-`uname -r`.gz"; do ++ $([ -f "/boot/vmlinuz-$(uname -r)" ] && find /boot/ -name 'vmlinuz*' -and -name "vmlinuz-$(uname -r)" -or -name 'vmlinuz*' -and -newer "/boot/vmlinuz-$(uname -r)" | sort) \ ++ $([ -f "/boot/kfreebsd-$(uname -r).gz" ] && find /boot/ -name 'kfreebsd*' -and -name "kfreebsd-$(uname -r).gz" -or -name 'kfreebsd*' -and -newer "/boot/kfreebsd-$(uname -r).gz" | sort); do + + if [ -e "$on_disk" ]; then + if [ -z "$STRINGS" ]; then +@@ -196,12 +200,12 @@ + if [ -x /usr/bin/lsb_release ] ; then + vendor=$(lsb_release -i -s) + if [ -n "$vendor" ] && [ "xDebian" != "x$vendor" ] ; then +- on_disk_version=$( echo $on_disk_version|sed -e "s/ ($vendor [[:alnum:]\.-]\+ [[:alnum:]\.]\+)//") ++ on_disk_version=$( echo $on_disk_version|sed -e "s/ ($vendor [[:alnum:]\.-]\+ [[:alnum:]\.-]\+)//") + fi + fi +- [ -z "$on_disk_version" ] || break ++ [ -z "$on_disk_version" ] || continue + on_disk_version="`cat "$on_disk" | $STRINGS | grep 'Linux version' | head -n1`" +- [ -z "$on_disk_version" ] || break ++ [ -z "$on_disk_version" ] || continue + + echo "UNKNOWN: Failed to get a version string from image $on_disk" + exit $UNKNOWN diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/epn b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/epn new file mode 100644 index 0000000..7f31e58 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/epn @@ -0,0 +1,8 @@ +--- a/dsa/checks/dsa-check-packages ++++ b/dsa/checks/dsa-check-packages +@@ -1,4 +1,5 @@ + #!/usr/bin/perl ++# nagios: -epn + + # dsa-check-packages + diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/status_directory b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/status_directory new file mode 100644 index 0000000..5798d55 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/dsa/status_directory @@ -0,0 +1,22 @@ +--- a/dsa/sbin/dsa-update-apt-status ++++ b/dsa/sbin/dsa-update-apt-status +@@ -22,7 +22,7 @@ + # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + UPDATE_RUNS=3 +-STATUSDIR=/var/cache/dsa/nagios ++STATUSDIR=/var/cache/nagios_status + STATUS="${STATUSDIR}"/apt + SLEEP_MAX=$(( 15 * 60 )) + MAX_AGE=$(( 23 * 60 * 60 )) +--- a/dsa/sbin/dsa-update-unowned-file-status ++++ b/dsa/sbin/dsa-update-unowned-file-status +@@ -22,7 +22,7 @@ + # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + CUTOFF=40 +-STATUSDIR=/var/cache/dsa/nagios ++STATUSDIR=/var/cache/nagios_status + STATUS="${STATUSDIR}"/nouser + + mkdir -p "${STATUSDIR}" diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/percona-nagios-plugins/fix_bashism b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/percona-nagios-plugins/fix_bashism new file mode 100644 index 0000000..ec431a2 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/percona-nagios-plugins/fix_bashism @@ -0,0 +1,8 @@ +--- a/percona-nagios-plugins/nagios/bin/pmp-check-mysql-ts-count ++++ b/percona-nagios-plugins/nagios/bin/pmp-check-mysql-ts-count +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # ######################################################################## + # This program is part of $PROJECT_NAME$ diff --git a/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/series b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/series new file mode 100644 index 0000000..98c8600 --- /dev/null +++ b/nagios-plugins-contrib-24.20190301~bpo9+1/debian/patches/series @@ -0,0 +1,54 @@ +dsa/check_cert_expire_dir_check_name_fix +dsa/check_running_kernel_jessie_centos_fix +check_ajp/return_critical_on_failed_connection +check_backuppc/use_nagios_plugins +check_bgpstate/epn +check_clamav/clamav_locations +check_cups/epn +check_cups/monitoring-plugin +check_drbd/fix_for_oos_and_cosmetic +check_email_delivery/epn +check_email_delivery/paths +check_haproxy/epn +check_haproxy/monitoring-plugin +check_haproxy_stats/interpreter +check_httpd_status/epn +check_httpd_status/monitoring-plugin +check_imap_quota/syntax_error_fix +check_libs/lsof-speedup +check_libs/config_path +check_libs/space_before_deleted +check_libvirt/monitoring-plugin +check_libvirt/fix_uom +check_lm_sensors/manpage_whatis_fix +check_lm_sensors/spelling_errors +check_lm_sensors/interpreter +check_memory/new_free +check_memory/monitoring-plugin +check_nfsmounts/perl_module +check_nfsmounts/nfs_write_location +check_printer/use_data_dumper_if_needed +check_printer/use_nagios_plugin +check_printer/debian_bts +#check_raid/prefer_cciss_vol_status_over_hpacucli +check_rbl/interpreter +check_rbl/additional_rbls +check_smstools/monitoring-plugin +check_smstools/operator_siglvl +check_snmp_environment/epn +check_snmp_time/epn +check_uptime/missing_backslash +check_v46/no_epn +check_webinject/epn +dsa/check_packages_location +dsa/status_directory +dsa/check_packages-inifile +dsa/epn +dsa/check_packages_,_fix +check_cups/ParseDateDelta +check_printer/epn +check_nfsmounts/nfs4_support +check_httpd_status/htdigest_auth +check_varnish/fix_for_v56 +check_raid/no_epn +percona-nagios-plugins/fix_bashism -- cgit v1.2.3