diff --git a/.github/workflows/packaging_test.yml b/.github/workflows/packaging_test.yml index 9aef0a7..c478ef5 100644 --- a/.github/workflows/packaging_test.yml +++ b/.github/workflows/packaging_test.yml @@ -27,7 +27,7 @@ jobs: run: | sed -i '0,/restricted/s//stable/' debian/changelog - name: Build Debian package - uses: dawidd6/action-debian-package@v1.6.0 + uses: dawidd6/action-debian-package@v1.5.0 with: artifacts_directory: debian/build/release/ os_distribution: testing diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9ae7df4..f384f5e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,7 +53,7 @@ jobs: run: | sed -i '0,/restricted/s//stable/' debian/changelog - name: Build Debian package - uses: dawidd6/action-debian-package@v1.6.0 + uses: dawidd6/action-debian-package@v1.5.0 with: artifacts_directory: debian/build/release/ os_distribution: testing diff --git a/debian/changelog b/debian/changelog index 0601f7c..fd83155 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,29 +1,8 @@ -nagios-snmp-plugins (2.1.0-6) UNRELEASED; urgency=medium +nagios-snmp-plugins (2.1.0-4) UNRELEASED; urgency=medium - * + * - -- Jan Wagner Sun, 20 Apr 2025 22:18:26 +0200 - -nagios-snmp-plugins (2.1.0-5) unstable; urgency=medium - - [ Bas Couwenberg ] - * [133cc65] Bump Standards-Version to 4.7.0, no changes. - * [0556666] Bump Standards-Version to 4.7.2, no changes. - * [8b74a54] Fix old FSF address in copyright file. - - -- Jan Wagner Sun, 20 Apr 2025 18:52:04 +0000 - -nagios-snmp-plugins (2.1.0-4) unstable; urgency=medium - - [ Bas Couwenberg ] - * [13ac6fb] Explicitly enable test-build-twice job. - - [ Jan Wagner ] - * [67af323] Adding d/p/23_check_snmp_int_interface_speed from upsgtream - * [d0702fa] Adding d/p/24_tcp_udp_ipv4_ipv6 from upsgtream - * [5638743] Adding d/p/25_check_snmp_int_add_metrik from upsgtream - - -- Jan Wagner Tue, 23 Jul 2024 05:44:14 +0000 + -- Jan Wagner Mon, 23 Jan 2023 14:23:45 +0000 nagios-snmp-plugins (2.1.0-3) unstable; urgency=medium diff --git a/debian/control b/debian/control index 863db03..c0ad87c 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Debian Nagios Maintainer Group Uploaders: Jan Wagner Build-Depends: debhelper-compat (= 13) -Standards-Version: 4.7.2 +Standards-Version: 4.6.2 Vcs-Browser: https://salsa.debian.org/nagios-team/nagios-snmp-plugins Vcs-Git: https://salsa.debian.org/nagios-team/nagios-snmp-plugins.git Homepage: https://github.com/SteScho/manubulon-snmp diff --git a/debian/copyright b/debian/copyright index 32acc22..d90354a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -16,48 +16,53 @@ 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. + 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 - 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. - . - On Debian systems, the complete text of the GNU General Public License version - 2 can be found in /usr/share/common-licenses/GPL-2 file. + 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. + . + 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 - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - . - This 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 free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This 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 + . On Debian systems, the complete text of the GNU General Public License version 2 can be found in /usr/share/common-licenses/GPL-2 file. diff --git a/debian/patches/23_check_snmp_int_interface_speed b/debian/patches/23_check_snmp_int_interface_speed deleted file mode 100644 index a6db7cf..0000000 --- a/debian/patches/23_check_snmp_int_interface_speed +++ /dev/null @@ -1,138 +0,0 @@ -diff --git a/doc/04-Plugins.md b/doc/04-Plugins.md -index c08fe9c..bf2a593 100644 ---- a/doc/04-Plugins.md -+++ b/doc/04-Plugins.md -@@ -207,13 +207,13 @@ Usage: ./check_snmp_int.pl [-v] -H -C [-2] | (-l login - - -G : Make the warning and critical levels in Gbps (with -B) or GBps - -M : Make the warning and critical levels in Mbps (with -B) or MBps - -u : Make the warning and critical levels in % of reported interface speed. ---w, --warning=input,output[,error in,error out,discard in,discard out] -+-w, --warning=input,output[,error in,error out,discard in,discard out,interface speed] - warning level for input / output bandwidth (0 for no warning) -- unit depends on B,M,G,u options -+ unit depends on B,M,G,u options and interface speed is in bps - warning for error & discard input / output in error/min (need -q) ---c, --critical=input,output[,error in,error out,discard in,discard out] -+-c, --critical=input,output[,error in,error out,discard in,discard out,interface speed] - critical level for input / output bandwidth (0 for no critical) -- unit depends on B,M,G,u options -+ unit depends on B,M,G,u options and interface speed is in bps - critical for error & discard input / output in error/min (need -q) - -s, --short=int - Make the output shorter : only the first chars of the interface(s) -diff --git a/doc/html/nagios.manubulon.com/snmp_int.html b/doc/html/nagios.manubulon.com/snmp_int.html -index 8274a05..1c5f68f 100644 ---- a/doc/html/nagios.manubulon.com/snmp_int.html -+++ b/doc/html/nagios.manubulon.com/snmp_int.html -@@ -337,13 +337,14 @@ -

When the extended checks are activated (-q - option), the warning levels are
- -w <In bytes>,<Out bytes>,<In error>,<Out -- error>,<In disc>,<Out disc> -c -+ error>,<In disc>,<Out disc>,<Interface speed> -c - <In warn>,<Out warn>, .....
- In error : warn/crit level in inboud error/minute
-
Out error : warn/crit level in outbound error/minute
- In disc : warn/crit level in inboud discarded packets/minute
--
Out disc : warn/crit level in outbound discarded packets/minute --
-+ Out disc : warn/crit level in outbound discarded packets/minute
-+ Interface speed : warn/crit level of Interface speed discarded bits/second
-+
-

-

-k : activates the standard usage feature
- -q : activates the extended usage
-diff --git a/plugins/check_snmp_int.pl b/plugins/check_snmp_int.pl -index 71f8d14..d978c66 100755 ---- a/plugins/check_snmp_int.pl -+++ b/plugins/check_snmp_int.pl -@@ -262,11 +262,11 @@ sub help { - -G : Make the warning and critical levels in Gbps (with -B) or GBps - -M : Make the warning and critical levels in Mbps (with -B) or MBps - -u : Make the warning and critical levels in % of reported interface speed. ---w, --warning=input,output[,error in,error out,discard in,discard out] -+-w, --warning=input,output[,error in,error out,discard in,discard out,interface speed] - warning level for input / output bandwidth (0 for no warning) - unit depends on B,M,G,u options - warning for error & discard input / output in error/min (need -q) ---c, --critical=input,output[,error in,error out,discard in,discard out] -+-c, --critical=input,output[,error in,error out,discard in,discard out,interface speed] - critical level for input / output bandwidth (0 for no critical) - unit depends on B,M,G,u options - critical for error & discard input / output in error/min (need -q) -@@ -452,8 +452,8 @@ sub check_options { - } - if (defined($o_checkperf)) { - @o_warn = split(/,/, $o_warn_opt); -- if (defined($o_ext_checkperf) && ($#o_warn != 5)) { -- print "6 warning levels for extended checks \n"; -+ if (defined($o_ext_checkperf) && (($#o_warn < 5) || ($#o_warn > 6))) { -+ print "6 or 7 warning levels for extended checks err val: $#o_warn \n"; - print_usage(); - exit $ERRORS{"UNKNOWN"}; - } -@@ -465,8 +465,8 @@ sub check_options { - @o_crit = split(/,/, $o_crit_opt); - - #verb(" $o_crit_opt :: $#o_crit : @o_crit"); -- if (defined($o_ext_checkperf) && ($#o_crit != 5)) { -- print "6 critical levels for extended checks \n"; -+ if (defined($o_ext_checkperf) && (($#o_crit < 5) || ($#o_crit > 6))) { -+ print "6 or 7 critical levels for extended checks err val: $#o_crit \n"; - print_usage(); - exit $ERRORS{"UNKNOWN"}; - } -@@ -476,10 +476,18 @@ sub check_options { - exit $ERRORS{"UNKNOWN"}; - } - for (my $i = 0; $i <= $#o_warn; $i++) { -- if (($o_crit[$i] != 0) && ($o_warn[$i] > $o_crit[$i])) { -- print "Warning must be < Critical level \n"; -- print_usage(); -- exit $ERRORS{"UNKNOWN"}; -+ if ($i != 6) { -+ if (($o_crit[$i] != 0) && ($o_warn[$i] > $o_crit[$i])) { -+ print "Warning must be < Critical level \n"; -+ print_usage(); -+ exit $ERRORS{"UNKNOWN"}; -+ } -+ } else { -+ if (($o_crit[$i] != 0) && ($o_warn[$i] < $o_crit[$i])) { -+ print "Warning must be > Critical level \n"; -+ print_usage(); -+ exit $ERRORS{"UNKNOWN"}; -+ } - } - } - if ( (defined($o_meg) && defined($o_gig)) -@@ -946,6 +954,18 @@ sub check_options { - } - if ($l == 0 || $l == 1) { $print_out .= $speed_unit; } - } -+ if (defined($o_perfs) && defined($o_ext_checkperf)) { -+ $print_out .= "/"; -+ if (defined($o_crit[6]) && ($o_crit[6] != 0) && ($speed_real < $o_crit[6])) { -+ $final_status = 2; -+ $print_out .= sprintf("CRIT %.0fbps", $speed_real); -+ } elsif (defined($o_warn[6]) && ($o_warn[6] != 0) && ($speed_real < $o_warn[6])) { -+ $final_status = ($final_status == 2) ? 2 : 1; -+ $print_out .= sprintf("WARN %.0fbps", $speed_real); -+ } else { -+ $print_out .= sprintf("%.0fbps", $speed_real); -+ } -+ } - $print_out .= ")"; - } else { # Return unknown when no data - $print_out .= " No usable data on file (" . $n_rows . " rows) "; -@@ -1039,7 +1059,10 @@ sub check_options { - } - if (defined($o_perfs)) { - $speed_real = "" unless (defined($speed_real)); -- $perf_out .= "'" . $descr[$i] . "_speed_bps'=" . $speed_real . " "; -+ $perf_out .= "'" . $descr[$i] . "_speed_bps'=" . $speed_real . ";"; -+ $perf_out .= defined($o_warn[6]) ? $o_warn[6] . ";" : ";"; -+ $perf_out .= defined($o_crit[6]) ? $o_crit[6] . ";" : ";"; -+ $perf_out .= "; "; - } - if (defined($o_weather) && $usable_data == 1) { - $perf_out .= "in=" . sprintf("%.0f", $checkperf_out_raw[0]) . ";;;0;" . sprintf("%.0f", $speed_real / 8) . " "; diff --git a/debian/patches/24_tcp_udp_ipv4_ipv6 b/debian/patches/24_tcp_udp_ipv4_ipv6 deleted file mode 100644 index 92efe5f..0000000 --- a/debian/patches/24_tcp_udp_ipv4_ipv6 +++ /dev/null @@ -1,761 +0,0 @@ -From 394ade3c6b5816c4cbca09750cb01622d474e508 Mon Sep 17 00:00:00 2001 -From: Patrick Grimm -Date: Sun, 10 Mar 2024 01:56:45 +0100 -Subject: [PATCH] add --protocol= setting tcp/udp and IPv4/IPv6 for - boostedge/cpfw/css/css_main/env/int/linkproof_nhr/nsbox/vrrp/win - -reworked the patches from -5369da5d2b3e4351e04f016619736f7d03cbcdfd ---- - plugins/check_snmp_boostedge.pl | 22 ++++++++++++++++++---- - plugins/check_snmp_cpfw.pl | 22 ++++++++++++++++++---- - plugins/check_snmp_css.pl | 22 ++++++++++++++++++---- - plugins/check_snmp_css_main.pl | 22 ++++++++++++++++++---- - plugins/check_snmp_env.pl | 22 ++++++++++++++++++---- - plugins/check_snmp_int.pl | 22 ++++++++++++++++++---- - plugins/check_snmp_linkproof_nhr.pl | 22 ++++++++++++++++++---- - plugins/check_snmp_nsbox.pl | 22 ++++++++++++++++++---- - plugins/check_snmp_vrrp.pl | 22 ++++++++++++++++++---- - plugins/check_snmp_win.pl | 19 ++++++++++++++++--- - 10 files changed, 178 insertions(+), 39 deletions(-) - -diff --git a/plugins/check_snmp_boostedge.pl b/plugins/check_snmp_boostedge.pl -index 5eaca78..2284379 100755 ---- a/plugins/check_snmp_boostedge.pl -+++ b/plugins/check_snmp_boostedge.pl -@@ -43,6 +43,7 @@ - my $o_host = undef; # hostname - my $o_community = undef; # community - my $o_port = 161; # port -+my $o_domain = 'udp/ipv4'; # protocol - my $o_help = undef; # wan't some help ? - my $o_verb = undef; # verbose mode - my $o_version = undef; # print version -@@ -121,6 +122,14 @@ sub help { - : Priv protocole (des|aes : default des) - -P, --port=PORT - SNMP port (Default 161) -+--protocol=PROTOCOL -+ Network protocol to be used -+ ['udp/ipv4'] : UDP over IPv4 -+ 'udp/ipv6' : UDP over IPv6 -+ 'tcp/ipv4' : TCP over IPv4 -+ 'tcp/ipv6' : TCP over IPv6 -+ -+ Network protocol (Default udp/ipv4) - -f, --perfparse, --perfdata - Performance data output - -t, --timeout=INTEGER -@@ -144,6 +153,7 @@ sub check_options { - 'hostname:s' => \$o_host, - 'p:i' => \$o_port, - 'port:i' => \$o_port, -+ 'protocol:s' => \$o_domain, - 'C:s' => \$o_community, - 'community:s' => \$o_community, - 'l:s' => \$o_login, -@@ -252,7 +262,8 @@ sub check_options { - -username => $o_login, - -authpassword => $o_passwd, - -authprotocol => $o_authproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - verb("SNMPv3 AuthPriv login : $o_login, $o_authproto, $o_privproto"); -@@ -265,7 +276,8 @@ sub check_options { - -authprotocol => $o_authproto, - -privpassword => $o_privpass, - -privprotocol => $o_privproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } else { -@@ -278,7 +290,8 @@ sub check_options { - -version => 2, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - -@@ -288,7 +301,8 @@ sub check_options { - -hostname => $o_host, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } -diff --git a/plugins/check_snmp_cpfw.pl b/plugins/check_snmp_cpfw.pl -index b29c3e9..5e3f7f5 100755 ---- a/plugins/check_snmp_cpfw.pl -+++ b/plugins/check_snmp_cpfw.pl -@@ -77,6 +77,7 @@ - my $o_community = undef; # community - my $o_version2 = undef; # Version 2 - my $o_port = 161; # port -+my $o_domain = 'udp/ipv4'; # protocol - my $o_help = undef; # wan't some help ? - my $o_verb = undef; # verbose mode - my $o_version = undef; # print version -@@ -154,6 +155,14 @@ sub help { - performance data output (only works with -c) - -P, --port=PORT - SNMP port (Default 161) -+--protocol=PROTOCOL -+ Network protocol to be used -+ ['udp/ipv4'] : UDP over IPv4 -+ 'udp/ipv6' : UDP over IPv6 -+ 'tcp/ipv4' : TCP over IPv4 -+ 'tcp/ipv6' : TCP over IPv6 -+ -+ Network protocol (Default udp/ipv4) - -t, --timeout=INTEGER - timeout for SNMP (Default: Nagios default) - -V, --version -@@ -175,6 +184,7 @@ sub check_options { - 'hostname:s' => \$o_host, - 'P:i' => \$o_port, - 'port:i' => \$o_port, -+ 'protocol:s' => \$o_domain, - 'C:s' => \$o_community, - 'community:s' => \$o_community, - '2' => \$o_version2, -@@ -315,7 +325,8 @@ sub check_options { - -port => $o_port, - -authpassword => $o_passwd, - -authprotocol => $o_authproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - verb("SNMPv3 AuthPriv login : $o_login, $o_authproto, $o_privproto"); -@@ -328,7 +339,8 @@ sub check_options { - -authprotocol => $o_authproto, - -privpassword => $o_privpass, - -privprotocol => $o_privproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } else { -@@ -341,7 +353,8 @@ sub check_options { - -version => 2, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - -@@ -351,7 +364,8 @@ sub check_options { - -hostname => $o_host, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } -diff --git a/plugins/check_snmp_css.pl b/plugins/check_snmp_css.pl -index 3f375b4..ab7d52f 100755 ---- a/plugins/check_snmp_css.pl -+++ b/plugins/check_snmp_css.pl -@@ -40,6 +40,7 @@ - my $o_host = undef; # hostname - my $o_community = undef; # community - my $o_port = 161; # port -+my $o_domain = 'udp/ipv4'; # protocol - my $o_help = undef; # wan't some help ? - my $o_verb = undef; # verbose mode - my $o_version = undef; # print version -@@ -141,6 +142,14 @@ sub help { - : Priv protocole (des|aes : default des) - -P, --port=PORT - SNMP port (Default 161) -+--protocol=PROTOCOL -+ Network protocol to be used -+ ['udp/ipv4'] : UDP over IPv4 -+ 'udp/ipv6' : UDP over IPv6 -+ 'tcp/ipv4' : TCP over IPv4 -+ 'tcp/ipv6' : TCP over IPv6 -+ -+ Network protocol (Default udp/ipv4) - -f, --perfparse - Perfparse compatible output - -t, --timeout=INTEGER -@@ -164,6 +173,7 @@ sub check_options { - 'hostname:s' => \$o_host, - 'p:i' => \$o_port, - 'port:i' => \$o_port, -+ 'protocol:s' => \$o_domain, - 'C:s' => \$o_community, - 'community:s' => \$o_community, - 'l:s' => \$o_login, -@@ -331,7 +341,8 @@ sub check_options { - -username => $o_login, - -authpassword => $o_passwd, - -authprotocol => $o_authproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - verb("SNMPv3 AuthPriv login : $o_login, $o_authproto, $o_privproto"); -@@ -344,7 +355,8 @@ sub check_options { - -authprotocol => $o_authproto, - -privpassword => $o_privpass, - -privprotocol => $o_privproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } else { -@@ -357,7 +369,8 @@ sub check_options { - -version => 2, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - -@@ -367,7 +380,8 @@ sub check_options { - -hostname => $o_host, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } -diff --git a/plugins/check_snmp_css_main.pl b/plugins/check_snmp_css_main.pl -index 0d52694..a74bb31 100755 ---- a/plugins/check_snmp_css_main.pl -+++ b/plugins/check_snmp_css_main.pl -@@ -40,6 +40,7 @@ - my $o_host = undef; # hostname - my $o_community = undef; # community - my $o_port = 161; # port -+my $o_domain = 'udp/ipv4'; # protocol - my $o_help = undef; # wan't some help ? - my $o_verb = undef; # verbose mode - my $o_version = undef; # print version -@@ -93,6 +94,14 @@ sub help { - : Priv protocole (des|aes : default des) - -P, --port=PORT - SNMP port (Default 161) -+--protocol=PROTOCOL -+ Network protocol to be used -+ ['udp/ipv4'] : UDP over IPv4 -+ 'udp/ipv6' : UDP over IPv6 -+ 'tcp/ipv4' : TCP over IPv4 -+ 'tcp/ipv6' : TCP over IPv6 -+ -+ Network protocol (Default udp/ipv4) - -t, --timeout=INTEGER - timeout for SNMP in seconds (Default: 5) - -V, --version -@@ -114,6 +123,7 @@ sub check_options { - 'hostname:s' => \$o_host, - 'p:i' => \$o_port, - 'port:i' => \$o_port, -+ 'protocol:s' => \$o_domain, - 'C:s' => \$o_community, - 'community:s' => \$o_community, - 'l:s' => \$o_login, -@@ -210,7 +220,8 @@ sub check_options { - -username => $o_login, - -authpassword => $o_passwd, - -authprotocol => $o_authproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - verb("SNMPv3 AuthPriv login : $o_login, $o_authproto, $o_privproto"); -@@ -223,7 +234,8 @@ sub check_options { - -authprotocol => $o_authproto, - -privpassword => $o_privpass, - -privprotocol => $o_privproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } else { -@@ -236,7 +248,8 @@ sub check_options { - -version => 2, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - -@@ -246,7 +259,8 @@ sub check_options { - -hostname => $o_host, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } -diff --git a/plugins/check_snmp_env.pl b/plugins/check_snmp_env.pl -index 8e15bc0..3624d4f 100755 ---- a/plugins/check_snmp_env.pl -+++ b/plugins/check_snmp_env.pl -@@ -172,6 +172,7 @@ - my $o_host = undef; # hostname - my $o_community = undef; # community - my $o_port = 161; # port -+my $o_domain = 'udp/ipv4'; # protocol - my $o_help = undef; # wan't some help ? - my $o_verb = undef; # verbose mode - my $o_version = undef; # print version -@@ -242,6 +243,14 @@ sub help { - : Priv protocole (des|aes : default des) - -P, --port=PORT - SNMP port (Default 161) -+--protocol=PROTOCOL -+ Network protocol to be used -+ ['udp/ipv4'] : UDP over IPv4 -+ 'udp/ipv6' : UDP over IPv6 -+ 'tcp/ipv4' : TCP over IPv4 -+ 'tcp/ipv6' : TCP over IPv6 -+ -+ Network protocol (Default udp/ipv4) - -T, --type=cisco|nokia|bc|iron|foundry - Environemental check : - cisco : All Cisco equipements : voltage,temp,fan,power supply -@@ -278,6 +287,7 @@ sub check_options { - 'hostname:s' => \$o_host, - 'p:i' => \$o_port, - 'port:i' => \$o_port, -+ 'protocol:s' => \$o_domain, - 'C:s' => \$o_community, - 'community:s' => \$o_community, - 'l:s' => \$o_login, -@@ -388,7 +398,8 @@ sub check_options { - -username => $o_login, - -authpassword => $o_passwd, - -authprotocol => $o_authproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - verb("SNMPv3 AuthPriv login : $o_login, $o_authproto, $o_privproto"); -@@ -401,7 +412,8 @@ sub check_options { - -authprotocol => $o_authproto, - -privpassword => $o_privpass, - -privprotocol => $o_privproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } else { -@@ -414,7 +426,8 @@ sub check_options { - -version => 2, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - -@@ -424,7 +437,8 @@ sub check_options { - -hostname => $o_host, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } -diff --git a/plugins/check_snmp_int.pl b/plugins/check_snmp_int.pl -index 71f8d14..b1214e2 100755 ---- a/plugins/check_snmp_int.pl -+++ b/plugins/check_snmp_int.pl -@@ -62,6 +62,7 @@ - # Standard options - my $o_host = undef; # hostname - my $o_port = 161; # port -+my $o_domain = 'udp/ipv4'; # protocol - my $o_descr = undef; # description filter - my $o_help = undef; # wan't some help ? - my $o_admin = undef; # admin status instead of oper -@@ -208,6 +209,14 @@ sub help { - : Priv protocole (des|aes : default des) - -P, --port=PORT - SNMP port (Default 161) -+--protocol=PROTOCOL -+ Network protocol to be used -+ ['udp/ipv4'] : UDP over IPv4 -+ 'udp/ipv6' : UDP over IPv6 -+ 'tcp/ipv4' : TCP over IPv4 -+ 'tcp/ipv6' : TCP over IPv6 -+ -+ Network protocol (Default udp/ipv4) - -n, --name=NAME - Name in description OID (eth0, ppp0 ...). - This is treated as a regexp : -n eth will match eth0,eth1,... -@@ -296,6 +305,7 @@ sub check_options { - 'hostname:s' => \$o_host, - 'p:i' => \$o_port, - 'port:i' => \$o_port, -+ 'protocol:s' => \$o_domain, - 'n:s' => \$o_descr, - 'name:s' => \$o_descr, - 'N' => \$o_use_ifname, -@@ -536,7 +546,8 @@ sub check_options { - -username => $o_login, - -authpassword => $o_passwd, - -authprotocol => $o_authproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - verb("SNMPv3 AuthPriv login : $o_login, $o_authproto, $o_privproto"); -@@ -549,7 +560,8 @@ sub check_options { - -authprotocol => $o_authproto, - -privpassword => $o_privpass, - -privprotocol => $o_privproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } else { -@@ -562,7 +574,8 @@ sub check_options { - -version => 2, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - -@@ -572,7 +585,8 @@ sub check_options { - -hostname => $o_host, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } -diff --git a/plugins/check_snmp_linkproof_nhr.pl b/plugins/check_snmp_linkproof_nhr.pl -index b6dba28..d83932e 100755 ---- a/plugins/check_snmp_linkproof_nhr.pl -+++ b/plugins/check_snmp_linkproof_nhr.pl -@@ -34,6 +34,7 @@ - my $o_host = undef; # hostname - my $o_community = undef; # community - my $o_port = 161; # port -+my $o_domain = 'udp/ipv4'; # protocol - my $o_help = undef; # wan't some help ? - my $o_verb = undef; # verbose mode - my $o_version = undef; # print version -@@ -98,6 +99,14 @@ sub help { - : Priv protocole (des|aes : default des) - -P, --port=PORT - SNMP port (Default 161) -+--protocol=PROTOCOL -+ Network protocol to be used -+ ['udp/ipv4'] : UDP over IPv4 -+ 'udp/ipv6' : UDP over IPv6 -+ 'tcp/ipv4' : TCP over IPv4 -+ 'tcp/ipv6' : TCP over IPv6 -+ -+ Network protocol (Default udp/ipv4) - -f, --perfparse, --perfdata - Performance data output - -t, --timeout=INTEGER -@@ -121,6 +130,7 @@ sub check_options { - 'hostname:s' => \$o_host, - 'p:i' => \$o_port, - 'port:i' => \$o_port, -+ 'protocol:s' => \$o_domain, - 'C:s' => \$o_community, - 'community:s' => \$o_community, - 'l:s' => \$o_login, -@@ -215,7 +225,8 @@ sub check_options { - -username => $o_login, - -authpassword => $o_passwd, - -authprotocol => $o_authproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - verb("SNMPv3 AuthPriv login : $o_login, $o_authproto, $o_privproto"); -@@ -228,7 +239,8 @@ sub check_options { - -authprotocol => $o_authproto, - -privpassword => $o_privpass, - -privprotocol => $o_privproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } else { -@@ -241,7 +253,8 @@ sub check_options { - -version => 2, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - -@@ -251,7 +264,8 @@ sub check_options { - -hostname => $o_host, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } -diff --git a/plugins/check_snmp_nsbox.pl b/plugins/check_snmp_nsbox.pl -index 97da635..3e7bfcb 100755 ---- a/plugins/check_snmp_nsbox.pl -+++ b/plugins/check_snmp_nsbox.pl -@@ -42,6 +42,7 @@ - my $o_host = undef; # hostname - my $o_community = undef; # community - my $o_port = 161; # port -+my $o_domain = 'udp/ipv4'; # protocol - my $o_help = undef; # wan't some help ? - my $o_verb = undef; # verbose mode - my $o_version = undef; # print version -@@ -125,6 +126,14 @@ sub help { - number of diode and vhost that must be up. - -P, --port=PORT - SNMP port (Default 161) -+--protocol=PROTOCOL -+ Network protocol to be used -+ ['udp/ipv4'] : UDP over IPv4 -+ 'udp/ipv6' : UDP over IPv6 -+ 'tcp/ipv4' : TCP over IPv4 -+ 'tcp/ipv6' : TCP over IPv6 -+ -+ Network protocol (Default udp/ipv4) - -f, --perfparse, --perfdata - Performance data output - -t, --timeout=INTEGER -@@ -148,6 +157,7 @@ sub check_options { - 'hostname:s' => \$o_host, - 'p:i' => \$o_port, - 'port:i' => \$o_port, -+ 'protocol:s' => \$o_domain, - 'C:s' => \$o_community, - 'community:s' => \$o_community, - 'l:s' => \$o_login, -@@ -270,7 +280,8 @@ sub check_options { - -username => $o_login, - -authpassword => $o_passwd, - -authprotocol => $o_authproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - verb("SNMPv3 AuthPriv login : $o_login, $o_authproto, $o_privproto"); -@@ -283,7 +294,8 @@ sub check_options { - -authprotocol => $o_authproto, - -privpassword => $o_privpass, - -privprotocol => $o_privproto, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } else { -@@ -296,7 +308,8 @@ sub check_options { - -version => 2, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - -@@ -306,7 +319,8 @@ sub check_options { - -hostname => $o_host, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } -diff --git a/plugins/check_snmp_vrrp.pl b/plugins/check_snmp_vrrp.pl -index b6d4d44..f9c19ec 100755 ---- a/plugins/check_snmp_vrrp.pl -+++ b/plugins/check_snmp_vrrp.pl -@@ -89,6 +89,7 @@ - my $o_community = undef; # community - my $o_version2 = undef; #use snmp v2c - my $o_port = 161; # port -+my $o_domain = 'udp/ipv4'; # protocol - my $o_help = undef; # wan't some help ? - my $o_verb = undef; # verbose mode - my $o_version = undef; # print version -@@ -147,6 +148,14 @@ sub help { - : Priv protocole (des|aes : default des) - -P, --port=PORT - SNMP port (Default 161) -+--protocol=PROTOCOL -+ Network protocol to be used -+ ['udp/ipv4'] : UDP over IPv4 -+ 'udp/ipv6' : UDP over IPv6 -+ 'tcp/ipv4' : TCP over IPv4 -+ 'tcp/ipv6' : TCP over IPv6 -+ -+ Network protocol (Default udp/ipv4) - -T, --type= - Type of vrrp router to check - nokia (default) : Nokia vrrp. Should be working for most vrrp routers -@@ -187,6 +196,7 @@ sub check_options { - 'hostname:s' => \$o_host, - 'p:i' => \$o_port, - 'port:i' => \$o_port, -+ 'protocol:s' => \$o_domain, - 'C:s' => \$o_community, - 'community:s' => \$o_community, - 't:i' => \$o_timeout, -@@ -317,7 +327,8 @@ sub check_options { - -authpassword => $o_passwd, - -authprotocol => $o_authproto, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - verb("SNMPv3 AuthPriv login : $o_login, $o_authproto, $o_privproto"); -@@ -330,7 +341,8 @@ sub check_options { - -privpassword => $o_privpass, - -privprotocol => $o_privproto, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } else { -@@ -343,7 +355,8 @@ sub check_options { - -version => 2, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - -@@ -353,7 +366,8 @@ sub check_options { - -hostname => $o_host, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } -diff --git a/plugins/check_snmp_win.pl b/plugins/check_snmp_win.pl -index c5cb573..1240b46 100755 ---- a/plugins/check_snmp_win.pl -+++ b/plugins/check_snmp_win.pl -@@ -50,6 +50,7 @@ - my $o_host = undef; # hostname - my $o_community = undef; # community - my $o_port = 161; # port -+my $o_domain = 'udp/ipv4'; # protocol - my $o_version2 = undef; # use snmp v2c - my $o_descr = undef; # description filter - my @o_descrL = undef; # Service descriprion list. -@@ -115,6 +116,14 @@ sub help { - Password for snmpv3 authentication - -p, --port=PORT - SNMP port (Default 161) -+--protocol=PROTOCOL -+ Network protocol to be used -+ ['udp/ipv4'] : UDP over IPv4 -+ 'udp/ipv6' : UDP over IPv6 -+ 'tcp/ipv4' : TCP over IPv4 -+ 'tcp/ipv6' : TCP over IPv6 -+ -+ Network protocol (Default udp/ipv4) - -T, --type=service - Check type : - - service (default) checks service -@@ -173,6 +182,7 @@ sub check_options { - 'hostname:s' => \$o_host, - 'p:i' => \$o_port, - 'port:i' => \$o_port, -+ 'protocol:s' => \$o_domain, - 'C:s' => \$o_community, - 'community:s' => \$o_community, - 'l:s' => \$o_login, -@@ -265,7 +275,8 @@ sub check_options { - -authpassword => $o_passwd, - -authprotocol => 'md5', - -privpassword => $o_passwd, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - if (defined($o_version2)) { -@@ -276,7 +287,8 @@ sub check_options { - -version => 2, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } else { - -@@ -285,7 +297,8 @@ sub check_options { - -hostname => $o_host, - -community => $o_community, - -port => $o_port, -- -timeout => $o_timeout -+ -timeout => $o_timeout, -+ -domain => $o_domain - ); - } - } diff --git a/debian/patches/25_check_snmp_int_add_metrik b/debian/patches/25_check_snmp_int_add_metrik deleted file mode 100644 index 0a0646d..0000000 --- a/debian/patches/25_check_snmp_int_add_metrik +++ /dev/null @@ -1,82 +0,0 @@ -From a0f606c2c29d1f5588fab0b464a7e905f3872255 Mon Sep 17 00:00:00 2001 -From: Patrick Grimm -Date: Mon, 11 Mar 2024 18:28:15 +0100 -Subject: [PATCH] add metrik for Interface speed K|M|G Bits/s and more comments - ---- - doc/04-Plugins.md | 2 ++ - plugins/check_snmp_int.pl | 20 ++++++++++++-------- - 2 files changed, 14 insertions(+), 8 deletions(-) - -diff --git a/doc/04-Plugins.md b/doc/04-Plugins.md -index bf2a593..21b672a 100644 ---- a/doc/04-Plugins.md -+++ b/doc/04-Plugins.md -@@ -211,10 +211,12 @@ Usage: ./check_snmp_int.pl [-v] -H -C [-2] | (-l login - - warning level for input / output bandwidth (0 for no warning) - unit depends on B,M,G,u options and interface speed is in bps - warning for error & discard input / output in error/min (need -q) -+ warning level for interface speed only in K|M|G Bits/s (0 for no warning) - -c, --critical=input,output[,error in,error out,discard in,discard out,interface speed] - critical level for input / output bandwidth (0 for no critical) - unit depends on B,M,G,u options and interface speed is in bps - critical for error & discard input / output in error/min (need -q) -+ critical level for interface speed only in K|M|G Bits/s (0 for no critical) - -s, --short=int - Make the output shorter : only the first chars of the interface(s) - If the number is negative, then get the LAST caracters. -diff --git a/plugins/check_snmp_int.pl b/plugins/check_snmp_int.pl -index d978c66..fd45a61 100755 ---- a/plugins/check_snmp_int.pl -+++ b/plugins/check_snmp_int.pl -@@ -266,10 +266,12 @@ sub help { - warning level for input / output bandwidth (0 for no warning) - unit depends on B,M,G,u options - warning for error & discard input / output in error/min (need -q) -+ warning level for interface speed only in K|M|G Bits/s (0 for no warning) - -c, --critical=input,output[,error in,error out,discard in,discard out,interface speed] - critical level for input / output bandwidth (0 for no critical) - unit depends on B,M,G,u options - critical for error & discard input / output in error/min (need -q) -+ critical level for interface speed only in K|M|G Bits/s (0 for no critical) - -s, --short=int - Make the output shorter : only the first chars of the interface(s) - If the number is negative, then get the LAST caracters. -@@ -955,16 +957,18 @@ sub check_options { - if ($l == 0 || $l == 1) { $print_out .= $speed_unit; } - } - if (defined($o_perfs) && defined($o_ext_checkperf)) { -+ my $warn_factor = (defined($o_meg)) ? 1000000 : (defined($o_gig)) ? 1000000000 : 1000; - $print_out .= "/"; -- if (defined($o_crit[6]) && ($o_crit[6] != 0) && ($speed_real < $o_crit[6])) { -+ if (defined($o_crit[6]) && ($o_crit[6] != 0) && ($speed_real / $warn_factor < $o_crit[6])) { - $final_status = 2; -- $print_out .= sprintf("CRIT %.0fbps", $speed_real); -- } elsif (defined($o_warn[6]) && ($o_warn[6] != 0) && ($speed_real < $o_warn[6])) { -+ $print_out .= sprintf("CRIT %.0f", $speed_real / $warn_factor); -+ } elsif (defined($o_warn[6]) && ($o_warn[6] != 0) && ($speed_real / $warn_factor < $o_warn[6])) { - $final_status = ($final_status == 2) ? 2 : 1; -- $print_out .= sprintf("WARN %.0fbps", $speed_real); -+ $print_out .= sprintf("WARN %.0f", $speed_real / $warn_factor); - } else { -- $print_out .= sprintf("%.0fbps", $speed_real); -+ $print_out .= sprintf("%.0f", $speed_real / $warn_factor); - } -+ $print_out .= (defined($o_meg)) ? "Mbps" : (defined($o_gig)) ? "Gbps" : "kbps"; - } - $print_out .= ")"; - } else { # Return unknown when no data -@@ -1058,10 +1062,10 @@ sub check_options { - $perf_out .= "'" . $descr[$i] . "_out_discard'=" . $$result{ $oid_perf_outdisc[$i] } . "c "; - } - if (defined($o_perfs)) { -- $speed_real = "" unless (defined($speed_real)); -+ my $warn_factor = (defined($o_meg)) ? 1000000 : (defined($o_gig)) ? 1000000000 : 1000; - $perf_out .= "'" . $descr[$i] . "_speed_bps'=" . $speed_real . ";"; -- $perf_out .= defined($o_warn[6]) ? $o_warn[6] . ";" : ";"; -- $perf_out .= defined($o_crit[6]) ? $o_crit[6] . ";" : ";"; -+ $perf_out .= defined($o_warn[6]) ? $o_warn[6] * $warn_factor . ";" : ";"; -+ $perf_out .= defined($o_crit[6]) ? $o_crit[6] * $warn_factor . ";" : ";"; - $perf_out .= "; "; - } - if (defined($o_weather) && $usable_data == 1) { diff --git a/debian/patches/series b/debian/patches/series index cf15b22..7d425b5 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -11,8 +11,5 @@ 20_check_snmp_int_avaid_huge_amount_of_regex 21_check_snmp_load_update_fortiswitch_and_fortigate4.3 22_check_snmp_storage_fix_space_btrfs -23_check_snmp_int_interface_speed -24_tcp_udp_ipv4_ipv6 -25_check_snmp_int_add_metrik 50_disable_epn 51_fix_privacy_doc