diff -Nru nagios-snmp-plugins-2.1.0/debian/changelog nagios-snmp-plugins-2.1.0/debian/changelog --- nagios-snmp-plugins-2.1.0/debian/changelog 2019-01-23 19:44:01.000000000 +0000 +++ nagios-snmp-plugins-2.1.0/debian/changelog 2020-12-07 14:50:39.000000000 +0000 @@ -1,3 +1,42 @@ +nagios-snmp-plugins (2.1.0-2) unstable; urgency=medium + + [ Debian Janitor ] + * Use secure copyright file specification URI. + * debian/copyright: use spaces rather than tabs to start continuation + lines. + * Bump debhelper from deprecated 5 to 12. (Closes: #965745) + * Set debhelper-compat version in Build-Depends. + * Update standards version to 4.5.0, no changes needed. + + [ Jan Wagner ] + * [a75e780] Removing .travis.yml and adding .gitlab-ci.yml + + [ Bas Couwenberg ] + * [e989ff9] Bump watch file version to 4. + * [b345ea5] Bump Standards-Version to 4.5.1, no changes. + + [ Jan Wagner ] + * [a815051] check_snmp_int.pl: added ign-admindown, ign-emptyalias options. + fixed unitialized variable warning by adding d/p/14_check_snmp_int_ign + from upstream + * [c1ffe3e] check_snmp_int.pl: Add spaces only if necessary by adding + d/p/15_check_snmp_int_spaces from upstream + * [ef233ba] check_snmp_win.pl: Add -o option (max message size) by adding + d/p/16_check_snmp_win_max_message_size from upstream + * [085ba7e] check_snmp_storage.pl: add support for allowing considering OK if + no storage found matching given criteria by adding + d/p/17_check_snmp_storage_okifempty from upstream + * [84561d3] check_snmp_int.pl: fix perf_out not defined error by adding + d/p/18_check_snmp_int_fix_perf_out + * [45b2b11] d/control: Updating upstream to + https://github.com/SteScho/manubulon-snmp + * [f9bf220] d/watch: Updating upstream to + https://github.com/SteScho/manubulon-snmp + * [8f6cd11] Refreshing patches + * [c1f1d25] d/copyright: Removing tabs + + -- Jan Wagner Mon, 07 Dec 2020 15:50:39 +0100 + nagios-snmp-plugins (2.1.0-1) unstable; urgency=medium [ Jan Wagner ] diff -Nru nagios-snmp-plugins-2.1.0/debian/compat nagios-snmp-plugins-2.1.0/debian/compat --- nagios-snmp-plugins-2.1.0/debian/compat 2019-01-23 19:44:01.000000000 +0000 +++ nagios-snmp-plugins-2.1.0/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -5 diff -Nru nagios-snmp-plugins-2.1.0/debian/control nagios-snmp-plugins-2.1.0/debian/control --- nagios-snmp-plugins-2.1.0/debian/control 2019-01-23 19:44:01.000000000 +0000 +++ nagios-snmp-plugins-2.1.0/debian/control 2020-12-07 14:50:39.000000000 +0000 @@ -3,11 +3,11 @@ Priority: optional Maintainer: Debian Nagios Maintainer Group Uploaders: Jan Wagner -Build-Depends: debhelper (>= 5) -Homepage: https://github.com/dnsmichi/manubulon-snmp +Build-Depends: debhelper-compat (= 12) +Homepage: https://github.com/SteScho/manubulon-snmp Vcs-Browser: https://salsa.debian.org/nagios-team/pkg-nagios-snmp-plugins Vcs-Git: https://salsa.debian.org/nagios-team/pkg-nagios-snmp-plugins.git -Standards-Version: 4.3.0 +Standards-Version: 4.5.1 Package: nagios-snmp-plugins Architecture: all diff -Nru nagios-snmp-plugins-2.1.0/debian/copyright nagios-snmp-plugins-2.1.0/debian/copyright --- nagios-snmp-plugins-2.1.0/debian/copyright 2019-01-23 19:44:01.000000000 +0000 +++ nagios-snmp-plugins-2.1.0/debian/copyright 2020-12-07 14:50:39.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Nagios SNMP Plugins Upstream-Contact: Patrick Proy (nagios at proy.org) Source: http://www.manubulon.com/nagios @@ -36,18 +36,18 @@ 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 - published by the Free Software Foundation. + 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 + published by the Free Software Foundation. . - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. . - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA License: GPL-2+ This program is free software; you can redistribute it and/or modify diff -Nru nagios-snmp-plugins-2.1.0/debian/.gitlab-ci.yml nagios-snmp-plugins-2.1.0/debian/.gitlab-ci.yml --- nagios-snmp-plugins-2.1.0/debian/.gitlab-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ nagios-snmp-plugins-2.1.0/debian/.gitlab-ci.yml 2020-12-07 14:50:39.000000000 +0000 @@ -0,0 +1,14 @@ +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml + +variables: + RELEASE: 'unstable' + SALSA_CI_DISABLE_APTLY: 0 + SALSA_CI_DISABLE_AUTOPKGTEST: 0 + SALSA_CI_DISABLE_BLHC: 0 + SALSA_CI_DISABLE_LINTIAN: 0 + SALSA_CI_DISABLE_PIUPARTS: 0 + SALSA_CI_DISABLE_REPROTEST: 0 + SALSA_CI_DISABLE_BUILD_PACKAGE_ALL: 0 + SALSA_CI_DISABLE_BUILD_PACKAGE_ANY: 0 diff -Nru nagios-snmp-plugins-2.1.0/debian/patches/14_check_snmp_int_ign nagios-snmp-plugins-2.1.0/debian/patches/14_check_snmp_int_ign --- nagios-snmp-plugins-2.1.0/debian/patches/14_check_snmp_int_ign 1970-01-01 00:00:00.000000000 +0000 +++ nagios-snmp-plugins-2.1.0/debian/patches/14_check_snmp_int_ign 2020-12-07 14:50:39.000000000 +0000 @@ -0,0 +1,187 @@ +From 2d11bcf5c884793eb21a946fdd04cf87baf57ad3 Mon Sep 17 00:00:00 2001 +From: Stanislav Datskevych +Date: Wed, 9 Jan 2019 11:25:39 +0100 +Subject: [PATCH] added ign-admindown, ign-emptyalias options. fixed + unitialized variable warning + +--- + plugins/check_snmp_int.pl | 98 +++++++++++++++++++++++++++++++-------- + 1 file changed, 79 insertions(+), 19 deletions(-) + +diff --git a/plugins/check_snmp_int.pl b/plugins/check_snmp_int.pl +index e938131..721c3b2 100755 +--- a/plugins/check_snmp_int.pl ++++ b/plugins/check_snmp_int.pl +@@ -35,7 +35,7 @@ + my $name_table = '1.3.6.1.2.1.31.1.1.1.1'; + my $alias_table = '.1.3.6.1.2.1.31.1.1.1.18'; + 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 $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.'; + my $speed_table_64 = '1.3.6.1.2.1.31.1.1.1.15.'; + my $in_octet_table = '1.3.6.1.2.1.2.2.1.10.'; +@@ -60,20 +60,22 @@ + # Globals + + # Standard options +-my $o_host = undef; # hostname +-my $o_port = 161; # port +-my $o_descr = undef; # description filter +-my $o_help = undef; # wan't some help ? +-my $o_admin = undef; # admin status instead of oper +-my $o_inverse = undef; # Critical when up +-my $o_dormant = undef; # Dormant state is OK +-my $o_down = undef; # Down state is OK +-my $o_verb = undef; # verbose mode +-my $o_version = undef; # print version +-my $o_noreg = undef; # Do not use Regexp for name +-my $o_short = undef; # set maximum of n chars to be displayed +-my $o_label = undef; # add label before speed (in, out, etc...). +-my $o_weather = undef; # output "weathermap" data for NagVis ++my $o_host = undef; # hostname ++my $o_port = 161; # port ++my $o_descr = undef; # description filter ++my $o_help = undef; # wan't some help ? ++my $o_admin = undef; # admin status instead of oper ++my $o_inverse = undef; # Critical when up ++my $o_dormant = undef; # Dormant state is OK ++my $o_down = undef; # Down state is OK ++my $o_ignore_admindown = undef; # Ignore interfaces in admin down state ++my $o_ignore_emptyalias = undef; # ignore interfaces with empty alias (interface description string) ++my $o_verb = undef; # verbose mode ++my $o_version = undef; # print version ++my $o_noreg = undef; # Do not use Regexp for name ++my $o_short = undef; # set maximum of n chars to be displayed ++my $o_label = undef; # add label before speed (in, out, etc...). ++my $o_weather = undef; # output "weathermap" data for NagVis + + # Performance data options + my $o_perf = undef; # Output performance data +@@ -224,6 +226,10 @@ sub help { + Dormant state is an OK state + --down + Down state is an OK state ++--ign-admindown ++ Ignore interfaces in Admin down state ++--ign-emptyalias ++ Ignore interfaces having empty alias (port description) + -o, --octetlength=INTEGER + max-size of the SNMP message, usefull in case of Too Long responses. + Be carefull with network filters. Range 484 - 65535, default are +@@ -358,7 +364,9 @@ sub check_options { + 'dormant' => \$o_dormant, + 'down' => \$o_down, + 'W' => \$o_weather, +- 'weather' => \$o_weather ++ 'weather' => \$o_weather, ++ 'ign-admindown' => \$o_ignore_admindown, ++ 'ign-emptyalias' => \$o_ignore_emptyalias, + ); + if (defined($o_help)) { help(); exit $ERRORS{"UNKNOWN"} } + if (defined($o_version)) { p_version(); exit $ERRORS{"UNKNOWN"} } +@@ -489,6 +497,14 @@ sub check_options { + print_usage(); + exit $ERRORS{"UNKNOWN"}; + } ++ ++ #### check if --admin and --ign-admindown are put together. ++ #### --ign-admindown expects the open_state of the port to be used ++ if (defined($o_ignore_admindown) && defined($o_admin)) { ++ print "ERROR: --ign-admindown and -a are mutually exclusive. Please select only one.\n\n"; ++ print_usage(); ++ exit $ERRORS{"UNKNOWN"}; ++ } + } + + ########## MAIN ####### +@@ -616,6 +632,31 @@ sub check_options { + $in_octet_table = $in_octet_table_64; + } + ++# If --ign-admindown is set, we need to have admin status table ++my $admin_status_table; ++if (defined($o_ignore_admindown)) { ++ $admin_status_table = $session->get_table(Baseoid => $admin_table); ++ ++ if (!defined($admin_status_table)) { ++ printf("ERROR: Admin status table : %s.\n", $session->error); ++ $session->close; ++ exit $ERRORS{"UNKNOWN"}; ++ } ++} ++ ++# If --ign-emptyalias is set, we need to have aliases table ++my $interfaces_aliases; ++if (defined($o_ignore_emptyalias)) { ++ $interfaces_aliases = $session->get_table(Baseoid => $alias_table); ++ ++ if (!defined($interfaces_aliases)) { ++ printf("ERROR: Alias status table : %s.\n", $session->error); ++ $session->close; ++ exit $ERRORS{"UNKNOWN"}; ++ } ++} ++ ++ + # Select interface by regexp of exact match + # and put the oid to query in an array + +@@ -623,12 +664,30 @@ sub check_options { + foreach my $key (sort { $$resultat{$a} cmp $$resultat{$b} } keys %$resultat) { + verb("OID : $key, Desc : $$resultat{$key}"); + ++ my $ignore = 0; ++ my $prefix = $query_table . "."; ++ my ($ifindex) = $key =~ /$prefix(\d+)$/; ++ ++ # if ign-admindown is set, check the ifIndex against admin status ++ if (defined($o_ignore_admindown)) { ++ my $index = $admin_table . "." . $ifindex; ++ my $admstatus = $$admin_status_table{$index}; ++ $ignore = 1 if ($admstatus == 2); ++ } ++ ++ # if ign-emptyalias is set, check the ifIndex against alias string ++ if (defined($o_ignore_emptyalias)) { ++ my $index = $alias_table . "." . $ifindex; ++ my $alias = $$interfaces_aliases{$index}; ++ $ignore = 1 if ($alias eq ""); ++ } ++ + # test by regexp or exact match + my $test + = defined($o_noreg) + ? $$resultat{$key} eq $o_descr + : $$resultat{$key} =~ /$o_descr/; +- if ($test) { ++ if ($test && !$ignore) { + + # get the index number of the interface + my @oid_list = split(/\./, $key); +@@ -645,7 +704,7 @@ sub check_options { + # Get rid of special caracters (specially for Windows) + $descr[$num_int] =~ s/[[:cntrl:]]//g; + # put the admin or oper oid in an array +- $oids[$num_int]= defined ($o_admin) ? $admin_table . $tindex[$num_int] ++ $oids[$num_int]= defined ($o_admin) ? $admin_table . "." . $tindex[$num_int] + : $oper_table . $tindex[$num_int]; + + # Put the performance oid +@@ -724,7 +783,7 @@ sub check_options { + # Get the status of the current interface + my $int_status + = defined($o_admin) +- ? $$result{ $admin_table . $tindex[$i] } ++ ? $$result{ $admin_table . "." . $tindex[$i] } + : $$result{ $oper_table . $tindex[$i] }; + + # Make the bandwith & error checks if necessary +@@ -976,6 +1035,7 @@ sub check_options { + $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_discard'=" . $$result{ $oid_perf_outdisc[$i] } . "c "; + } + if (defined($o_perfs)) { ++ my $speed_real = "" unless (defined($speed_real)); + $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_speed_bps'=" . $speed_real . " "; + } + if (defined($o_weather) && $usable_data == 1) { diff -Nru nagios-snmp-plugins-2.1.0/debian/patches/15_check_snmp_int_spaces nagios-snmp-plugins-2.1.0/debian/patches/15_check_snmp_int_spaces --- nagios-snmp-plugins-2.1.0/debian/patches/15_check_snmp_int_spaces 1970-01-01 00:00:00.000000000 +0000 +++ nagios-snmp-plugins-2.1.0/debian/patches/15_check_snmp_int_spaces 2020-12-07 14:50:39.000000000 +0000 @@ -0,0 +1,32 @@ +From 8f1c304b82c7bd9f5d1b23faa91ba86b0f99c4e2 Mon Sep 17 00:00:00 2001 +From: PGranado +Date: Fri, 22 Mar 2019 15:05:32 +0100 +Subject: [PATCH] Add spaces only if necessary, resolving bug #32 + +--- + plugins/check_snmp_int.pl | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/plugins/check_snmp_int.pl ++++ b/plugins/check_snmp_int.pl +@@ -777,7 +777,7 @@ + # make all checks and output for all interfaces + for (my $i = 0; $i < $num_int; $i++) { + $print_out .= ", " if (defined($print_out)); +- $perf_out .= " " if (defined($perf_out)); ++ + my $usable_data = 1; + + # Get the status of the current interface +@@ -785,7 +785,10 @@ + = defined($o_admin) + ? $$result{ $admin_table . "." . $tindex[$i] } + : $$result{ $oper_table . $tindex[$i] }; +- ++ ++ # Add spaces only if necessary ++ $perf_out .= " " if (defined ($perf_out) && $int_status==2 ) ; ++ + # Make the bandwith & error checks if necessary + if (defined($o_checkperf) && $int_status == 1) { + $temp_file_name = $descr[$i]; diff -Nru nagios-snmp-plugins-2.1.0/debian/patches/16_check_snmp_win_max_message_size nagios-snmp-plugins-2.1.0/debian/patches/16_check_snmp_win_max_message_size --- nagios-snmp-plugins-2.1.0/debian/patches/16_check_snmp_win_max_message_size 1970-01-01 00:00:00.000000000 +0000 +++ nagios-snmp-plugins-2.1.0/debian/patches/16_check_snmp_win_max_message_size 2020-12-07 14:50:39.000000000 +0000 @@ -0,0 +1,178 @@ +From dc67e601453a564db68d7921f16fb6ea875f68be Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mathias=20V=C3=A9drines?= +Date: Fri, 21 Feb 2020 12:18:53 +0100 +Subject: [PATCH] Add -o option (max message size) in check_snmp_win + +--- + plugins/check_snmp_win.pl | 121 +++++++++++++++++++++++--------------- + 1 file changed, 72 insertions(+), 49 deletions(-) + +diff --git a/plugins/check_snmp_win.pl b/plugins/check_snmp_win.pl +index 148d6eb..c5cb573 100755 +--- a/plugins/check_snmp_win.pl ++++ b/plugins/check_snmp_win.pl +@@ -47,24 +47,25 @@ + + my $Name = 'check_snmp_win'; + +-my $o_host = undef; # hostname +-my $o_community = undef; # community +-my $o_port = 161; # port +-my $o_version2 = undef; #use snmp v2c +-my $o_descr = undef; # description filter +-my @o_descrL = undef; # Service descriprion list. +-my $o_showall = undef; # Show all services even if OK +-my $o_type = "service"; # Check type (service, ...) +-my $o_number = undef; # Number of service for warn and crit levels +-my $o_help = undef; # wan't some help ? +-my $o_verb = undef; # verbose mode +-my $o_version = undef; # print version +-my $o_noreg = undef; # Do not use Regexp for name +-my $o_timeout = 5; # Default 5s Timeout ++my $o_host = undef; # hostname ++my $o_community = undef; # community ++my $o_port = 161; # port ++my $o_version2 = undef; # use snmp v2c ++my $o_descr = undef; # description filter ++my @o_descrL = undef; # Service descriprion list. ++my $o_showall = undef; # Show all services even if OK ++my $o_type = "service"; # Check type (service, ...) ++my $o_number = undef; # Number of service for warn and crit levels ++my $o_help = undef; # wan't some help ? ++my $o_verb = undef; # verbose mode ++my $o_version = undef; # print version ++my $o_noreg = undef; # Do not use Regexp for name ++my $o_timeout = 5; # Default 5s Timeout ++my $o_octetlength = undef; # SNMP max message size + + # SNMP V3 specific +-my $o_login = undef; # snmp v3 login +-my $o_passwd = undef; # snmp v3 passwd ++my $o_login = undef; # snmp v3 login ++my $o_passwd = undef; # snmp v3 passwd + + # functions + +@@ -72,7 +73,7 @@ + + sub print_usage { + print +-"Usage: $Name [-v] -H -C [-2] | (-l login -x passwd) [-p ] -n [,] [-t ] [-V]\n"; ++"Usage: $Name [-v] -H -C [-2] | (-l login -x passwd) [-p ] -n [,] [-t ] [-o ] [-V]\n"; + } + + sub isnotnum { # Return true if arg is not a number +@@ -128,6 +129,8 @@ sub help { + Do not use regexp to match NAME in service description. + -t, --timeout=INTEGER + timeout for SNMP in seconds (Default: 5) ++-o, --octetlength=INTEGER ++ SNMP max message size (484-65535) + -V, --version + prints version number + Note : +@@ -162,36 +165,38 @@ sub decode_utf8 { # just replaces UFT8 caracters by "." + sub check_options { + Getopt::Long::Configure("bundling"); + GetOptions( +- 'v' => \$o_verb, +- 'verbose' => \$o_verb, +- 'h' => \$o_help, +- 'help' => \$o_help, +- 'H:s' => \$o_host, +- 'hostname:s' => \$o_host, +- 'p:i' => \$o_port, +- 'port:i' => \$o_port, +- 'C:s' => \$o_community, +- 'community:s' => \$o_community, +- 'l:s' => \$o_login, +- 'login:s' => \$o_login, +- 'x:s' => \$o_passwd, +- 'passwd:s' => \$o_passwd, +- 't:i' => \$o_timeout, +- 'timeout:i' => \$o_timeout, +- 'n:s' => \$o_descr, +- 'name:s' => \$o_descr, +- 'r' => \$o_noreg, +- 'noregexp' => \$o_noreg, +- 'T:s' => \$o_type, +- 'type:s' => \$o_type, +- 'N:i' => \$o_number, +- 'number:i' => \$o_number, +- '2' => \$o_version2, +- 'v2c' => \$o_version2, +- 's' => \$o_showall, +- 'showall' => \$o_showall, +- 'V' => \$o_version, +- 'version' => \$o_version ++ 'v' => \$o_verb, ++ 'verbose' => \$o_verb, ++ 'h' => \$o_help, ++ 'help' => \$o_help, ++ 'H:s' => \$o_host, ++ 'hostname:s' => \$o_host, ++ 'p:i' => \$o_port, ++ 'port:i' => \$o_port, ++ 'C:s' => \$o_community, ++ 'community:s' => \$o_community, ++ 'l:s' => \$o_login, ++ 'login:s' => \$o_login, ++ 'x:s' => \$o_passwd, ++ 'passwd:s' => \$o_passwd, ++ 't:i' => \$o_timeout, ++ 'timeout:i' => \$o_timeout, ++ 'n:s' => \$o_descr, ++ 'name:s' => \$o_descr, ++ 'r' => \$o_noreg, ++ 'noregexp' => \$o_noreg, ++ 'T:s' => \$o_type, ++ 'type:s' => \$o_type, ++ 'N:i' => \$o_number, ++ 'number:i' => \$o_number, ++ '2' => \$o_version2, ++ 'v2c' => \$o_version2, ++ 'o:i' => \$o_octetlength, ++ 'octetlength:i' => \$o_octetlength, ++ 's' => \$o_showall, ++ 'showall' => \$o_showall, ++ 'V' => \$o_version, ++ 'version' => \$o_version + ); + if (defined($o_help)) { help(); exit $ERRORS{"UNKNOWN"} } + if (defined($o_version)) { p_version(); exit $ERRORS{"UNKNOWN"} } +@@ -222,6 +227,13 @@ sub check_options { + } + } + ++ # Octet length check ++ if (defined($o_octetlength) && (isnotnum($o_octetlength) || $o_octetlength > 65535 || $o_octetlength < 484)) { ++ print "octet length must be in range 484 .. 65535\n"; ++ print_usage(); ++ exit $ERRORS{'UNKNOWN'}; ++ } ++ + } + + ########## MAIN ####### +@@ -283,8 +295,19 @@ sub check_options { + exit $ERRORS{"UNKNOWN"}; + } + +-$session->max_msg_size(5000); +-verb($session->max_msg_size); ++if (defined($o_octetlength)) { ++ my $oct_resultat = undef; ++ my $oct_test = $session->max_msg_size(); ++ verb(" actual max octets:: $oct_test"); ++ $oct_resultat = $session->max_msg_size($o_octetlength); ++ if (!defined($oct_resultat)) { ++ printf("ERROR: Session settings : %s.\n", $session->error); ++ $session->close; ++ exit $ERRORS{"UNKNOWN"}; ++ } ++ $oct_test = $session->max_msg_size(); ++ verb(" new max octets:: $oct_test"); ++} + + # Look for process in name or path name table + my $resultat = undef; diff -Nru nagios-snmp-plugins-2.1.0/debian/patches/17_check_snmp_storage_okifempty nagios-snmp-plugins-2.1.0/debian/patches/17_check_snmp_storage_okifempty --- nagios-snmp-plugins-2.1.0/debian/patches/17_check_snmp_storage_okifempty 1970-01-01 00:00:00.000000000 +0000 +++ nagios-snmp-plugins-2.1.0/debian/patches/17_check_snmp_storage_okifempty 2020-12-07 14:50:39.000000000 +0000 @@ -0,0 +1,61 @@ +From fd5ae19315a26530159f8ab221a190ac52de3195 Mon Sep 17 00:00:00 2001 +From: roa +Date: Mon, 9 Mar 2020 11:56:04 +0000 +Subject: [PATCH] check_snmp_storage.pl: add support for allowing considering + OK if no storage found matching given criteria + +--- + plugins/check_snmp_storage.pl | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/plugins/check_snmp_storage.pl b/plugins/check_snmp_storage.pl +index 3593f79..887800a 100755 +--- a/plugins/check_snmp_storage.pl ++++ b/plugins/check_snmp_storage.pl +@@ -73,6 +73,7 @@ + my $o_sum = undef; # add all storage before testing + my $o_index = undef; # Parse index instead of description + my $o_negate = undef; # Negate the regexp if set ++my $o_okifempty = undef; # Consider OK if no disks found + my $o_timeout = 5; # Default 5s Timeout + my $o_perf = undef; # Output performance data + my $o_short = undef; # Short output parameters +@@ -98,7 +99,7 @@ + + sub print_usage { + print +-"Usage: $Name [-v] -H -C [-2] | (-l login -x passwd [-X pass -L ,]) [-p ] [-P ] -m [-q storagetype] -w -c [-t ] [-T pl|pu|bl|bu ] [-r -s -i -G] [-e] [-S 0|1[,1,]] [-o ] [-R <% reserved>]\n"; ++"Usage: $Name [-v] -H -C [-2] | (-l login -x passwd [-X pass -L ,]) [-p ] [-P ] -m [-q storagetype] -w -c [-t ] [-T pl|pu|bl|bu ] [-r -s -i -G] [-e] [-O] [-S 0|1[,1,]] [-o ] [-R <% reserved>]\n"; + } + + sub round ($$) { +@@ -180,6 +181,8 @@ sub help { + -e, --exclude + Select all storages except the one(s) selected by -m + No action on storage type selection ++-O, --okifempty ++ Consider OK instead of UNKNOWN if no storage found with given criteria + -T, --type=TYPE + pl : calculate percent left + pu : calculate percent used (Default) +@@ -279,6 +282,8 @@ sub check_options { + 'index' => \$o_index, + 'e' => \$o_negate, + 'exclude' => \$o_negate, ++ 'O' => \$o_okifempty, ++ 'okifempty' => \$o_okifempty, + 'V' => \$o_version, + 'version' => \$o_version, + 'q:s' => \$o_storagetype, +@@ -590,7 +595,10 @@ sub check_options { + } + } + verb("storages selected : $num_int"); +-if ($num_int == 0) { print "Unknown storage : $o_descr : ERROR\n"; exit $ERRORS{"UNKNOWN"}; } ++if ($num_int == 0) { ++ if ($o_okifempty) { print "No storage found matching given criteria, but future new disks will be monitored\n"; exit $ERRORS{"OK"}; } ++ else { print "Unknown storage : $o_descr : ERROR\n"; exit $ERRORS{"UNKNOWN"}; } ++} + + my $result = undef; + diff -Nru nagios-snmp-plugins-2.1.0/debian/patches/18_check_snmp_int_fix_perf_out nagios-snmp-plugins-2.1.0/debian/patches/18_check_snmp_int_fix_perf_out --- nagios-snmp-plugins-2.1.0/debian/patches/18_check_snmp_int_fix_perf_out 1970-01-01 00:00:00.000000000 +0000 +++ nagios-snmp-plugins-2.1.0/debian/patches/18_check_snmp_int_fix_perf_out 2020-12-07 14:50:39.000000000 +0000 @@ -0,0 +1,41 @@ +From effd196f76c4f4e9505b0955b020f8f65f1700a2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Pawe=C5=82=20Szafer?= +Date: Mon, 16 Mar 2020 18:41:49 +0100 +Subject: [PATCH] fix perf_out not defined error + +--- + plugins/check_snmp_int.pl | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +--- a/plugins/check_snmp_int.pl ++++ b/plugins/check_snmp_int.pl +@@ -1053,24 +1053,25 @@ + + # Check if all interface are OK + if ($num_ok == $num_int) { ++ my $is_perf_defined = defined($perf_out) && defined($o_perf); + if ($final_status == 0) { + print $print_out, ":", $num_ok, " UP: OK"; +- if (defined($o_perf)) { print " | ", $perf_out; } ++ if ($is_perf_defined) { print " | ", $perf_out; } + print "\n"; + exit $ERRORS{"OK"}; + } elsif ($final_status == 1) { + print $print_out, ":(", $num_ok, " UP): WARNING"; +- if (defined($o_perf)) { print " | ", $perf_out; } ++ if ($is_perf_defined) { print " | ", $perf_out; } + print "\n"; + exit $ERRORS{"WARNING"}; + } elsif ($final_status == 2) { + print $print_out, ":(", $num_ok, " UP): CRITICAL"; +- if (defined($o_perf)) { print " | ", $perf_out; } ++ if ($is_perf_defined) { print " | ", $perf_out; } + print "\n"; + exit $ERRORS{"CRITICAL"}; + } else { + print $print_out, ":(", $num_ok, " UP): UNKNOWN"; +- if (defined($perf_out)) { print " | ", $perf_out; } ++ if ($is_perf_defined) { print " | ", $perf_out; } + print "\n"; + exit $ERRORS{"UNKNOWN"}; + } diff -Nru nagios-snmp-plugins-2.1.0/debian/patches/series nagios-snmp-plugins-2.1.0/debian/patches/series --- nagios-snmp-plugins-2.1.0/debian/patches/series 2019-01-23 19:44:01.000000000 +0000 +++ nagios-snmp-plugins-2.1.0/debian/patches/series 2020-12-07 14:50:39.000000000 +0000 @@ -2,5 +2,10 @@ 11_check_snmp_int_agent_workaround 12_check_snmp_mem_perf 13_check_snmp_process_new_features +14_check_snmp_int_ign +15_check_snmp_int_spaces +16_check_snmp_win_max_message_size +17_check_snmp_storage_okifempty +18_check_snmp_int_fix_perf_out 50_disable_epn 51_fix_privacy_doc diff -Nru nagios-snmp-plugins-2.1.0/debian/watch nagios-snmp-plugins-2.1.0/debian/watch --- nagios-snmp-plugins-2.1.0/debian/watch 2019-01-23 19:44:01.000000000 +0000 +++ nagios-snmp-plugins-2.1.0/debian/watch 2020-12-07 14:50:39.000000000 +0000 @@ -1,3 +1,3 @@ -version=3 +version=4 opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/nagios-snmp-plugins-$1\.tar\.gz/,uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha)\d*)$/$1-$2/ \ - https://github.com/dnsmichi/manubulon-snmp/releases .*/v?(\d\S*)\.tar\.gz + https://github.com/SteScho/manubulon-snmp/releases .*/v?(\d\S*)\.tar\.gz