diff -Nru nagios-snmp-plugins-1.1.1/debian/bin/github-release.sh nagios-snmp-plugins-1.1.1/debian/bin/github-release.sh
--- nagios-snmp-plugins-1.1.1/debian/bin/github-release.sh 1970-01-01 00:00:00.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/bin/github-release.sh 2016-01-27 15:41:53.000000000 +0000
@@ -0,0 +1,188 @@
+#!/bin/bash
+
+# Copyright (c) 2014 Terry Burton
+#
+# https://github.com/terryburton/travis-github-release
+#
+# Permission is hereby granted, free of charge, to any
+# person obtaining a copy of this software and associated
+# documentation files (the "Software"), to deal in the
+# Software without restriction, including without
+# limitation the rights to use, copy, modify, merge,
+# publish, distribute, sublicense, and/or sell copies of
+# the Software, and to permit persons to whom the Software
+# is furnished to do so, subject to the following
+# conditions:
+#
+# The above copyright notice and this permission notice
+# shall be included in all copies or substantial portions
+# of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
+# THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+# This script provides a simple continuous deployment
+# solution that allows Travis CI to publish a new GitHub
+# release and upload assets to it whenever a tag is pushed:
+# git tag; git push --tags
+#
+# It is created as a temporary solution whilst we wait for
+# Travis DPL to support GitHub:
+#
+# https://github.com/travis-ci/dpl
+#
+# Place this script somewhere in your project repository (perhaps by forking
+# the github-travis-release repo and adding your fork as a git submodule) then
+# put something like this to your .travis.yml:
+#
+# after_success: .travis/github-release.sh "$TRAVIS_REPO_SLUG" "`head -1 src/VERSION`" build/release/*
+#
+# The first argument is your repository in the format
+# "username/repository", which Travis provides in the
+# TRAVIS_REPO_SLUG environment variable.
+#
+# The second argument is the release version which as a
+# sanity check should match the tag that you are releasing.
+# You could pass "`git describe`" to satisfy this check.
+#
+# The remaining arguments are a list of asset files that you
+# want to publish along with the release.
+#
+# The script requires that you create a GitHub OAuth access
+# token to facilitate the upload:
+#
+# https://help.github.com/articles/creating-an-access-token-for-command-line-use
+#
+# You must pass this securely in the GITHUBTOKEN environment
+# variable:
+#
+# http://docs.travis-ci.com/user/encryption-keys/
+#
+# For testing purposes you can create a local convenience
+# file in the script directory called GITHUBTOKEN that sets
+# the GITHUBTOKEN environment variable. If you do so you MUST
+# ensure that this doesn't get pushed to your repository,
+# perhaps by adding it to a .gitignore file.
+#
+# Should you get stuck then look at a working example. This
+# code is being used by Barcode Writer in Pure PostScript
+# for automated deployment:
+#
+# https://github.com/terryburton/postscriptbarcode
+
+set -e
+
+REPO=$1 && shift
+RELEASE=$1 && shift
+RELEASEFILES=$@
+
+if ! TAG=`git describe --exact-match --tags 2>/dev/null`; then
+ echo "This commit is not a tag so not creating a release"
+ exit 0
+fi
+
+if [ "$TRAVIS" = "true" ] && [ -z "$TRAVIS_TAG" ]; then
+ echo "This build is not for the tag so not creating a release"
+ exit 0
+fi
+
+if [ "$TRAVIS" = "true" ] && [ "$TRAVIS_TAG" != "$RELEASE" ]; then
+ echo "Error: TRAVIS_TAG ($TRAVIS_TAG) does not match the indicated release ($RELEASE)"
+ exit 1
+fi
+
+if [ "$TAG" != "$RELEASE" ]; then
+ echo "Error: The tag ($TAG) does not match the indicated release ($RELEASE)"
+ exit 1
+fi
+
+if [[ -z "$RELEASEFILES" ]]; then
+ echo "Error: No release files provided"
+ exit 1
+fi
+
+SCRIPTDIR=`dirname $0`
+[ -e "$SCRIPTDIR/GITHUBTOKEN" ] && . "$SCRIPTDIR/GITHUBTOKEN"
+if [[ -z "$GITHUBTOKEN" ]]; then
+ echo "Error: GITHUBTOKEN is not set"
+ exit 1
+fi
+
+echo "Creating GitHub release for $RELEASE"
+
+echo -n "Create draft release... "
+JSON=$(cat < Wed, 27 Jan 2016 16:23:36 +0100
+
nagios-snmp-plugins (1.1.1-11) unstable; urgency=medium
* [dd7632d] Create /etc/nagios-plugins/config/ (Closes: #767681)
diff -Nru nagios-snmp-plugins-1.1.1/debian/control nagios-snmp-plugins-1.1.1/debian/control
--- nagios-snmp-plugins-1.1.1/debian/control 2014-11-02 19:45:34.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/control 2016-01-27 15:41:53.000000000 +0000
@@ -11,7 +11,12 @@
Package: nagios-snmp-plugins
Architecture: all
-Depends: ${perl:Depends}, ${misc:Depends}, libnet-snmp-perl, monitoring-plugins-common | nagios-plugins-basic (>= 1.4.5-2), perl-base (>= 5.8.4-8), ucf
+Depends: libnet-snmp-perl,
+ monitoring-plugins-common | nagios-plugins-basic (>= 1.4.5-2),
+ perl-base (>= 5.8.4-8),
+ ucf,
+ ${misc:Depends},
+ ${perl:Depends}
Recommends: libcrypt-des-perl, libcrypt-rijndael-perl
Description: SNMP Plugins for nagios
A set of Nagios plugins to check hosts/devices using snmp protocol
diff -Nru nagios-snmp-plugins-1.1.1/debian/copyright nagios-snmp-plugins-1.1.1/debian/copyright
--- nagios-snmp-plugins-1.1.1/debian/copyright 2014-11-02 19:45:34.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/copyright 2016-01-27 15:41:53.000000000 +0000
@@ -11,6 +11,30 @@
Copyright: Copyright (C) 2006, 2008 Jan Wagner
License: GPL-2+
+Files: debian/bin/github-release.sh
+Copyright: Copyright (c) 2014 Terry Burton
+License: Expat
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining
+ a copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sublicense, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included
+ in all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
License: GPL-2
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
diff -Nru nagios-snmp-plugins-1.1.1/debian/patches/01_update_pre_1.1.2 nagios-snmp-plugins-1.1.1/debian/patches/01_update_pre_1.1.2
--- nagios-snmp-plugins-1.1.1/debian/patches/01_update_pre_1.1.2 2014-11-02 19:45:34.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/patches/01_update_pre_1.1.2 2016-01-27 15:41:53.000000000 +0000
@@ -2,9 +2,8 @@
##
## DP: Update to the latest know CVS verions
-diff -Nur nagios_plugins/Changelog plugins/Changelog
---- nagios_plugins/Changelog 2007-04-23 15:15:40.000000000 +0200
-+++ plugins/Changelog 2007-10-20 13:26:06.000000000 +0200
+--- a/Changelog
++++ b/Changelog
@@ -1,4 +1,38 @@
################################
+Release 1.1.2 / Jun 2007 :
@@ -44,9 +43,8 @@
Release 1.1.1 / April 2007 :
Added documentation in doc/ directory : (html format).
-diff -Nur nagios_plugins/INSTALL plugins/INSTALL
---- nagios_plugins/INSTALL 1970-01-01 01:00:00.000000000 +0100
-+++ plugins/INSTALL 2007-10-20 13:26:06.000000000 +0200
+--- /dev/null
++++ b/INSTALL
@@ -0,0 +1,15 @@
+Installation:
+-------------
@@ -63,9 +61,8 @@
+The script will check for dependencies and ask for Nagios and temp directories.
+It will modify the scripts depending on these answers and install the scripts.
+
-diff -Nur nagios_plugins/README plugins/README
---- nagios_plugins/README 2007-04-20 17:04:08.000000000 +0200
-+++ plugins/README 2007-10-20 13:26:06.000000000 +0200
+--- a/README
++++ b/README
@@ -1,4 +1,4 @@
-Nagios SNMP plugins 1.1.1 README
+Nagios SNMP plugins 1.1.2 README
@@ -81,9 +78,8 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
-diff -Nur nagios_plugins/check_snmp_cpfw.pl plugins/check_snmp_cpfw.pl
---- nagios_plugins/check_snmp_cpfw.pl 2007-04-20 00:03:30.000000000 +0200
-+++ plugins/check_snmp_cpfw.pl 2007-10-20 13:26:06.000000000 +0200
+--- a/check_snmp_cpfw.pl
++++ b/check_snmp_cpfw.pl
@@ -1,10 +1,11 @@
#!/usr/bin/perl -w
############################## check_snmp_cpfw ##############
@@ -245,9 +241,8 @@
}
print "$f_print\n";
-diff -Nur nagios_plugins/check_snmp_env.pl plugins/check_snmp_env.pl
---- nagios_plugins/check_snmp_env.pl 2007-04-20 11:45:22.000000000 +0200
-+++ plugins/check_snmp_env.pl 2007-10-20 13:26:06.000000000 +0200
+--- a/check_snmp_env.pl
++++ b/check_snmp_env.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
############################## check_snmp_env #################
@@ -372,9 +367,8 @@
+
+print "Unknown check type : UNKNOWN\n";
+exit $ERRORS{"UNKNOWN"};
-diff -Nur nagios_plugins/check_snmp_int.pl plugins/check_snmp_int.pl
---- nagios_plugins/check_snmp_int.pl 2007-04-23 11:40:39.000000000 +0200
-+++ plugins/check_snmp_int.pl 2007-10-20 13:26:06.000000000 +0200
+--- a/check_snmp_int.pl
++++ b/check_snmp_int.pl
@@ -1,13 +1,12 @@
#!/usr/bin/perl -w
############################## check_snmp_int ##############
@@ -739,9 +733,8 @@
}
}
}
-diff -Nur nagios_plugins/check_snmp_load.pl plugins/check_snmp_load.pl
---- nagios_plugins/check_snmp_load.pl 2007-04-16 19:41:20.000000000 +0200
-+++ plugins/check_snmp_load.pl 2007-10-20 13:26:06.000000000 +0200
+--- a/check_snmp_load.pl
++++ b/check_snmp_load.pl
@@ -1,11 +1,10 @@
#!/usr/bin/perl -w
############################## check_snmp_load #################
@@ -778,9 +771,8 @@
my $o_host = undef; # hostname
my $o_community = undef; # community
-diff -Nur nagios_plugins/check_snmp_mem.pl plugins/check_snmp_mem.pl
---- nagios_plugins/check_snmp_mem.pl 2006-07-09 22:52:37.000000000 +0200
-+++ plugins/check_snmp_mem.pl 2007-10-20 13:26:06.000000000 +0200
+--- a/check_snmp_mem.pl
++++ b/check_snmp_mem.pl
@@ -1,11 +1,11 @@
#!/usr/bin/perl -w
############################## check_snmp_mem ##############
@@ -929,9 +921,8 @@
verb ("Swap : $$resultat{$nets_swap_free} / $$resultat{$nets_swap_total} : $swapused");
my $n_status="OK";
-diff -Nur nagios_plugins/check_snmp_process.pl plugins/check_snmp_process.pl
---- nagios_plugins/check_snmp_process.pl 2007-03-12 21:36:02.000000000 +0100
-+++ plugins/check_snmp_process.pl 2007-10-20 13:26:06.000000000 +0200
+--- a/check_snmp_process.pl
++++ b/check_snmp_process.pl
@@ -1,45 +1,43 @@
#!/usr/bin/perl -w
############################## check_snmp_process ##############
@@ -1132,9 +1123,8 @@
if ($final_status==2) { exit $ERRORS{"CRITICAL"};}
if ($final_status==1) { exit $ERRORS{"WARNING"};}
-diff -Nur nagios_plugins/check_snmp_storage.pl plugins/check_snmp_storage.pl
---- nagios_plugins/check_snmp_storage.pl 2007-03-12 22:01:36.000000000 +0100
-+++ plugins/check_snmp_storage.pl 2007-10-20 13:26:06.000000000 +0200
+--- a/check_snmp_storage.pl
++++ b/check_snmp_storage.pl
@@ -1,12 +1,12 @@
#!/usr/bin/perl -w
############################## check_snmp_storage ##############
@@ -1350,9 +1340,8 @@
if (!defined ($output)) { $output="All selected storages "; }
-diff -Nur nagios_plugins/check_snmp_vrrp.pl plugins/check_snmp_vrrp.pl
---- nagios_plugins/check_snmp_vrrp.pl 2006-08-23 23:39:48.000000000 +0200
-+++ plugins/check_snmp_vrrp.pl 2007-10-20 13:26:06.000000000 +0200
+--- a/check_snmp_vrrp.pl
++++ b/check_snmp_vrrp.pl
@@ -1,11 +1,11 @@
#!/usr/bin/perl -w
############################## check_snmp_vrrp ##############
@@ -1518,9 +1507,8 @@
}
# Get the priority
$key=$vrrp_prio{$o_type}.".".$vrid[$i];
-diff -Nur nagios_plugins/check_snmp_win.pl plugins/check_snmp_win.pl
---- nagios_plugins/check_snmp_win.pl 2006-11-29 20:59:55.000000000 +0100
-+++ plugins/check_snmp_win.pl 2007-10-20 13:26:06.000000000 +0200
+--- a/check_snmp_win.pl
++++ b/check_snmp_win.pl
@@ -1,10 +1,11 @@
#!/usr/bin/perl -w
############################## check_snmp_win ##############
diff -Nru nagios-snmp-plugins-1.1.1/debian/patches/19_check_snmp_load_n5k nagios-snmp-plugins-1.1.1/debian/patches/19_check_snmp_load_n5k
--- nagios-snmp-plugins-1.1.1/debian/patches/19_check_snmp_load_n5k 1970-01-01 00:00:00.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/patches/19_check_snmp_load_n5k 2016-01-27 15:41:53.000000000 +0000
@@ -0,0 +1,97 @@
+## 19_check_snmp_load_n5k by Luis I. Perez Villota
+##
+## DP: Add support for n5k to check_snmp_load.pl
+
+## From de5ca289b5a696d17bdf0343f53b06ab7f7bbb9b Mon Sep 17 00:00:00 2001
+## From: "Luis I. Perez Villota"
+## Date: Wed, 8 Apr 2015 14:18:37 +0200
+## Subject: [PATCH] Add Cisco Nexus Devices capability for load
+
+ Adding CPU Check for Cisco Nexus Devices
+---
+ check_snmp_load.pl | 50 ++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 48 insertions(+), 2 deletions(-)
+
+diff --git a/check_snmp_load.pl b/check_snmp_load.pl
+index 6487bde..fd13f71 100755
+--- a/check_snmp_load.pl
++++ b/check_snmp_load.pl
+@@ -55,6 +55,9 @@
+
+ my $as400_cpu = "1.3.6.1.4.1.2.6.4.5.1.0"; # AS400 CPU load (10000=100%);
+
++# N5K CPU
++my $n5k_cpu = "1.3.6.1.4.1.9.9.305.1.1.1.0"; # N5K CPU load (%)
++
+ # Net-SNMP CPU
+
+ my $ns_cpu_idle = "1.3.6.1.4.1.2021.11.11.0"; # Net-snmp cpu idle
+@@ -85,9 +88,9 @@
+ my $hpux_load_15_min="1.3.6.1.4.1.11.2.3.1.1.5.0";
+
+ # valid values
+-my @valid_types = ("stand","netsc","netsl","as400","cisco","cata","nsc","fg","bc","nokia","hp","lp","hpux");
++my @valid_types = ("stand","netsc","netsl","as400","cisco","cata","nsc","fg","bc","nokia","hp","lp","hpux","n5k");
+ # CPU OID array
+-my %cpu_oid = ("netsc",$ns_cpu_idle,"as400",$as400_cpu,"bc",$bluecoat_cpu,"nokia",$nokia_cpu,"hp",$procurve_cpu,"lp",$linkproof_cpu,"fg",$fortigate_cpu);
++my %cpu_oid = ("netsc",$ns_cpu_idle,"as400",$as400_cpu,"bc",$bluecoat_cpu,"nokia",$nokia_cpu,"hp",$procurve_cpu,"lp",$linkproof_cpu,"fg",$fortigate_cpu, "n5k",$n5k_cpu);
+
+ # Globals
+
+@@ -179,6 +182,7 @@ sub help {
+ netsc : cpu usage given by net-snmp (100-idle)
+ as400 : as400 CPU usage
+ cisco : Cisco CPU usage
++ n5k : Cisco Nexus CPU Usage
+ cata : Cisco catalyst CPU usage
+ nsc : NetScreen CPU usage
+ fg : Fortigate CPU usage
+@@ -475,6 +479,48 @@ sub check_options {
+ exit $exit_val;
+ }
+
++############## Cisco N5K CPU Check ###################
++if ($o_check_type eq "n5k") {
++my @oidlists = ($n5k_cpu);
++my $resultat = (Net::SNMP->VERSION lt 4) ?
++ $session->get_request(@oidlists)
++ : $session->get_request(-varbindlist => \@oidlists);
++if (!defined($resultat)) {
++ printf("ERROR: Description table : %s.\n", $session->error);
++ $session->close;
++ exit $ERRORS{"UNKNOWN"};
++}
++
++$session->close;
++if (!defined ($$resultat{$n5k_cpu})) {
++ print "No CPU information : UNKNOWN\n";
++ exit $ERRORS{"UNKNOWN"};
++}
++
++my $n5k_load = $$resultat{$n5k_cpu};
++if ($n5k_load > $o_crit ) {
++ print "$n5k_load% > $o_crit% : CRITICAL";
++ $exit_val=$ERRORS{"CRITICAL"};
++}
++elsif ($n5k_load > $o_warn) {
++ print "$n5k_load% > $o_warn% : WARNING";
++ $exit_val=$ERRORS{"WARNING"};
++}
++else{
++ print "CPU: $n5k_load%";
++ $exit_val=$ERRORS{"OK"};
++}
++if (defined($o_perf)) {
++ print " | n5k_load=$n5k_load%";
++}
++print "\n";
++exit $exit_val;
++
++
++
++
++
++}
+ ############## Cisco Catalyst CPU check ################
+
+ if ($o_check_type eq "cata") {
diff -Nru nagios-snmp-plugins-1.1.1/debian/patches/20_check_snmp_load_multiple_cpus nagios-snmp-plugins-1.1.1/debian/patches/20_check_snmp_load_multiple_cpus
--- nagios-snmp-plugins-1.1.1/debian/patches/20_check_snmp_load_multiple_cpus 1970-01-01 00:00:00.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/patches/20_check_snmp_load_multiple_cpus 2016-01-27 15:41:53.000000000 +0000
@@ -0,0 +1,64 @@
+## 19_check_snmp_load_n5k by Luis I. Perez Villota
+##
+## DP: Add support for n5k to check_snmp_load.pl
+
+## From 1fcf4f4220edb886fb85931792542d962cf02ecb Mon Sep 17 00:00:00 2001
+## From: Michael Friedrich
+## Date: Sat, 25 Apr 2015 15:20:32 +0200
+## Subject: [PATCH] check_snmp_load.pl - Linux load multiple CPUs
+
+## Linux load doesn't handle multiple CPUs properly. Here is a patch that makes
+## the plugin to get the number of CPUs for a particular system and multiply
+## warning and critical limits by this number.
+
+fixes #6
+---
+check_snmp_load.pl | 19 ++++++++++++++++++-
+ 1 file changed, 18 insertions(+), 1 deletion(-)
+
+--- a/check_snmp_load.pl
++++ b/check_snmp_load.pl
+@@ -363,11 +363,25 @@
+ if ($o_check_type eq "netsl") {
+
+ verb("Checking linux load");
++
++# Get number of CPUs
++my $resultat = (Net::SNMP->VERSION < 4) ?
++ $session->get_table($proc_id)
++ : $session->get_table(Baseoid => $proc_id);
++
++if (!defined($resultat)) {
++ printf("ERROR: Description table : %s.\n", $session->error);
++ $session->close;
++ exit $ERRORS{"UNKNOWN"};
++}
++
++my $ncpu = keys %$resultat;
++
+ # Get load table
+-my $resultat = (Net::SNMP->VERSION lt 4) ?
++$resultat = (Net::SNMP->VERSION lt 4) ?
+ $session->get_table($linload_table)
+- : $session->get_table(Baseoid => $linload_table);
+-
++ : $session->get_table(Baseoid => $linload_table);
++
+ if (!defined($resultat)) {
+ printf("ERROR: Description table : %s.\n", $session->error);
+ $session->close;
+@@ -397,10 +411,13 @@
+
+ for (my $i=0;$i<3;$i++) { $load[$i] = $$resultat{$linload_load . "." . $iload[$i]}};
+
+-print "Load : $load[0] $load[1] $load[2] :";
++print "Load (CPUs: $ncpu) : $load[0] $load[1] $load[2] :";
+
+ $exit_val=$ERRORS{"OK"};
+ for (my $i=0;$i<3;$i++) {
++ # Multiply warning and critical levels by the number of CPUs
++ $o_warnL[$i] *= $ncpu;
++ $o_critL[$i] *= $ncpu;
+ if ( $load[$i] > $o_critL[$i] ) {
+ print " $load[$i] > $o_critL[$i] : CRITICAL";
+ $exit_val=$ERRORS{"CRITICAL"};
diff -Nru nagios-snmp-plugins-1.1.1/debian/patches/21_check_snmp_load_abstract_snmp_version_check nagios-snmp-plugins-1.1.1/debian/patches/21_check_snmp_load_abstract_snmp_version_check
--- nagios-snmp-plugins-1.1.1/debian/patches/21_check_snmp_load_abstract_snmp_version_check 1970-01-01 00:00:00.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/patches/21_check_snmp_load_abstract_snmp_version_check 2016-01-27 15:41:53.000000000 +0000
@@ -0,0 +1,121 @@
+From 846165c880793a97a2e727f4d13e23df40e8f1a4 Mon Sep 17 00:00:00 2001
+From: morgajel
+Date: Wed, 13 May 2015 12:33:21 -0400
+Subject: [PATCH] Abstracted snmp version check to circumvent error and bug
+
+There are two issues:
+1) Net::SNMP changed it's VERSION to be a quoted string rather than a bare mess. This caused
+Argument "v6.0.1" isn't numeric in numeric lt (<) at /opt/manubulon/plugins/check_snmp_load.pl line 368.
+
+2) the rest of the file used lt rather than <, which means they were using ascii sorting rather than digit comparison
+
+Both of these issues have now been resolved; This fix has only been applied to this one script, but it may
+need to be implemented in the other scripts.
+---
+ check_snmp_load.pl | 30 +++++++++++++++++++++---------
+ 1 file changed, 21 insertions(+), 9 deletions(-)
+
+diff --git a/check_snmp_load.pl b/check_snmp_load.pl
+index c8661aa..751c6ec 100755
+--- a/check_snmp_load.pl
++++ b/check_snmp_load.pl
+@@ -280,6 +280,18 @@ sub check_options {
+ }
+ }
+
++# This is required to get around all of the silly historical methods of
++# versioning with Net::SNMP.
++sub is_legacy_snmp_version {
++ my $version=Net::SNMP->VERSION; #using a variable for easier testing
++ if ($version=~/^\D*(\d)/ and $1 < 4){
++ print "$1 wee";
++ return 1;
++ }else{
++ return 0;
++ }
++}
++
+ ########## MAIN #######
+
+ check_options();
+@@ -365,7 +377,7 @@ sub check_options {
+ verb("Checking linux load");
+
+ # Get number of CPUs
+-my $resultat = (Net::SNMP->VERSION < 4) ?
++my $resultat = (is_legacy_snmp_version()) ?
+ $session->get_table($proc_id)
+ : $session->get_table(Baseoid => $proc_id);
+
+@@ -378,7 +390,7 @@ sub check_options {
+ my $ncpu = keys %$resultat;
+
+ # Get load table
+-$resultat = (Net::SNMP->VERSION lt 4) ?
++$resultat = (is_legacy_snmp_version()) ?
+ $session->get_table($linload_table)
+ : $session->get_table(Baseoid => $linload_table);
+
+@@ -445,7 +457,7 @@ sub check_options {
+
+ if ($o_check_type eq "cisco") {
+ my @oidlists = ($cisco_cpu_5m, $cisco_cpu_1m, $cisco_cpu_5s);
+-my $resultat = (Net::SNMP->VERSION lt 4) ?
++my $resultat = (is_legacy_snmp_version()) ?
+ $session->get_request(@oidlists)
+ : $session->get_request(-varbindlist => \@oidlists);
+
+@@ -499,7 +511,7 @@ sub check_options {
+ ############## Cisco N5K CPU Check ###################
+ if ($o_check_type eq "n5k") {
+ my @oidlists = ($n5k_cpu);
+-my $resultat = (Net::SNMP->VERSION lt 4) ?
++my $resultat = (is_legacy_snmp_version()) ?
+ $session->get_request(@oidlists)
+ : $session->get_request(-varbindlist => \@oidlists);
+ if (!defined($resultat)) {
+@@ -542,7 +554,7 @@ sub check_options {
+
+ if ($o_check_type eq "cata") {
+ my @oidlists = ($ciscocata_cpu_5m, $ciscocata_cpu_1m, $ciscocata_cpu_5s);
+-my $resultat = (Net::SNMP->VERSION lt 4) ?
++my $resultat = (is_legacy_snmp_version()) ?
+ $session->get_request(@oidlists)
+ : $session->get_request(-varbindlist => \@oidlists);
+
+@@ -597,7 +609,7 @@ sub check_options {
+
+ if ($o_check_type eq "nsc") {
+ my @oidlists = ($nsc_cpu_5m, $nsc_cpu_1m, $nsc_cpu_5s);
+-my $resultat = (Net::SNMP->VERSION lt 4) ?
++my $resultat = (is_legacy_snmp_version()) ?
+ $session->get_request(@oidlists)
+ : $session->get_request(-varbindlist => \@oidlists);
+
+@@ -654,7 +666,7 @@ sub check_options {
+ # Get load table
+ my @oidlist = $cpu_oid{$o_check_type};
+ verb("Checking OID : @oidlist");
+-my $resultat = (Net::SNMP->VERSION lt 4) ?
++my $resultat = (is_legacy_snmp_version()) ?
+ $session->get_request(@oidlist)
+ : $session->get_request(-varbindlist => \@oidlist);
+ if (!defined($resultat)) {
+@@ -702,7 +714,7 @@ sub check_options {
+ verb("Checking hpux load");
+
+ my @oidlists = ($hpux_load_1_min, $hpux_load_5_min, $hpux_load_15_min);
+-my $resultat = (Net::SNMP->VERSION lt 4) ?
++my $resultat = (is_legacy_snmp_version()) ?
+ $session->get_request(@oidlists)
+ : $session->get_request(-varbindlist => \@oidlists);
+
+@@ -755,7 +767,7 @@ sub check_options {
+
+ ########## Standard cpu usage check ############
+ # Get desctiption table
+-my $resultat = (Net::SNMP->VERSION lt 4) ?
++my $resultat = (is_legacy_snmp_version()) ?
+ $session->get_table($base_proc)
+ : $session->get_table(Baseoid => $base_proc);
+
diff -Nru nagios-snmp-plugins-1.1.1/debian/patches/22_remove_utils_pm nagios-snmp-plugins-1.1.1/debian/patches/22_remove_utils_pm
--- nagios-snmp-plugins-1.1.1/debian/patches/22_remove_utils_pm 1970-01-01 00:00:00.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/patches/22_remove_utils_pm 2016-01-27 15:41:53.000000000 +0000
@@ -0,0 +1,509 @@
+From 83795bee374466b865a99af479d7cfa0e1ed1e08 Mon Sep 17 00:00:00 2001
+From: Michael Friedrich
+Date: Mon, 25 May 2015 14:35:53 +0200
+Subject: [PATCH] Get rid of utils.pm entirely
+
+It's only used for $TIMEOUT and %ERRORS which have
+been implemented partly inside the plugins already.
+
+This commit removes the file, the plugin dir lib
+inclusion as well as the install.sh checks entirely.
+
+Documentation has been updated as well.
+
+fix #10
+---
+ check_snmp_boostedge.pl | 8 ++-
+ check_snmp_cpfw.pl | 3 +-
+ check_snmp_css.pl | 9 ++--
+ check_snmp_css_main.pl | 9 ++--
+ check_snmp_env.pl | 9 ++--
+ check_snmp_int.pl | 3 +-
+ check_snmp_linkproof_nhr.pl | 9 ++--
+ check_snmp_load.pl | 3 +-
+ check_snmp_mem.pl | 3 +-
+ check_snmp_nsbox.pl | 9 ++--
+ check_snmp_process.pl | 3 +-
+ check_snmp_storage.pl | 9 ++--
+ check_snmp_vrrp.pl | 3 +-
+ check_snmp_win.pl | 5 +-
+ install.sh | 105 +++++++++++++++---------------------
+ utils.pm | 67 -----------------------
+ 17 files changed, 75 insertions(+), 192 deletions(-)
+ delete mode 100644 plugins/utils.pm
+
+--- a/check_snmp_boostedge.pl
++++ b/check_snmp_boostedge.pl
+@@ -16,12 +16,10 @@
+ use Net::SNMP;
+ use Getopt::Long;
+
+-# Nagios specific
++# Icinga specific
+
+-use lib "/usr/local/nagios/libexec";
+-use utils qw(%ERRORS $TIMEOUT);
+-#my $TIMEOUT = 15;
+-#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
++my $TIMEOUT = 15;
++my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+ # SNMP Datas
+
+--- a/check_snmp_cpfw.pl
++++ b/check_snmp_cpfw.pl
+@@ -17,8 +17,7 @@
+ use Net::SNMP;
+ use Getopt::Long;
+
+-# Nagios specific
+-
++# Icinga specific
+ my $TIMEOUT = 15;
+ my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+--- a/check_snmp_css.pl
++++ b/check_snmp_css.pl
+@@ -16,12 +16,9 @@
+ use Net::SNMP;
+ use Getopt::Long;
+
+-# Nagios specific
+-
+-use lib "/usr/local/nagios/libexec";
+-use utils qw(%ERRORS $TIMEOUT);
+-#my $TIMEOUT = 15;
+-#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
++# Icinga specific
++my $TIMEOUT = 15;
++my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+ # SNMP Datas
+
+--- a/check_snmp_css_main.pl
++++ b/check_snmp_css_main.pl
+@@ -16,12 +16,9 @@
+ use Net::SNMP;
+ use Getopt::Long;
+
+-# Nagios specific
+-
+-use lib "/usr/local/nagios/libexec";
+-use utils qw(%ERRORS $TIMEOUT);
+-#my $TIMEOUT = 15;
+-#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
++# Icinga specific
++my $TIMEOUT = 15;
++my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+ # SNMP Datas
+
+--- a/check_snmp_env.pl
++++ b/check_snmp_env.pl
+@@ -16,12 +16,9 @@
+ use Net::SNMP;
+ use Getopt::Long;
+
+-# Nagios specific
+-
+-use lib "/usr/local/nagios/libexec";
+-use utils qw(%ERRORS $TIMEOUT);
+-#my $TIMEOUT = 15;
+-#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
++# Icinga specific
++my $TIMEOUT = 15;
++my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+
+ my @Nagios_state = ("UNKNOWN","OK","WARNING","CRITICAL"); # Nagios states coding
+--- a/check_snmp_int.pl
++++ b/check_snmp_int.pl
+@@ -20,8 +20,7 @@
+ my $o_base_dir="/tmp/tmp_Nagios_int.";
+ my $file_history=200; # number of data to keep in files.
+
+-# Nagios specific
+-
++# Icinga specific
+ my $TIMEOUT = 15;
+ my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+--- a/check_snmp_linkproof_nhr.pl
++++ b/check_snmp_linkproof_nhr.pl
+@@ -16,12 +16,9 @@
+ use Net::SNMP;
+ use Getopt::Long;
+
+-# Nagios specific
+-
+-use lib "/usr/local/nagios/libexec";
+-use utils qw(%ERRORS $TIMEOUT);
+-#my $TIMEOUT = 15;
+-#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
++# Icinga specific
++my $TIMEOUT = 15;
++my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+ # SNMP Datas
+
+--- a/check_snmp_load.pl
++++ b/check_snmp_load.pl
+@@ -15,8 +15,7 @@
+ use Net::SNMP;
+ use Getopt::Long;
+
+-# Nagios specific
+-
++# Icinga specific
+ my $TIMEOUT = 15;
+ my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+--- a/check_snmp_mem.pl
++++ b/check_snmp_mem.pl
+@@ -16,8 +16,7 @@
+ use Net::SNMP;
+ use Getopt::Long;
+
+-# Nagios specific
+-
++# Icinga specific
+ my $TIMEOUT = 15;
+ my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+--- a/check_snmp_nsbox.pl
++++ b/check_snmp_nsbox.pl
+@@ -16,12 +16,9 @@
+ use Net::SNMP;
+ use Getopt::Long;
+
+-# Nagios specific
+-
+-use lib "/usr/local/nagios/libexec";
+-use utils qw(%ERRORS $TIMEOUT);
+-#my $TIMEOUT = 15;
+-#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
++# Icinga specific
++my $TIMEOUT = 15;
++my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+ # SNMP Datas
+ my $ns_service_status= "1.3.6.1.4.1.14020.2.2.1.3.0"; # service status 1= ok ??
+--- a/check_snmp_process.pl
++++ b/check_snmp_process.pl
+@@ -21,8 +21,7 @@
+ my $file_history=200; # number of data to keep in files.
+ my $delta_of_time_to_make_average=300; # 5minutes by default
+
+-# Nagios specific
+-
++# Icinga specific
+ my $TIMEOUT = 15;
+ my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+--- a/check_snmp_storage.pl
++++ b/check_snmp_storage.pl
+@@ -15,12 +15,9 @@
+ use Net::SNMP;
+ use Getopt::Long;
+
+-# Nagios specific
+-
+-use lib "/usr/local/nagios/libexec";
+-use utils qw(%ERRORS $TIMEOUT);
+-#my $TIMEOUT = 15;
+-#my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
++# Icinga specific
++my $TIMEOUT = 15;
++my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+ # SNMP Datas
+ my $storage_table= '1.3.6.1.2.1.25.2.3.1';
+--- a/check_snmp_vrrp.pl
++++ b/check_snmp_vrrp.pl
+@@ -15,8 +15,7 @@
+ use Net::SNMP;
+ use Getopt::Long;
+
+-# Nagios specific
+-
++# Icinga specific
+ my $TIMEOUT = 15;
+ my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+--- a/check_snmp_win.pl
++++ b/check_snmp_win.pl
+@@ -15,10 +15,7 @@
+ use Net::SNMP;
+ use Getopt::Long;
+
+-# Nagios specific
+-
+-#use lib "/usr/local/nagios/libexec";
+-#use utils qw(%ERRORS $TIMEOUT);
++# Icinga specific
+ my $TIMEOUT = 15;
+ my %ERRORS=('OK'=>0,'WARNING'=>1,'CRITICAL'=>2,'UNKNOWN'=>3,'DEPENDENT'=>4);
+
+--- a/install.sh
++++ b/install.sh
+@@ -12,13 +12,13 @@
+ # USAGE : ./install [ | AUTO [] ]
+ # USAGE : by default all scripts will be installed
+ #
+-# REQUIREMENTS : /bin/bash and sed
++# REQUIREMENTS : /bin/bash and sed
+ #
+-# This script will :
++# This script will:
+ # - Check perl binary (and asks for path)
+-# - Ask for nagios plugin path and checks for file "utils.pm" in it (default /usr/local/nagios/libexec)
++# - Ask for monitoring plugin path (default /usr/local/icinga/libexec)
+ # - Ask for temporary file location (default /tmp)
+-# - Check Net::SNMP version
++# - Check Net::SNMP version
+ # - Install plugins in the plugins directory and modify paths if necessary.
+
+ ############################ script list
+@@ -27,11 +27,11 @@
+
+ if [ $# -gt 0 ] ; then INSTSCRIPT=$1 ; else INSTSCRIPT="all" ; fi
+
+-if [ $INSTSCRIPT != "AUTO" ] ; then
++if [ $INSTSCRIPT != "AUTO" ] ; then
+ ############################ Manual installation
+- echo
+- echo "###### Nagios snmp scripts installer ######"
+- echo
++ echo
++ echo "###### Manubulon snmp scripts installer ######"
++ echo
+ echo "Will install $INSTSCRIPT script(s)"
+ echo
+
+@@ -41,7 +41,7 @@
+ PERLHOME=`which perl 2>&1`
+ if [ $? -ne 0 ]; then PERLHOME="" ; fi
+
+- PLUGHOME=/usr/local/nagios/libexec
++ PLUGHOME=/usr/local/icinga/libexec
+ TMPDATA=/tmp
+ ############################ Checking Perl
+
+@@ -49,24 +49,24 @@
+ read USERPERL
+ if [ "ZZ$USERPERL" != "ZZ" ]; then PERLHOME=$USERPERL ; fi
+
+- if [ "z$PERLHOME" == "z" ]; then
++ if [ "z$PERLHOME" == "z" ]; then
+ echo "Can't find perl binary... exiting"
+ echo "######### ERROR ########"
+ exit 1
+ fi
+
+ NETSNMP=`$PERLHOME -e 'if (eval "require Net::SNMP") { print "Yes" ;}'`
+- if [ $? -ne 0 ] ; then
++ if [ $? -ne 0 ] ; then
+ echo "Error while checking Net::SNMP module"
+ echo "######### ERROR ########"
+- exit 1;
++ exit 1;
+ fi
+
+ if [ "zz$NETSNMP" != "zzYes" ]; then
+ echo "Module Net::SNMP not found!"
+ echo "Install it with CPAN or manually : http://www.manubulon.com/nagios/faq.html#FAQ2"
+ echo "######### ERROR ########"
+- exit 1;
++ exit 1;
+ fi
+
+ SNMPVER=`$PERLHOME -e 'require Net::SNMP;print Net::SNMP->VERSION'`
+@@ -77,35 +77,28 @@
+ echo "Module Getopt::Long not found!"
+ echo "Install it with CPAN or manually"
+ echo "######### ERROR ########"
+- exit 1;
++ exit 1;
+ fi
+ echo "Module Getopt::Long found [OK]"
+
+- ############################ Check nagios plugin directory and utils.pm
++ ############################ Check monitoring plugin directory
+
+ echo
+- echo "What is your nagios plugin location ? "
+- echo -n "Note : file utils.pm must be present in it [$PLUGHOME] "
++ echo "What is your monitoring plugin location ? "
+ read USERPLUG
+
+ if [ "z$USERPLUG" != "z" ]; then PLUGHOME=$USERPLUG ; fi
+- if [ ! -d $PLUGHOME ] ; then
++ if [ ! -d $PLUGHOME ] ; then
+ echo "Directory $PLUGHOME does not exist !"
+ echo "######### ERROR ########"
+ exit 1
+ fi
+- if [ ! -f $PLUGHOME/utils.pm ] ; then
+- echo "File $PLUGHOME/utils.pm does not exist !"
+- echo "Install it from nagios plugins"
+- echo "######### ERROR ########"
+- exit 1
+- fi
+
+ ############################ Asking for temp directory
+
+ echo
+ echo "Where do you want the plugins to put temporary data (only used by some plugins) ? "
+- echo -n "Nagios user must be able to write files in it [$TMPDATA] "
++ echo -n "Icinga user must be able to write files in it [$TMPDATA] "
+ read USERTMP
+
+ if [ "z$USERTMP" != "z" ]; then TMPDATA=$USERTMP ; fi
+@@ -119,17 +112,11 @@
+ ############################ Looks OK, copying with changes if necessary
+
+ TRANS=""
+- # Change '#!/usr/bin/perl -w'
++ # Change '#!/usr/bin/perl -w'
+ if [ $PERLHOME != "/usr/bin/perl" ] ; then
+ TRANS="-r -e s#/usr/bin/perl#$PERLHOME#"
+ fi
+
+- # Change 'use lib "/usr/local/nagios/libexec";'
+- if [ $PLUGHOME != "/usr/local/nagios/libexec" ] ; then
+- if [ "z$TRANS" == "z" ]; then TRANS="-r -e s#/usr/local/nagios/libexec#$PLUGHOME#"
+- else TRANS="$TRANS -e s#/usr/local/nagios/libexec#$PLUGHOME#";fi
+- fi
+-
+ # Change 'my $o_base_dir="/tmp/tmp_Nagios_'
+ if [ $TMPDATA != "/tmp" ] ; then
+ if [ "z$TRANS" == "z" ]; then TRANS="-r -e s#/tmp/tmp_Nagios#$TMPDATA/tmp_Nagios#"
+@@ -143,11 +130,11 @@
+ echo "in directory : $PLUGHOME"
+ echo "perl : $PERLHOME"
+ echo "temp directory : $TMPDATA"
+- echo
++ echo
+ echo -n "OK ? [Y/n]"
+ read INSTOK
+
+- if [ "$INSTOK" == "n" ]; then
++ if [ "$INSTOK" == "n" ]; then
+ echo "Aborting....."
+ echo "######### ERROR ########"
+ exit 1
+@@ -155,24 +142,24 @@
+
+ ERROR=0
+
+- if [ $INSTSCRIPT == "all" ] ; then
++ if [ $INSTSCRIPT == "all" ] ; then
+ for i in $PLUGINS ; do
+- echo
+- if [ ! -f $i ] ; then
++ echo
++ if [ ! -f $i ] ; then
+ echo "Can't find source file $i : ##### ERROR #####"
+ else
+ echo -n "Installing $i : "
+- if [ "z$TRANS" == "z" ] ; then
++ if [ "z$TRANS" == "z" ] ; then
+ cp $i $PLUGHOME/$i 2>&1
+ else
+ sed $TRANS $i > $PLUGHOME/$i 2>&1
+ fi
+- if [ $? -ne 0 ] ; then
+- echo "##### ERROR #####";
+- rm -f $PLUGHOME/$i
++ if [ $? -ne 0 ] ; then
++ echo "##### ERROR #####";
++ rm -f $PLUGHOME/$i
+ ERROR=1
+- else
+- echo "OK"
++ else
++ echo "OK"
+ chmod 755 $PLUGHOME/$i 2>&1
+ fi
+ fi
+@@ -183,7 +170,7 @@
+ echo "Can't find source file $INSTSCRIPT : ##### ERROR #####"
+ else
+ echo -n "Installing $INSTSCRIPT : "
+- if [ "z$TRANS" == "z" ] ; then
++ if [ "z$TRANS" == "z" ] ; then
+ cp $INSTSCRIPT > $PLUGHOME/$INSTSCRIPT
+ else
+ sed $TRANS $INSTSCRIPT > $PLUGHOME/$INSTSCRIPT 2>&1
+@@ -193,10 +180,10 @@
+ rm -f $PLUGHOME/$INSTSCRIPT
+ ERROR=1
+ exit 1;
+- else
+- echo "OK"
++ else
++ echo "OK"
+ chmod 755 $PLUGHOME/$INSTSCRIPT 2>&1
+- fi
++ fi
+ fi
+ fi
+
+@@ -208,9 +195,9 @@
+
+ echo "Installation completed OK"
+ echo "You can delete all the source files and directory"
+- echo "Remember to look for informtation at http://www.manubulon.com/nagios/"
++ echo "Remember to look for informtation at http://www.manubulon.com/nagios/"
+ exit 0;
+-
++
+ else
+ ####################### Silent install with parameters ############
+ # PARAM AUTO []
+@@ -221,19 +208,13 @@
+ PLUGHOME=$2
+ TMPDATA=$3
+ INSTALLDIR=$5
+-
++
+ TRANS=""
+- # Change '#!/usr/bin/perl -w'
++ # Change '#!/usr/bin/perl -w'
+ if [ $PERLHOME != "/usr/bin/perl" ] ; then
+ TRANS="-r -e s#/usr/bin/perl#$PERLHOME#"
+ fi
+
+- # Change 'use lib "/usr/local/nagios/libexec";'
+- if [ $PLUGHOME != "/usr/local/nagios/libexec" ] ; then
+- if [ "z$TRANS" == "z" ]; then TRANS="-r -e s#/usr/local/nagios/libexec#$PLUGHOME#"
+- else TRANS="$TRANS -e s#/usr/local/nagios/libexec#$PLUGHOME#";fi
+- fi
+-
+ # Change 'my $o_base_dir="/tmp/tmp_Nagios_'
+ if [ $TMPDATA != "/tmp" ] ; then
+ if [ "z$TRANS" == "z" ]; then TRANS="-r -e s#/tmp/tmp_Nagios#$TMPDATA/tmp_Nagios#"
+@@ -246,18 +227,18 @@
+ PLUGHOME=$INSTALLDIR
+ fi
+ for i in $PLUGINS ; do
+- if [ ! -f $i ] ; then
++ if [ ! -f $i ] ; then
+ ERROR=1
+ else
+- if [ "z$TRANS" == "z" ] ; then
++ if [ "z$TRANS" == "z" ] ; then
+ cp $i $PLUGHOME/$i 2>&1
+ else
+ sed $TRANS $i > $PLUGHOME/$i 2>&1
+ fi
+- if [ $? -ne 0 ] ; then
+- rm -f $PLUGHOME/$i
++ if [ $? -ne 0 ] ; then
++ rm -f $PLUGHOME/$i
+ ERROR=1
+- else
++ else
+ chmod 755 $PLUGHOME/$i 2>&1
+ fi
+ fi
diff -Nru nagios-snmp-plugins-1.1.1/debian/patches/23_check_snmp_load_drop_debugging nagios-snmp-plugins-1.1.1/debian/patches/23_check_snmp_load_drop_debugging
--- nagios-snmp-plugins-1.1.1/debian/patches/23_check_snmp_load_drop_debugging 1970-01-01 00:00:00.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/patches/23_check_snmp_load_drop_debugging 2016-01-27 15:41:53.000000000 +0000
@@ -0,0 +1,22 @@
+From ee92d55bb36208a088a08864cc241e362134e711 Mon Sep 17 00:00:00 2001
+From: casvcasv
+Date: Thu, 3 Sep 2015 11:39:44 -0400
+Subject: [PATCH] remove print "$1 wee" from check_snmp_load, apparently used
+ to test the SNMP version fix
+
+---
+ check_snmp_load.pl | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/check_snmp_load.pl b/check_snmp_load.pl
+index d2c49e3..a2a618c 100755
+--- a/check_snmp_load.pl
++++ b/check_snmp_load.pl
+@@ -284,7 +284,6 @@ sub check_options {
+ sub is_legacy_snmp_version {
+ my $version=Net::SNMP->VERSION; #using a variable for easier testing
+ if ($version=~/^\D*(\d)/ and $1 < 4){
+- print "$1 wee";
+ return 1;
+ }else{
+ return 0;
diff -Nru nagios-snmp-plugins-1.1.1/debian/patches/24_check_snmp_int_use_ifname nagios-snmp-plugins-1.1.1/debian/patches/24_check_snmp_int_use_ifname
--- nagios-snmp-plugins-1.1.1/debian/patches/24_check_snmp_int_use_ifname 1970-01-01 00:00:00.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/patches/24_check_snmp_int_use_ifname 2016-01-27 15:41:53.000000000 +0000
@@ -0,0 +1,63 @@
+From e684d56ab83e86d037403478c7245087e17f63b7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?St=C3=A9phane=20Lapie?=
+Date: Wed, 27 Jan 2016 21:47:01 +0900
+Subject: [PATCH] Add the -N/--use-ifname option to switch name lookup from
+ ifDescr to ifName
+
+---
+ check_snmp_int.pl | 13 +++++++++++--
+ 1 file changed, 11 insertions(+), 2 deletions(-)
+
+diff --git a/check_snmp_int.pl b/check_snmp_int.pl
+index 4847fd2..a92d6d1 100755
+--- a/check_snmp_int.pl
++++ b/check_snmp_int.pl
+@@ -29,6 +29,7 @@
+ my $inter_table= '.1.3.6.1.2.1.2.2.1';
+ my $index_table = '1.3.6.1.2.1.2.2.1.1';
+ my $descr_table = '1.3.6.1.2.1.2.2.1.2';
++my $name_table = '1.3.6.1.2.1.31.1.1.1.1';
+ my $oper_table = '1.3.6.1.2.1.2.2.1.8.';
+ my $admin_table = '1.3.6.1.2.1.2.2.1.7.';
+ my $speed_table = '1.3.6.1.2.1.2.2.1.5.';
+@@ -79,6 +80,7 @@
+ my $o_meg= undef; # output in MBytes or Mbits (-M)
+ my $o_gig= undef; # output in GBytes or Gbits (-G)
+ my $o_prct= undef; # output in % of max speed (-u)
++my $o_use_ifname= undef; # use IF-MIB::ifName instead of IF-MIB::ifDescr
+
+ my $o_timeout= undef; # Timeout (Default 5)
+ # SNMP Message size parameter (Makina Corpus contrib)
+@@ -188,6 +190,8 @@ sub help {
+ Test it before, because there are known bugs (ex : trailling /)
+ -r, --noregexp
+ Do not use regexp to match NAME in description OID
++-N, --use-ifname
++ Use IF-MIB::ifName as source for NIC name instead of IF-MIB::ifDescr
+ -i, --inverse
+ Make critical when up
+ -a, --admin
+@@ -255,6 +259,7 @@ sub check_options {
+ 'H:s' => \$o_host, 'hostname:s' => \$o_host,
+ 'p:i' => \$o_port, 'port:i' => \$o_port,
+ 'n:s' => \$o_descr, 'name:s' => \$o_descr,
++ 'N' => \$o_use_ifname, 'use-ifname' => \$o_use_ifname,
+ 'C:s' => \$o_community, 'community:s' => \$o_community,
+ '2' => \$o_version2, 'v2c' => \$o_version2,
+ 'l:s' => \$o_login, 'login:s' => \$o_login,
+@@ -444,9 +449,13 @@ sub check_options {
+ verb(" new max octets:: $oct_test");
+ }
+
+-# Get desctiption table
++# Get description table
++my $query_table = $descr_table;
++if (defined($o_use_ifname)) {
++ $query_table = $name_table;
++}
+ my $resultat = $session->get_table(
+- Baseoid => $descr_table
++ Baseoid => $query_table
+ );
+
+ if (!defined($resultat)) {
diff -Nru nagios-snmp-plugins-1.1.1/debian/patches/51_fix_privacy_doc nagios-snmp-plugins-1.1.1/debian/patches/51_fix_privacy_doc
--- nagios-snmp-plugins-1.1.1/debian/patches/51_fix_privacy_doc 2014-11-02 19:45:34.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/patches/51_fix_privacy_doc 2016-01-27 15:41:53.000000000 +0000
@@ -8,8 +8,6 @@
Fix potential privacy breach of HTML documentation
-diff --git a/doc/faq.html b/doc/faq.html
-index 69c3a97..b421495 100755
--- a/doc/faq.html
+++ b/doc/faq.html
@@ -225,7 +225,7 @@
@@ -21,8 +19,6 @@
-diff --git a/doc/index.html b/doc/index.html
-index e58666b..21adf06 100755
--- a/doc/index.html
+++ b/doc/index.html
@@ -324,7 +324,7 @@
@@ -34,8 +30,6 @@
Nagios and the Nagios logo are registered
trademarks of Ethan Galstad.
-diff --git a/doc/index_commands.html b/doc/index_commands.html
-index 66bac6c..3c8f03a 100755
--- a/doc/index_commands.html
+++ b/doc/index_commands.html
@@ -109,7 +109,7 @@
@@ -56,8 +50,6 @@
-diff --git a/doc/snmp_cpfw.html b/doc/snmp_cpfw.html
-index ac84d46..89bf324 100755
--- a/doc/snmp_cpfw.html
+++ b/doc/snmp_cpfw.html
@@ -439,7 +439,7 @@
@@ -69,11 +61,9 @@
-diff --git a/doc/snmp_css.html b/doc/snmp_css.html
-index 84fe3f4..c581d85 100755
--- a/doc/snmp_css.html
+++ b/doc/snmp_css.html
-@@ -353,7 +353,7 @@ Usage: ./check_snmp_css_main.pl [-v] -H <host> -C <snmp_community> [
+@@ -353,7 +353,7 @@
This project is hosted on :
@@ -82,8 +72,6 @@
-diff --git a/doc/snmp_env.html b/doc/snmp_env.html
-index f847bd9..576d6a5 100755
--- a/doc/snmp_env.html
+++ b/doc/snmp_env.html
@@ -342,7 +342,7 @@
@@ -95,8 +83,6 @@
-diff --git a/doc/snmp_int.html b/doc/snmp_int.html
-index aac15fc..6284623 100755
--- a/doc/snmp_int.html
+++ b/doc/snmp_int.html
@@ -660,7 +660,7 @@
@@ -108,11 +94,9 @@
-diff --git a/doc/snmp_load.html b/doc/snmp_load.html
-index 0c48eb8..78697db 100755
--- a/doc/snmp_load.html
+++ b/doc/snmp_load.html
-@@ -379,7 +379,7 @@ SNMP Load & CPU Monitor for Nagios version 1.3
+@@ -379,7 +379,7 @@
This project is hosted on :
@@ -121,11 +105,9 @@
-diff --git a/doc/snmp_mem.html b/doc/snmp_mem.html
-index 1a51886..c93c185 100755
--- a/doc/snmp_mem.html
+++ b/doc/snmp_mem.html
-@@ -457,7 +457,7 @@ Usage: ./check_snmp_mem.pl [-v] -H <host> -C <snmp_community> [-2] |
+@@ -457,7 +457,7 @@
This project is hosted on :
@@ -134,8 +116,6 @@
-diff --git a/doc/snmp_process.html b/doc/snmp_process.html
-index 50c3735..4af115a 100755
--- a/doc/snmp_process.html
+++ b/doc/snmp_process.html
@@ -332,7 +332,7 @@
@@ -147,8 +127,6 @@
Nagios and the Nagios logo are registered
trademarks of Ethan Galstad.
-diff --git a/doc/snmp_storage.html b/doc/snmp_storage.html
-index 98bc5e1..14488bf 100755
--- a/doc/snmp_storage.html
+++ b/doc/snmp_storage.html
@@ -1285,7 +1285,7 @@
@@ -160,8 +138,6 @@
-diff --git a/doc/snmp_vrrp.html b/doc/snmp_vrrp.html
-index 66e37be..ca8300d 100755
--- a/doc/snmp_vrrp.html
+++ b/doc/snmp_vrrp.html
@@ -324,7 +324,7 @@
@@ -173,8 +149,6 @@
-diff --git a/doc/snmp_windows.html b/doc/snmp_windows.html
-index 4a8f513..2ae468c 100755
--- a/doc/snmp_windows.html
+++ b/doc/snmp_windows.html
@@ -243,7 +243,7 @@
diff -Nru nagios-snmp-plugins-1.1.1/debian/patches/series nagios-snmp-plugins-1.1.1/debian/patches/series
--- nagios-snmp-plugins-1.1.1/debian/patches/series 2014-11-02 19:45:34.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/patches/series 2016-01-27 15:41:53.000000000 +0000
@@ -4,5 +4,11 @@
16_perfdata
17_protocol_fam
18_check_snmp_process_tmp_file
+19_check_snmp_load_n5k
+20_check_snmp_load_multiple_cpus
+21_check_snmp_load_abstract_snmp_version_check
+22_remove_utils_pm
+23_check_snmp_load_drop_debugging
+24_check_snmp_int_use_ifname
50_disable_epn
51_fix_privacy_doc
diff -Nru nagios-snmp-plugins-1.1.1/debian/rules nagios-snmp-plugins-1.1.1/debian/rules
--- nagios-snmp-plugins-1.1.1/debian/rules 2014-11-02 19:45:34.000000000 +0000
+++ nagios-snmp-plugins-1.1.1/debian/rules 2016-01-27 15:41:53.000000000 +0000
@@ -26,7 +26,7 @@
install: build
dh_testdir
dh_testroot
- dh_clean -k
+ dh_prep
dh_installdirs
# Add here commands to install the package into debian/nagios-snmp-plugins.