[pkg-nagios-changes] [Git][nagios-team/nagios-snmp-plugins][master] 3 commits: Adding d/p/23_check_snmp_int_interface_speed from upsgtream

Jan Wagner (@waja) gitlab at salsa.debian.org
Mon Jul 22 21:34:40 BST 2024



Jan Wagner pushed to branch master at Debian Nagios Maintainer Group / nagios-snmp-plugins


Commits:
67af3233 by Jan Wagner at 2024-07-22T22:19:46+02:00
Adding d/p/23_check_snmp_int_interface_speed from upsgtream

- - - - -
d0702fa3 by Jan Wagner at 2024-07-22T22:22:50+02:00
Adding d/p/24_tcp_udp_ipv4_ipv6 from upsgtream

- - - - -
56387433 by Jan Wagner at 2024-07-22T22:24:52+02:00
Adding d/p/25_check_snmp_int_add_metrik from upsgtream

- - - - -


4 changed files:

- + debian/patches/23_check_snmp_int_interface_speed
- + debian/patches/24_tcp_udp_ipv4_ipv6
- + debian/patches/25_check_snmp_int_add_metrik
- debian/patches/series


Changes:

=====================================
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 <host> -C <snmp_community> [-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 <n> 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 @@
+             <p class="SectionBody">When the extended checks are activated (-q 
+               option), the warning levels are <br>
+               -w <i><In bytes></i>,<i><Out bytes></i>,<i><In error></i>,<i><Out 
+-              error>,<i><In disc></i>,<i><Out disc></i></i> -c 
++              error>,<i><In disc></i>,<i><Out disc></i>,<i><Interface speed></i></i> -c 
+               <i><In warn></i>,<i><Out warn></i>, .....<br>
+               In error : warn/crit level in inboud <b>error/minute<br>
+               </b>Out error : warn/crit level in outbound error/minute<b> </b><br>
+               In disc : warn/crit level in inboud <b>discarded packets/minute<br>
+-              </b>Out disc : warn/crit level in outbound discarded packets/minute<b> 
+-              </b><br>
++              </b>Out disc : warn/crit level in outbound discarded packets/minute<b> </b><br>
++              Interface speed : warn/crit level of Interface speed <b>discarded bits/second<br>
++              </b>
+             </p>
+             <p class="SectionBody"><b>-k</b> : activates the standard usage feature<br>
+               <b>-q</b> : activates the extended usage<br>
+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) . " ";


=====================================
debian/patches/24_tcp_udp_ipv4_ipv6
=====================================
@@ -0,0 +1,761 @@
+From 394ade3c6b5816c4cbca09750cb01622d474e508 Mon Sep 17 00:00:00 2001
+From: Patrick Grimm <patrick at lunatiki.de>
+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 {
+    <privproto> : 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 {
+    <privproto> : 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 {
+    <privproto> : 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 {
+    <privproto> : 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 {
+    <privproto> : 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 {
+    <privproto> : 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 {
+    <privproto> : 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=<nokia|alteon|lp|nsc|ipso>
+    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
+         );
+     }
+ }


=====================================
debian/patches/25_check_snmp_int_add_metrik
=====================================
@@ -0,0 +1,82 @@
+From a0f606c2c29d1f5588fab0b464a7e905f3872255 Mon Sep 17 00:00:00 2001
+From: Patrick Grimm <patrick at lunatiki.de>
+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 <host> -C <snmp_community> [-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 <n> chars of the interface(s)
+    If the number is negative, then get the <n> 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 <n> chars of the interface(s)
+    If the number is negative, then get the <n> 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) {


=====================================
debian/patches/series
=====================================
@@ -11,5 +11,8 @@
 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



View it on GitLab: https://salsa.debian.org/nagios-team/nagios-snmp-plugins/-/compare/05b203575a9f0fe0f1fd1f97da6c638d0e6f9c7f...5638743330bc33715ac6fe929f09f0a9bba122ce

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://salsa.debian.org/nagios-team/nagios-snmp-plugins/-/compare/05b203575a9f0fe0f1fd1f97da6c638d0e6f9c7f...5638743330bc33715ac6fe929f09f0a9bba122ce
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-changes/attachments/20240722/38f315da/attachment-0001.htm>


More information about the pkg-nagios-changes mailing list