From f82efb477b419371aed75edfdd5aa39cdafc3c3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 04:56:31 +0000 Subject: [PATCH 1/6] build(deps): bump dawidd6/action-debian-package from 1.5.0 to 1.6.0 Bumps [dawidd6/action-debian-package](https://github.com/dawidd6/action-debian-package) from 1.5.0 to 1.6.0. - [Release notes](https://github.com/dawidd6/action-debian-package/releases) - [Commits](https://github.com/dawidd6/action-debian-package/compare/v1.5.0...v1.6.0) --- updated-dependencies: - dependency-name: dawidd6/action-debian-package dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/packaging_test.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/packaging_test.yml b/.github/workflows/packaging_test.yml index c478ef5..9aef0a7 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.5.0 + uses: dawidd6/action-debian-package@v1.6.0 with: artifacts_directory: debian/build/release/ os_distribution: testing diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f384f5e..9ae7df4 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.5.0 + uses: dawidd6/action-debian-package@v1.6.0 with: artifacts_directory: debian/build/release/ os_distribution: testing From 67af3233b6946e23c58999df7c8fcbf346e4e3b7 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Mon, 22 Jul 2024 22:19:46 +0200 Subject: [PATCH 2/6] Adding d/p/23_check_snmp_int_interface_speed from upsgtream --- .../patches/23_check_snmp_int_interface_speed | 138 ++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 139 insertions(+) create mode 100644 debian/patches/23_check_snmp_int_interface_speed diff --git a/debian/patches/23_check_snmp_int_interface_speed b/debian/patches/23_check_snmp_int_interface_speed new file mode 100644 index 0000000..a6db7cf --- /dev/null +++ b/debian/patches/23_check_snmp_int_interface_speed @@ -0,0 +1,138 @@ +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/series b/debian/patches/series index 7d425b5..9aee06e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -11,5 +11,6 @@ 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 50_disable_epn 51_fix_privacy_doc From d0702fa34d431a026339272028a6491d50824303 Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Mon, 22 Jul 2024 22:22:50 +0200 Subject: [PATCH 3/6] Adding d/p/24_tcp_udp_ipv4_ipv6 from upsgtream --- debian/patches/24_tcp_udp_ipv4_ipv6 | 761 ++++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 762 insertions(+) create mode 100644 debian/patches/24_tcp_udp_ipv4_ipv6 diff --git a/debian/patches/24_tcp_udp_ipv4_ipv6 b/debian/patches/24_tcp_udp_ipv4_ipv6 new file mode 100644 index 0000000..92efe5f --- /dev/null +++ b/debian/patches/24_tcp_udp_ipv4_ipv6 @@ -0,0 +1,761 @@ +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/series b/debian/patches/series index 9aee06e..1181284 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -12,5 +12,6 @@ 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 50_disable_epn 51_fix_privacy_doc From 5638743330bc33715ac6fe929f09f0a9bba122ce Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Mon, 22 Jul 2024 22:24:52 +0200 Subject: [PATCH 4/6] Adding d/p/25_check_snmp_int_add_metrik from upsgtream --- debian/patches/25_check_snmp_int_add_metrik | 82 +++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 83 insertions(+) create mode 100644 debian/patches/25_check_snmp_int_add_metrik diff --git a/debian/patches/25_check_snmp_int_add_metrik b/debian/patches/25_check_snmp_int_add_metrik new file mode 100644 index 0000000..0a0646d --- /dev/null +++ b/debian/patches/25_check_snmp_int_add_metrik @@ -0,0 +1,82 @@ +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 1181284..cf15b22 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -13,5 +13,6 @@ 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 From 6db06234ca44a652dcddf9c46b9d41320fcad52e Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Tue, 23 Jul 2024 07:45:16 +0200 Subject: [PATCH 5/6] Prepare release --- debian/changelog | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index fd83155..de0b496 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,14 @@ -nagios-snmp-plugins (2.1.0-4) UNRELEASED; urgency=medium +nagios-snmp-plugins (2.1.0-4) unstable; urgency=medium - * + [ Bas Couwenberg ] + * [13ac6fb] Explicitly enable test-build-twice job. - -- Jan Wagner Mon, 23 Jan 2023 14:23:45 +0000 + [ 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 nagios-snmp-plugins (2.1.0-3) unstable; urgency=medium From 0ce061bcc4b7b6cc8e523bb26f5c46821ec0d37e Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Tue, 23 Jul 2024 08:00:29 +0200 Subject: [PATCH 6/6] New changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index de0b496..8275298 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +nagios-snmp-plugins (2.1.0-5) UNRELEASED; urgency=medium + + * + + -- Jan Wagner Tue, 23 Jul 2024 08:00:17 +0200 + nagios-snmp-plugins (2.1.0-4) unstable; urgency=medium [ Bas Couwenberg ]