From e45ee042fb2c8159908d35cbc1d108c1f1e54093 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Tue, 26 Nov 2013 22:40:57 +0100 Subject: [PATCH 1/9] Update Vcs-headers --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index fcfbe67..ab918bc 100644 --- a/debian/control +++ b/debian/control @@ -5,8 +5,8 @@ Maintainer: Debian Nagios Maintainer Group Build-Depends: debhelper (>= 5), dpatch Homepage: http://www.manubulon.com/nagios/index_snmp.html -Vcs-Browser: http://svn.debian.org/wsvn/pkg-nagios/nagios-snmp-plugins/ -Vcs-Svn: svn://svn.debian.org/pkg-nagios/nagios-snmp-plugins/trunk/ +Vcs-Browser: http://git.debian.org/?p=pkg-nagios/pkg-nagios-snmp-plugins.git +Vcs-Git: git://git.debian.org/pkg-nagios/pkg-nagios-snmp-plugins Standards-Version: 3.8.4 Package: nagios-snmp-plugins From baa90eb96d3ac332d886b99d7173c48dec6e05a3 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Fri, 17 Jan 2014 23:53:37 +0100 Subject: [PATCH 2/9] Use full binary path instead of $ macro in command definitions --- debian/README.Debian | 26 +++++++++++++------------- debian/pluginconfig/snmp_cpfw.cfg | 2 +- debian/pluginconfig/snmp_env.cfg | 6 +++--- debian/pluginconfig/snmp_int.cfg | 6 +++--- debian/pluginconfig/snmp_load.cfg | 6 +++--- debian/pluginconfig/snmp_mem.cfg | 6 +++--- debian/pluginconfig/snmp_process.cfg | 4 ++-- debian/pluginconfig/snmp_storage.cfg | 6 +++--- debian/pluginconfig/snmp_vrrp.cfg | 6 +++--- debian/pluginconfig/snmp_win.cfg | 2 +- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/debian/README.Debian b/debian/README.Debian index e5092c7..41355cc 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -50,7 +50,7 @@ nagios-snmp-plugins for Debian define command { command_name check_snmp_cpfw_v3 - command_line $USER1$/check_snmp_cpfw.pl -H $HOSTADDRESS$ $USER8$ + command_line /usr/lib/nagios/plugins/check_snmp_cpfw.pl -H $HOSTADDRESS$ $USER8$ $ARG1$ } @@ -64,13 +64,13 @@ nagios-snmp-plugins for Debian define command { command_name check_snmp_load_v1 - command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $USER7$ -T + command_line /usr/lib/nagios/plugins/check_snmp_load.pl -H $HOSTADDRESS$ $USER7$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } define command { command_name check_snmp_load_v3 - command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $USER8$ -T + command_line /usr/lib/nagios/plugins/check_snmp_load.pl -H $HOSTADDRESS$ $USER8$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } @@ -98,13 +98,13 @@ nagios-snmp-plugins for Debian define command { command_name check_snmp_int_v1 - command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ $USER7$ -n + command_line /usr/lib/nagios/plugins/check_snmp_int.pl -H $HOSTADDRESS$ $USER7$ -n $ARG1$ $ARG2$ } define command{ command_name check_snmp_int_v3 - command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ $USER8$ -n + command_line /usr/lib/nagios/plugins/check_snmp_int.pl -H $HOSTADDRESS$ $USER8$ -n $ARG1$ $ARG2$ } @@ -122,13 +122,13 @@ nagios-snmp-plugins for Debian define command { command_name check_snmp_mem_v1 - command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ $USER7$ $ARG1$ + command_line /usr/lib/nagios/plugins/check_snmp_mem.pl -H $HOSTADDRESS$ $USER7$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } define command { command_name check_snmp_mem_v3 - command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ $USER8$ $ARG1$ + command_line /usr/lib/nagios/plugins/check_snmp_mem.pl -H $HOSTADDRESS$ $USER8$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } @@ -146,7 +146,7 @@ nagios-snmp-plugins for Debian define command { command_name check_snmp_process_v1 - command_line $USER1$/check_snmp_process.pl -H $HOSTADDRESS$ $USER7$ -n + command_line /usr/lib/nagios/plugins/check_snmp_process.pl -H $HOSTADDRESS$ $USER7$ -n $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } @@ -170,13 +170,13 @@ nagios-snmp-plugins for Debian define command { command_name check_snmp_storage_v1 - command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ $USER7$ -m + command_line /usr/lib/nagios/plugins/check_snmp_storage.pl -H $HOSTADDRESS$ $USER7$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } define command { command_name check_snmp_storage_v3 - command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ $USER8$ -m + command_line /usr/lib/nagios/plugins/check_snmp_storage.pl -H $HOSTADDRESS$ $USER8$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } @@ -208,13 +208,13 @@ nagios-snmp-plugins for Debian define command { command_name check_snmp_vrrp_v1 - command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER7$ -T + command_line /usr/lib/nagios/plugins/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER7$ -T $ARG1$ -s $ARG2$ } define command { command_name check_snmp_vrrp_v3 - command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER8$ -T + command_line /usr/lib/nagios/plugins/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER8$ -T $ARG1$ -s $ARG2$ } @@ -239,7 +239,7 @@ nagios-snmp-plugins for Debian define command { command_name check_win - command_line $USER1$/check_snmp_win.pl -H $HOSTADDRESS$ $USER7$ -n + command_line /usr/lib/nagios/plugins/check_snmp_win.pl -H $HOSTADDRESS$ $USER7$ -n $ARG2$ # comment community service(s) name } diff --git a/debian/pluginconfig/snmp_cpfw.cfg b/debian/pluginconfig/snmp_cpfw.cfg index 27810ab..eb9a5a5 100644 --- a/debian/pluginconfig/snmp_cpfw.cfg +++ b/debian/pluginconfig/snmp_cpfw.cfg @@ -4,5 +4,5 @@ # 'check_snmp_cpfw_v3' command definition define command { command_name check_snmp_cpfw_v3 - command_line $USER1$/check_snmp_cpfw.pl -H $HOSTADDRESS$ $USER9$ $ARG1$ + command_line /usr/lib/nagios/plugins/check_snmp_cpfw.pl -H $HOSTADDRESS$ $USER9$ $ARG1$ } diff --git a/debian/pluginconfig/snmp_env.cfg b/debian/pluginconfig/snmp_env.cfg index 1ab7d98..edc7f01 100644 --- a/debian/pluginconfig/snmp_env.cfg +++ b/debian/pluginconfig/snmp_env.cfg @@ -4,17 +4,17 @@ # 'check_snmp_env_v1' command definition define command { command_name check_snmp_env_v1 - command_line $USER1$/check_snmp_env.pl -H $HOSTADDRESS$ -C $ARG3$ -T $ARG1$ $ARG2$ + command_line /usr/lib/nagios/plugins/check_snmp_env.pl -H $HOSTADDRESS$ -C $ARG3$ -T $ARG1$ $ARG2$ } # 'check_snmp_env_v2' command definition define command { command_name check_snmp_env_v2 - command_line $USER1$/check_snmp_env.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -T $ARG1$ $ARG2$ + command_line /usr/lib/nagios/plugins/check_snmp_env.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -T $ARG1$ $ARG2$ } # 'check_snmp_env_v3' command definition define command { command_name check_snmp_env_v3 - command_line $USER1$/check_snmp_env.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ $ARG2$ + command_line /usr/lib/nagios/plugins/check_snmp_env.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ $ARG2$ } diff --git a/debian/pluginconfig/snmp_int.cfg b/debian/pluginconfig/snmp_int.cfg index 5e0dba6..9480b34 100644 --- a/debian/pluginconfig/snmp_int.cfg +++ b/debian/pluginconfig/snmp_int.cfg @@ -4,17 +4,17 @@ # 'check_snmp_int_v1' command definition define command { command_name check_snmp_int_v1 - command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ -C $ARG3$ -n $ARG1$ -B$ARG4$ $ARG2$ + command_line /usr/lib/nagios/plugins/check_snmp_int.pl -H $HOSTADDRESS$ -C $ARG3$ -n $ARG1$ -B$ARG4$ $ARG2$ } # 'check_snmp_int_v2' command definition define command { command_name check_snmp_int_v2 - command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -n $ARG1$ -B$ARG4$ $ARG2$ + command_line /usr/lib/nagios/plugins/check_snmp_int.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -n $ARG1$ -B$ARG4$ $ARG2$ } # 'check_snmp_int_v3' command definition define command { command_name check_snmp_int_v3 - command_line $USER1$/check_snmp_int.pl -H $HOSTADDRESS$ $USER9$ -n $ARG1$ -B$ARG4$ $ARG2$ + command_line /usr/lib/nagios/plugins/check_snmp_int.pl -H $HOSTADDRESS$ $USER9$ -n $ARG1$ -B$ARG4$ $ARG2$ } diff --git a/debian/pluginconfig/snmp_load.cfg b/debian/pluginconfig/snmp_load.cfg index f291d07..e3ddd55 100644 --- a/debian/pluginconfig/snmp_load.cfg +++ b/debian/pluginconfig/snmp_load.cfg @@ -4,17 +4,17 @@ # 'check_snmp_load_v1' command definition define command { command_name check_snmp_load_v1 - command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C $ARG5$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + command_line /usr/lib/nagios/plugins/check_snmp_load.pl -H $HOSTADDRESS$ -C $ARG5$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } # 'check_snmp_load_v2' command definition define command { command_name check_snmp_load_v2 - command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + command_line /usr/lib/nagios/plugins/check_snmp_load.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } # 'check_snmp_load_v3' command definition define command { command_name check_snmp_load_v3 - command_line $USER1$/check_snmp_load.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + command_line /usr/lib/nagios/plugins/check_snmp_load.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } diff --git a/debian/pluginconfig/snmp_mem.cfg b/debian/pluginconfig/snmp_mem.cfg index 8fb3f29..29c9c6d 100644 --- a/debian/pluginconfig/snmp_mem.cfg +++ b/debian/pluginconfig/snmp_mem.cfg @@ -4,17 +4,17 @@ # 'check_snmp_mem_v1' command definition define command { command_name check_snmp_mem_v1 - command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ -C $ARG5$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + command_line /usr/lib/nagios/plugins/check_snmp_mem.pl -H $HOSTADDRESS$ -C $ARG5$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } # 'check_snmp_mem_v2' command definition define command { command_name check_snmp_mem_v2 - command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ -C $ARG5$ -2 $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + command_line /usr/lib/nagios/plugins/check_snmp_mem.pl -H $HOSTADDRESS$ -C $ARG5$ -2 $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } # 'check_snmp_mem_v3' command definition define command { command_name check_snmp_mem_v3 - command_line $USER1$/check_snmp_mem.pl -H $HOSTADDRESS$ $USER9$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + command_line /usr/lib/nagios/plugins/check_snmp_mem.pl -H $HOSTADDRESS$ $USER9$ $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } diff --git a/debian/pluginconfig/snmp_process.cfg b/debian/pluginconfig/snmp_process.cfg index 1ce43e7..4692462 100644 --- a/debian/pluginconfig/snmp_process.cfg +++ b/debian/pluginconfig/snmp_process.cfg @@ -4,12 +4,12 @@ # 'check_snmp_process_v1' command definition define command { command_name check_snmp_process_v1 - command_line $USER1$/check_snmp_process.pl -H $HOSTADDRESS$ -C $ARG5$ -n $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + command_line /usr/lib/nagios/plugins/check_snmp_process.pl -H $HOSTADDRESS$ -C $ARG5$ -n $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } # 'check_snmp_process_v2' command definition define command { command_name check_snmp_process_v2 - command_line $USER1$/check_snmp_process.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -n $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + command_line /usr/lib/nagios/plugins/check_snmp_process.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -n $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } diff --git a/debian/pluginconfig/snmp_storage.cfg b/debian/pluginconfig/snmp_storage.cfg index e3df174..7d12b84 100644 --- a/debian/pluginconfig/snmp_storage.cfg +++ b/debian/pluginconfig/snmp_storage.cfg @@ -4,17 +4,17 @@ # 'check_snmp_storage_v1' command definition define command { command_name check_snmp_storage_v1 - command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $ARG5$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + command_line /usr/lib/nagios/plugins/check_snmp_storage.pl -H $HOSTADDRESS$ -C $ARG5$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } # 'check_snmp_storage_v2' command definition define command { command_name check_snmp_storage_v2 - command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + command_line /usr/lib/nagios/plugins/check_snmp_storage.pl -H $HOSTADDRESS$ -C $ARG5$ -2 -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } # 'check_snmp_storage_v3' command definition define command { command_name check_snmp_storage_v3 - command_line $USER1$/check_snmp_storage.pl -H $HOSTADDRESS$ $USER9$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ + command_line /usr/lib/nagios/plugins/check_snmp_storage.pl -H $HOSTADDRESS$ $USER9$ -m $ARG1$ -w $ARG2$ -c $ARG3$ $ARG4$ } diff --git a/debian/pluginconfig/snmp_vrrp.cfg b/debian/pluginconfig/snmp_vrrp.cfg index fb5d5c3..be5ae2c 100644 --- a/debian/pluginconfig/snmp_vrrp.cfg +++ b/debian/pluginconfig/snmp_vrrp.cfg @@ -4,17 +4,17 @@ # 'check_snmp_vrrp_v1' command definition define command { command_name check_snmp_vrrp_v1 - command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ -C $ARG3$ -T $ARG1$ -s $ARG2$ + command_line /usr/lib/nagios/plugins/check_snmp_vrrp.pl -H $HOSTADDRESS$ -C $ARG3$ -T $ARG1$ -s $ARG2$ } # 'check_snmp_vrrp_v2' command definition define command { command_name check_snmp_vrrp_v2 - command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -T $ARG1$ -s $ARG2$ + command_line /usr/lib/nagios/plugins/check_snmp_vrrp.pl -H $HOSTADDRESS$ -C $ARG3$ -2 -T $ARG1$ -s $ARG2$ } # 'check_snmp_vrrp_v3' command definition define command { command_name check_snmp_vrrp_v3 - command_line $USER1$/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ -s $ARG2$ + command_line /usr/lib/nagios/plugins/check_snmp_vrrp.pl -H $HOSTADDRESS$ $USER9$ -T $ARG1$ -s $ARG2$ } diff --git a/debian/pluginconfig/snmp_win.cfg b/debian/pluginconfig/snmp_win.cfg index 53fdf84..590da52 100644 --- a/debian/pluginconfig/snmp_win.cfg +++ b/debian/pluginconfig/snmp_win.cfg @@ -4,5 +4,5 @@ # 'check_win' command definition define command { command_name check_win - command_line $USER1$/check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG3$ -n $ARG2$ + command_line /usr/lib/nagios/plugins/check_snmp_win.pl -H $HOSTADDRESS$ -C $ARG3$ -n $ARG2$ } From 258eb2eb89e4592a3c86a21f49bc35cc7a3f5067 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Sat, 18 Jan 2014 00:19:18 +0100 Subject: [PATCH 3/9] check_snmp_storage: Add 64bit support --- debian/patches/00list | 1 + .../15_check_snmp_storage_64bit.dpatch | 168 ++++++++++++++++++ 2 files changed, 169 insertions(+) create mode 100644 debian/patches/15_check_snmp_storage_64bit.dpatch diff --git a/debian/patches/00list b/debian/patches/00list index 8da50ff..da00a76 100644 --- a/debian/patches/00list +++ b/debian/patches/00list @@ -5,4 +5,5 @@ 05_check_snmp_storage.dpatch 06_check_snmp_win.dpatch 10_fix_net_snmp_version.dpatch +15_check_snmp_storage_64bit.dpatch 50_disable_epn.dpatch diff --git a/debian/patches/15_check_snmp_storage_64bit.dpatch b/debian/patches/15_check_snmp_storage_64bit.dpatch new file mode 100644 index 0000000..e83c089 --- /dev/null +++ b/debian/patches/15_check_snmp_storage_64bit.dpatch @@ -0,0 +1,168 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 15_check_snmp_storage_64bit by Martin Fürstenau +## +## DP: Fixing Net::SNMP version +## DP: (see https://wiki.icinga.org/display/howtos/check_snmp#checksnmp-Argumentv601isntnumericinnumericlt) + +## @DPATCH@ +## From 144c57a0adda190000bef500f3274425cb90d6ba Mon Sep 17 00:00:00 2001 +## From: Michael Friedrich +## Date: Wed, 26 Sep 2012 16:32:40 +0200 +## Subject: [PATCH] =?UTF-8?q?apply=20check=5Fsnmp=5Fstorage=20patch=20and=20?= +## =?UTF-8?q?1.3.3=20from=20Martin=20F=C3=BCrstenau?= +## MIME-Version: 1.0 +## Content-Type: text/plain; charset=UTF-8 +## Content-Transfer-Encoding: 8bit +## +## http://www.monitoring-portal.org/wbb/index.php?page=Thread&threadID=12031 +--- + plugins/check_snmp_storage.pl | 54 ++++++++++++++++++++++++++++--------------- + 1 file changed, 36 insertions(+), 18 deletions(-) + +@DPATCH@ + +diff --git a/plugins/check_snmp_storage.pl b/plugins/check_snmp_storage.pl +index 1b8a398..a3c784f 100644 +--- a/plugins/check_snmp_storage.pl ++++ b/plugins/check_snmp_storage.pl +@@ -6,7 +6,7 @@ + # Help : http://nagios.manubulon.com + # Licence : GPL - http://www.fsf.org/licenses/gpl.txt + # TODO : +-# Contribs : Dimo Velev, Makina Corpus, A. Greiner-Bär ++# Contribs : Dimo Velev, Makina Corpus, A. Greiner-B\ufffdr + ################################################################# + # + # help : ./check_snmp_storage -h +@@ -80,7 +80,7 @@ + my $o_perf= undef; # Output performance data + my $o_short= undef; # Short output parameters + my @o_shortL= undef; # output type,where,cut +-my $o_reserve= 0; # % reserved blocks (A. Greiner-Bär patch) ++my $o_reserve= 0; # % reserved blocks (A. Greiner-B\ufffdr patch) + my $o_giga= undef; # output and levels in gigabytes instead of megabytes + # SNMPv3 specific + my $o_login= undef; # Login for snmpv3 +@@ -89,6 +89,7 @@ + my $o_authproto='md5'; # Auth protocol + my $o_privproto='des'; # Priv protocol + my $o_privpass= undef; # priv password ++my $UOM_float= 4; # decimal places + # SNMP Message size parameter (Makina Corpus contrib) + my $o_octetlength=undef; + +@@ -112,8 +113,10 @@ sub is_pattern_valid { # Test for things like "" or "+5-i" + + # Get the alarm signal (just in case snmp timout screws up) + $SIG{'ALRM'} = sub { +- print ("ERROR: General time-out (Alarm signal)\n"); +- exit $ERRORS{"UNKNOWN"}; ++# print ("ERROR: General time-out (Alarm signal)\n"); ++# exit $ERRORS{"UNKNOWN"}; ++ print ("Waiting for info\n"); ++ exit $ERRORS{"OK"}; + }; + + sub isnnum { # Return true if arg is not a number +@@ -315,7 +318,7 @@ sub check_options { + if (defined ($o_octetlength) && (isnnum($o_octetlength) || $o_octetlength > 65535 || $o_octetlength < 484 )) { + print "octet lenght must be < 65535 and > 484\n";print_usage(); exit $ERRORS{"UNKNOWN"}; + } +- #### reserved blocks checks (A. Greiner-Bär patch). ++ #### reserved blocks checks (A. Greiner-B\ufffdr patch). + if (defined ($o_reserve) && (isnnum($o_reserve) || $o_reserve > 99 || $o_reserve < 0 )) { + print "reserved blocks must be < 100 and >= 0\n";print_usage(); exit $ERRORS{"UNKNOWN"}; + } +@@ -348,6 +351,7 @@ sub check_options { + -authpassword => $o_passwd, + -authprotocol => $o_authproto, + -port => $o_port, ++ -retries => 10, + -timeout => $o_timeout + ); + } else { +@@ -361,6 +365,7 @@ sub check_options { + -privpassword => $o_privpass, + -privprotocol => $o_privproto, + -port => $o_port, ++ -retries => 10, + -timeout => $o_timeout + ); + } +@@ -373,6 +378,7 @@ sub check_options { + -version => 2, + -community => $o_community, + -port => $o_port, ++ -retries => 10, + -timeout => $o_timeout + ); + } else { +@@ -382,6 +388,7 @@ sub check_options { + -hostname => $o_host, + -community => $o_community, + -port => $o_port, ++ -retries => 10, + -timeout => $o_timeout + ); + } +@@ -491,18 +498,28 @@ sub check_options { + + my $result=undef; + +-if (Net::SNMP->VERSION lt 4) { +- $result = $session->get_request(@oids); +-} else { +- if ($session->version == 0) { +- # snmpv1 +- $result = $session->get_request(Varbindlist => \@oids); +- } else { +- # snmp v2c or v3 : get_bulk_request is not really good for this, so do simple get +- $result = $session->get_request(Varbindlist => \@oids); +- foreach my $key ( keys %$result) { verb("$key : $$result{$key}"); } +- } +-} ++if (Net::SNMP->VERSION lt 4) ++ { ++ $result = $session->get_request(@oids); ++ } ++else ++ { ++ $result = $session->get_request(Varbindlist => \@oids); ++ foreach my $key ( keys %$result) ++ { ++ # Fix for filesystems larger 2 TB. More than 2 TB will cause an error because ++ # as defined in the RFC hrStorageSize is a 32 bit integer. So filesystems ++ # larger 2 TB report a negative value because the first bit will be interpreted ++ # as an algebraic sign. (0 = +, all others will be -). You simply have to add ++ # 2 to the power of 32 (4294967296) and it is fixed. ++ # Martin Fuerstenau, Oce Printing Systems, 25th Sept 2012 ++ if ($$result{$key} < 0) ++ { ++ $$result{$key} = $$result{$key} + 4294967296; ++ } ++ verb("$key x $$result{$key}"); ++ } ++ } + + if (!defined($result)) { printf("ERROR: Size table :%s.\n", $session->error); $session->close; + exit $ERRORS{"UNKNOWN"}; +@@ -547,6 +564,7 @@ sub check_options { + verb("Size : $$result{$size_table . $tindex[$i]}"); + verb("Used : $$result{$used_table . $tindex[$i]}"); + verb("Alloc : $$result{$alloc_units . $tindex[$i]}"); ++ + if (!defined($$result{$size_table . $tindex[$i]}) || + !defined($$result{$used_table . $tindex[$i]}) || + !defined ($$result{$alloc_units . $tindex[$i]})) { +@@ -623,7 +641,7 @@ sub check_options { + } + } + # Performance output (in MB) +- $perf_out .= "'".$Pdescr. "'=" . round($bu,0) . $output_metric ."B;" . round($p_warn,0) ++ $perf_out .= "'".$Pdescr. "'=" . round($bu,$UOM_float) . $output_metric ."B;" . round($p_warn,0) + . ";" . round($p_crit,0) . ";0;" . round($to,0); + } + +-- +1.8.5.1 + From 1dfc537f8a1a415add0b09226a978df8de92507b Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Wed, 19 Feb 2014 22:35:36 +0100 Subject: [PATCH 4/9] Convert the package to source format 3.0 (quilt) --- debian/control | 2 +- debian/patches/00list | 9 --------- .../{01_check_snmp_env.dpatch => 01_check_snmp_env} | 5 +---- .../{02_check_snmp_int.dpatch => 02_check_snmp_int} | 5 +---- .../{03_check_snmp_load.dpatch => 03_check_snmp_load} | 5 +---- ...4_check_snmp_process.dpatch => 04_check_snmp_process} | 5 +---- ...5_check_snmp_storage.dpatch => 05_check_snmp_storage} | 5 +---- .../{06_check_snmp_win.dpatch => 06_check_snmp_win} | 5 +---- ...x_net_snmp_version.dpatch => 10_fix_net_snmp_version} | 4 +--- ..._storage_64bit.dpatch => 15_check_snmp_storage_64bit} | 4 ---- debian/patches/{50_disable_epn.dpatch => 50_disable_epn} | 5 +---- debian/patches/series | 9 +++++++++ debian/rules | 6 ++---- debian/source/format | 2 +- 14 files changed, 21 insertions(+), 50 deletions(-) delete mode 100644 debian/patches/00list rename debian/patches/{01_check_snmp_env.dpatch => 01_check_snmp_env} (97%) rename debian/patches/{02_check_snmp_int.dpatch => 02_check_snmp_int} (99%) rename debian/patches/{03_check_snmp_load.dpatch => 03_check_snmp_load} (92%) rename debian/patches/{04_check_snmp_process.dpatch => 04_check_snmp_process} (98%) rename debian/patches/{05_check_snmp_storage.dpatch => 05_check_snmp_storage} (98%) rename debian/patches/{06_check_snmp_win.dpatch => 06_check_snmp_win} (94%) rename debian/patches/{10_fix_net_snmp_version.dpatch => 10_fix_net_snmp_version} (99%) rename debian/patches/{15_check_snmp_storage_64bit.dpatch => 15_check_snmp_storage_64bit} (99%) rename debian/patches/{50_disable_epn.dpatch => 50_disable_epn} (98%) create mode 100644 debian/patches/series diff --git a/debian/control b/debian/control index ab918bc..37526c6 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Section: net Priority: optional Maintainer: Debian Nagios Maintainer Group Uploaders: Jan Wagner -Build-Depends: debhelper (>= 5), dpatch +Build-Depends: debhelper (>= 5) Homepage: http://www.manubulon.com/nagios/index_snmp.html Vcs-Browser: http://git.debian.org/?p=pkg-nagios/pkg-nagios-snmp-plugins.git Vcs-Git: git://git.debian.org/pkg-nagios/pkg-nagios-snmp-plugins diff --git a/debian/patches/00list b/debian/patches/00list deleted file mode 100644 index da00a76..0000000 --- a/debian/patches/00list +++ /dev/null @@ -1,9 +0,0 @@ -01_check_snmp_env.dpatch -02_check_snmp_int.dpatch -03_check_snmp_load.dpatch -04_check_snmp_process.dpatch -05_check_snmp_storage.dpatch -06_check_snmp_win.dpatch -10_fix_net_snmp_version.dpatch -15_check_snmp_storage_64bit.dpatch -50_disable_epn.dpatch diff --git a/debian/patches/01_check_snmp_env.dpatch b/debian/patches/01_check_snmp_env similarity index 97% rename from debian/patches/01_check_snmp_env.dpatch rename to debian/patches/01_check_snmp_env index 9fcd9f6..c093cf8 100644 --- a/debian/patches/01_check_snmp_env.dpatch +++ b/debian/patches/01_check_snmp_env @@ -1,10 +1,7 @@ -#!/bin/sh /usr/share/dpatch/dpatch-run -## 01_check_snmp_env.dpatch by Jan Wagner +## 01_check_snmp_env by Jan Wagner ## ## DP: Fix some issues via cvs version -@DPATCH@ - --- old/check_snmp_env.pl 2007-07-04 09:46:55.000000000 +0200 +++ new/check_snmp_env.pl 2007-07-06 22:17:06.000000000 +0200 @@ -1,7 +1,7 @@ diff --git a/debian/patches/02_check_snmp_int.dpatch b/debian/patches/02_check_snmp_int similarity index 99% rename from debian/patches/02_check_snmp_int.dpatch rename to debian/patches/02_check_snmp_int index 964478d..3ef2053 100644 --- a/debian/patches/02_check_snmp_int.dpatch +++ b/debian/patches/02_check_snmp_int @@ -1,10 +1,7 @@ -#!/bin/sh /usr/share/dpatch/dpatch-run -## 02_check_snmp_int.dpatch by Jan Wagner +## 02_check_snmp_int by Jan Wagner ## ## DP: Update script to version 1.24 -@DPATCH@ - diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_int.pl nagios-snmp-plugins-1.1.1/check_snmp_int.pl --- nagios-snmp-plugins-1.1.1.orig/check_snmp_int.pl 2007-04-23 11:40:39.000000000 +0200 diff --git a/debian/patches/03_check_snmp_load.dpatch b/debian/patches/03_check_snmp_load similarity index 92% rename from debian/patches/03_check_snmp_load.dpatch rename to debian/patches/03_check_snmp_load index e0dc967..9539b73 100644 --- a/debian/patches/03_check_snmp_load.dpatch +++ b/debian/patches/03_check_snmp_load @@ -1,10 +1,7 @@ -#!/bin/sh /usr/share/dpatch/dpatch-run -## 03_check_snmp_load.dpatch by Jan Wagner +## 03_check_snmp_load by Jan Wagner ## ## DP: Update script to version 1.12 -@DPATCH@ - diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_load.pl nagios-snmp-plugins-1.1.1/check_snmp_load.pl --- nagios-snmp-plugins-1.1.1.orig/check_snmp_load.pl 2007-04-16 19:41:20.000000000 +0200 +++ nagios-snmp-plugins-1.1.1/check_snmp_load.pl 2007-10-12 22:23:23.000000000 +0200 diff --git a/debian/patches/04_check_snmp_process.dpatch b/debian/patches/04_check_snmp_process similarity index 98% rename from debian/patches/04_check_snmp_process.dpatch rename to debian/patches/04_check_snmp_process index 858421a..4476752 100644 --- a/debian/patches/04_check_snmp_process.dpatch +++ b/debian/patches/04_check_snmp_process @@ -1,10 +1,7 @@ -#!/bin/sh /usr/share/dpatch/dpatch-run -## 04_check_snmp_process.dpatch by Jan Wagner +## 04_check_snmp_process by Jan Wagner ## ## DP: Update script to version 1.10 -@DPATCH@ - diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_process.pl nagios-snmp-plugins-1.1.1/check_snmp_process.pl --- nagios-snmp-plugins-1.1.1.orig/check_snmp_process.pl 2007-03-12 21:36:02.000000000 +0100 +++ nagios-snmp-plugins-1.1.1/check_snmp_process.pl 2007-10-12 22:23:24.000000000 +0200 diff --git a/debian/patches/05_check_snmp_storage.dpatch b/debian/patches/05_check_snmp_storage similarity index 98% rename from debian/patches/05_check_snmp_storage.dpatch rename to debian/patches/05_check_snmp_storage index 99f8208..c7c675d 100644 --- a/debian/patches/05_check_snmp_storage.dpatch +++ b/debian/patches/05_check_snmp_storage @@ -1,10 +1,7 @@ -#!/bin/sh /usr/share/dpatch/dpatch-run -## 05_check_snmp_storage.dpatch by Jan Wagner +## 05_check_snmp_storage by Jan Wagner ## ## DP: Update script to version 1.3.3 -@DPATCH@ - diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_storage.pl nagios-snmp-plugins-1.1.1/check_snmp_storage.pl --- nagios-snmp-plugins-1.1.1.orig/check_snmp_storage.pl 2007-03-12 22:01:36.000000000 +0100 +++ nagios-snmp-plugins-1.1.1/check_snmp_storage.pl 2007-10-12 22:23:24.000000000 +0200 diff --git a/debian/patches/06_check_snmp_win.dpatch b/debian/patches/06_check_snmp_win similarity index 94% rename from debian/patches/06_check_snmp_win.dpatch rename to debian/patches/06_check_snmp_win index bee1eed..01a721a 100644 --- a/debian/patches/06_check_snmp_win.dpatch +++ b/debian/patches/06_check_snmp_win @@ -1,10 +1,7 @@ -#!/bin/sh /usr/share/dpatch/dpatch-run -## 06_check_snmp_win.dpatch by Jan Wagner +## 06_check_snmp_win by Jan Wagner ## ## DP: Update script to version 1.1 -@DPATCH@ - diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_win.pl nagios-snmp-plugins-1.1.1/check_snmp_win.pl --- nagios-snmp-plugins-1.1.1.orig/check_snmp_win.pl 2006-11-29 20:59:55.000000000 +0100 +++ nagios-snmp-plugins-1.1.1/check_snmp_win.pl 2007-10-12 22:23:25.000000000 +0200 diff --git a/debian/patches/10_fix_net_snmp_version.dpatch b/debian/patches/10_fix_net_snmp_version similarity index 99% rename from debian/patches/10_fix_net_snmp_version.dpatch rename to debian/patches/10_fix_net_snmp_version index 83a5304..c8cb20c 100755 --- a/debian/patches/10_fix_net_snmp_version.dpatch +++ b/debian/patches/10_fix_net_snmp_version @@ -1,10 +1,8 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run -## 10_fix_net_snmp_version.dpatch by Jan Wagner +## 10_fix_net_snmp_version by Jan Wagner ## ## DP: Fixing Net::SNMP version ## DP: (see https://wiki.icinga.org/display/howtos/check_snmp#checksnmp-Argumentv601isntnumericinnumericlt) -@DPATCH@ diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nagios-snmp-plugins-1.1.1~/check_snmp_boostedge.pl nagios-snmp-plugins-1.1.1/check_snmp_boostedge.pl --- nagios-snmp-plugins-1.1.1~/check_snmp_boostedge.pl 2007-01-16 23:57:14.000000000 +0100 +++ nagios-snmp-plugins-1.1.1/check_snmp_boostedge.pl 2013-01-31 08:38:55.000000000 +0100 diff --git a/debian/patches/15_check_snmp_storage_64bit.dpatch b/debian/patches/15_check_snmp_storage_64bit similarity index 99% rename from debian/patches/15_check_snmp_storage_64bit.dpatch rename to debian/patches/15_check_snmp_storage_64bit index e83c089..aaa291a 100644 --- a/debian/patches/15_check_snmp_storage_64bit.dpatch +++ b/debian/patches/15_check_snmp_storage_64bit @@ -1,10 +1,8 @@ -#! /bin/sh /usr/share/dpatch/dpatch-run ## 15_check_snmp_storage_64bit by Martin Fürstenau ## ## DP: Fixing Net::SNMP version ## DP: (see https://wiki.icinga.org/display/howtos/check_snmp#checksnmp-Argumentv601isntnumericinnumericlt) -## @DPATCH@ ## From 144c57a0adda190000bef500f3274425cb90d6ba Mon Sep 17 00:00:00 2001 ## From: Michael Friedrich ## Date: Wed, 26 Sep 2012 16:32:40 +0200 @@ -19,8 +17,6 @@ plugins/check_snmp_storage.pl | 54 ++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 18 deletions(-) -@DPATCH@ - diff --git a/plugins/check_snmp_storage.pl b/plugins/check_snmp_storage.pl index 1b8a398..a3c784f 100644 --- a/plugins/check_snmp_storage.pl diff --git a/debian/patches/50_disable_epn.dpatch b/debian/patches/50_disable_epn similarity index 98% rename from debian/patches/50_disable_epn.dpatch rename to debian/patches/50_disable_epn index 1c504fd..5cec8b8 100644 --- a/debian/patches/50_disable_epn.dpatch +++ b/debian/patches/50_disable_epn @@ -1,10 +1,7 @@ -#!/bin/sh /usr/share/dpatch/dpatch-run -## 50_disable_epn.dpatch by Jan Wagner +## 50_disable_epn by Jan Wagner ## ## DP: leave marks to disable epn -@DPATCH@ - diff -Nur nagios-snmp-plugins-1.1.1.orig/check_snmp_boostedge.pl nagios-snmp-plugins-1.1.1/check_snmp_boostedge.pl --- nagios-snmp-plugins-1.1.1.orig/check_snmp_boostedge.pl 2007-01-16 23:57:14.000000000 +0100 +++ nagios-snmp-plugins-1.1.1/check_snmp_boostedge.pl 2008-05-23 14:09:04.000000000 +0200 diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..919403b --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,9 @@ +01_check_snmp_env +02_check_snmp_int +03_check_snmp_load +04_check_snmp_process +05_check_snmp_storage +06_check_snmp_win +10_fix_net_snmp_version +15_check_snmp_storage_64bit +50_disable_epn diff --git a/debian/rules b/debian/rules index c5fdedd..6e83254 100755 --- a/debian/rules +++ b/debian/rules @@ -3,8 +3,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -include /usr/share/dpatch/dpatch.make - COMMANDDEFPATH:=/etc/nagios-plugins/config/ NP_DIR:=debian/nagios-snmp-plugins NP_TEMPLATES:=$(NP_DIR)/usr/share/nagios-snmp-plugins/pluginconfig @@ -13,9 +11,9 @@ NP_LIBEXEC:=/usr/lib/nagios/plugins plugin_cfgs:=snmp_cpfw snmp_env snmp_int snmp_load snmp_mem snmp_process \ snmp_storage snmp_vrrp snmp_win -build: patch-stamp +build: -clean: unpatch +clean: dh_testdir dh_testroot diff --git a/debian/source/format b/debian/source/format index d3827e7..163aaf8 100644 --- a/debian/source/format +++ b/debian/source/format @@ -1 +1 @@ -1.0 +3.0 (quilt) From 09c4c1b92b30cf8c7709888541c35959fa213343 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Wed, 19 Feb 2014 22:40:41 +0100 Subject: [PATCH 5/9] Fix 15_check_snmp_storage_64bit --- debian/patches/15_check_snmp_storage_64bit | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/patches/15_check_snmp_storage_64bit b/debian/patches/15_check_snmp_storage_64bit index aaa291a..4fbb0d7 100644 --- a/debian/patches/15_check_snmp_storage_64bit +++ b/debian/patches/15_check_snmp_storage_64bit @@ -14,13 +14,13 @@ ## ## http://www.monitoring-portal.org/wbb/index.php?page=Thread&threadID=12031 --- - plugins/check_snmp_storage.pl | 54 ++++++++++++++++++++++++++++--------------- + check_snmp_storage.pl | 54 ++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 18 deletions(-) -diff --git a/plugins/check_snmp_storage.pl b/plugins/check_snmp_storage.pl +diff --git a/check_snmp_storage.pl b/check_snmp_storage.pl index 1b8a398..a3c784f 100644 ---- a/plugins/check_snmp_storage.pl -+++ b/plugins/check_snmp_storage.pl +--- a/check_snmp_storage.pl ++++ b/check_snmp_storage.pl @@ -6,7 +6,7 @@ # Help : http://nagios.manubulon.com # Licence : GPL - http://www.fsf.org/licenses/gpl.txt From 1bb96e11dd202201ca5635217351912e53995337 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Thu, 13 Feb 2014 22:43:33 +0100 Subject: [PATCH 6/9] Add travis-ci config --- .travis.yml | 15 +++++++++++++++ debian/source/options | 1 + 2 files changed, 16 insertions(+) create mode 100644 .travis.yml create mode 100644 debian/source/options diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..52fa260 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: c + +install: + - sudo apt-get update -qq + - sudo apt-get install -qq --no-install-recommends devscripts libwww-perl + - uscan --force-download + - sudo apt-get purge -qq libwww-perl + - sudo apt-get autoremove -qq + - sudo apt-get install -qq --no-install-recommends debhelper dpatch + +script: + - debuild -uc -us + +#notifications: +# email: false diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..a729099 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +extend-diff-ignore = '^\.travis' From b8ad984e16d5dd94d70ad76bf8cadf0fbc7ac156 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Sun, 16 Feb 2014 23:10:52 +0100 Subject: [PATCH 7/9] Reorder and comment .travis.yml --- .travis.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 52fa260..08d63ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,22 @@ language: c -install: +before_install: + # update package list - sudo apt-get update -qq + # installneeded packages for uscan - sudo apt-get install -qq --no-install-recommends devscripts libwww-perl + # download original tarball - uscan --force-download + # remove packages needed for uscan - sudo apt-get purge -qq libwww-perl - sudo apt-get autoremove -qq + +install: + # install build dependencies - sudo apt-get install -qq --no-install-recommends debhelper dpatch script: + # build the debian package - debuild -uc -us #notifications: From 95479b578fb8c47116a8c86e6cb4c629c9e46dbc Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Sun, 16 Feb 2014 23:21:16 +0100 Subject: [PATCH 8/9] update git ignore regex --- debian/source/options | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/source/options b/debian/source/options index a729099..f9deab5 100644 --- a/debian/source/options +++ b/debian/source/options @@ -1 +1 @@ -extend-diff-ignore = '^\.travis' +extend-diff-ignore = '(^|/)(\.travis\.yml|\.git|\.gitgnore|config\.sub|config\.guess)$' From be2cd6ae28e0dcf2b1d5372a31a41a5ddb4ee11a Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Tue, 25 Feb 2014 14:06:22 +0100 Subject: [PATCH 9/9] Add lintian checks after build --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 08d63ff..f0db5e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,5 +19,9 @@ script: # build the debian package - debuild -uc -us +after_script: + # run lintian after build + - sudo apt-get install -qq --no-install-recommends lintian + - lintian --info --display-info --display-experimental --pedantic --show-overrides ../*.deb && lintian --info --display-info --display-experimental --pedantic --show-overrides ../*.dsc #notifications: # email: false