[pkg-nagios-changes] [Git][nagios-team/nagios-snmp-plugins][master] 7 commits: Remove constraints unnecessary since buster (oldstable)

Jan Wagner (@waja) gitlab at salsa.debian.org
Fri Jan 13 11:13:08 GMT 2023



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


Commits:
16004b91 by Debian Janitor at 2023-01-13T10:40:12+00:00
Remove constraints unnecessary since buster (oldstable)

* nagios-snmp-plugins: Drop dependency on essential package perl-base (>= 5.8.4-8) in Depends.

Changes-By: deb-scrub-obsolete

- - - - -
ea50f546 by Jan Wagner at 2023-01-13T10:40:49+00:00
Bump debhelper from old 12 to 13.

Changes-By: lintian-brush
Fixes: lintian: package-uses-old-debhelper-compat-version
See-also: https://lintian.debian.org/tags/package-uses-old-debhelper-compat-version.html

- - - - -
4f38dec7 by Jan Wagner at 2023-01-13T10:41:04+00:00
Update standards version to 4.6.2, no changes needed.

Changes-By: lintian-brush
Fixes: lintian: out-of-date-standards-version
See-also: https://lintian.debian.org/tags/out-of-date-standards-version.html

- - - - -
a193b79f by Jan Wagner at 2023-01-13T10:46:13+00:00
Adding d/p/19_check_snmp_int_remove_unneeded_my from upstream

- - - - -
fdc0108a by Jan Wagner at 2023-01-13T10:48:13+00:00
Adding d/p/20_check_snmp_int_avaid_huge_amount_of_regex from upstream

- - - - -
d4bd9c98 by Jan Wagner at 2023-01-13T10:50:17+00:00
Adding d/p/21_check_snmp_load_update_fortiswitch_and_fortigate4.3 from upstream

- - - - -
f4939717 by Jan Wagner at 2023-01-13T11:09:51+00:00
Merge branch 'master' into development

- - - - -


5 changed files:

- debian/control
- + debian/patches/19_check_snmp_int_remove_unneeded_my
- + debian/patches/20_check_snmp_int_avaid_huge_amount_of_regex
- + debian/patches/21_check_snmp_load_update_fortiswitch_and_fortigate4.3
- debian/patches/series


Changes:

=====================================
debian/control
=====================================
@@ -3,8 +3,8 @@ Section: net
 Priority: optional
 Maintainer: Debian Nagios Maintainer Group <pkg-nagios-devel at lists.alioth.debian.org>
 Uploaders: Jan Wagner <waja at cyconet.org>
-Build-Depends: debhelper-compat (= 12)
-Standards-Version: 4.6.1
+Build-Depends: debhelper-compat (= 13)
+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


=====================================
debian/patches/19_check_snmp_int_remove_unneeded_my
=====================================
@@ -0,0 +1,23 @@
+From 524e0eec7407bb0f650e28aa3d26e16028b86e54 Mon Sep 17 00:00:00 2001
+From: Steffen Schoch <dein at gehirn-mag.net>
+Date: Tue, 27 Apr 2021 06:14:34 +0200
+Subject: [PATCH] Update check_snmp_int.pl
+
+Removed unneeded my
+---
+ plugins/check_snmp_int.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/plugins/check_snmp_int.pl b/plugins/check_snmp_int.pl
+index 5fe752e..271cfbc 100755
+--- a/plugins/check_snmp_int.pl
++++ b/plugins/check_snmp_int.pl
+@@ -1038,7 +1038,7 @@ sub check_options {
+             $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_discard'=" . $$result{ $oid_perf_outdisc[$i] } . "c ";
+         }
+         if (defined($o_perfs)) {
+-	    my $speed_real = "" unless (defined($speed_real));
++	    $speed_real = "" unless (defined($speed_real));
+             $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_speed_bps'=" . $speed_real . " ";
+         }
+         if (defined($o_weather) && $usable_data == 1) {


=====================================
debian/patches/20_check_snmp_int_avaid_huge_amount_of_regex
=====================================
@@ -0,0 +1,93 @@
+From c591f7d56378cbb40f1c3c23cbf23a8669a45730 Mon Sep 17 00:00:00 2001
+From: kwork-er <88452982+kwork-er at users.noreply.github.com>
+Date: Thu, 5 Aug 2021 21:53:43 +0200
+Subject: [PATCH] Update check_snmp_int.pl
+
+Effectively reverting commit 9f9b15a926d8795935b54626dc3ab9e5becb2763 and doing it in a different way that avoids adding huge amounts of regex, that may not run on older systems.
+Removed the added " =~ s/\./_/r ", instead replacing the dots (.) in the regex that was meant for it in the first place -> line 967.
+---
+ plugins/check_snmp_int.pl | 28 ++++++++++++++--------------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/plugins/check_snmp_int.pl b/plugins/check_snmp_int.pl
+index 271cfbc..71f8d14 100755
+--- a/plugins/check_snmp_int.pl
++++ b/plugins/check_snmp_int.pl
+@@ -964,7 +964,7 @@ sub check_options {
+     }
+ 
+     # Get rid of special caracters for performance in description
+-    $descr[$i] =~ s/'\/\(\)/_/g;
++    $descr[$i] =~ s/['\/\(\).]/_/g;
+     if (($int_status == $ok_val) || (defined($o_down) && $int_status == 2) || (defined($o_dormant) && $int_status == 5))
+     {
+         $num_ok++;
+@@ -979,12 +979,12 @@ sub check_options {
+                     $warn_factor /= $speed_real;
+                     $warn_factor *= 100;    # now turn into displayed % : 0,1 = 10%
+                 }
+-                $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_in_prct'=";
++                $perf_out .= "'" . $descr[$i] . "_in_prct'=";
+                 $perf_out .= sprintf("%.0f", $checkperf_out_raw[0] * 800 / $speed_real) . "%;";
+                 $perf_out .= ($o_warn[0] != 0) ? sprintf("%.0f", $o_warn[0] * $warn_factor) . ";" : ";";
+                 $perf_out .= ($o_crit[0] != 0) ? sprintf("%.0f", $o_crit[0] * $warn_factor) . ";" : ";";
+                 $perf_out .= "0;100 ";
+-                $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_prct'=";
++                $perf_out .= "'" . $descr[$i] . "_out_prct'=";
+                 $perf_out .= sprintf("%.0f", $checkperf_out_raw[1] * 800 / $speed_real) . "%;";
+                 $perf_out .= ($o_warn[1] != 0) ? sprintf("%.0f", $o_warn[1] * $warn_factor) . ";" : ";";
+                 $perf_out .= ($o_crit[1] != 0) ? sprintf("%.0f", $o_crit[1] * $warn_factor) . ";" : ";";
+@@ -1000,12 +1000,12 @@ sub check_options {
+                     } else {                   # just convert from K|M|G bps
+                         $warn_factor = (defined($o_meg)) ? 1000000 : (defined($o_gig)) ? 1000000000 : 1000;
+                     }
+-                    $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_in_bps'=";
++                    $perf_out .= "'" . $descr[$i] . "_in_bps'=";
+                     $perf_out .= sprintf("%.0f", $checkperf_out_raw[0] * 8) . ";";
+                     $perf_out .= ($o_warn[0] != 0) ? $o_warn[0] * $warn_factor . ";" : ";";
+                     $perf_out .= ($o_crit[0] != 0) ? $o_crit[0] * $warn_factor . ";" : ";";
+                     $perf_out .= "0;" . $speed_real . " ";
+-                    $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_bps'=";
++                    $perf_out .= "'" . $descr[$i] . "_out_bps'=";
+                     $perf_out .= sprintf("%.0f", $checkperf_out_raw[1] * 8) . ";";
+                     $perf_out .= ($o_warn[1] != 0) ? $o_warn[1] * $warn_factor . ";" : ";";
+                     $perf_out .= ($o_crit[1] != 0) ? $o_crit[1] * $warn_factor . ";" : ";";
+@@ -1017,29 +1017,29 @@ sub check_options {
+                     } else {                   # just convert from K|M|G bps
+                         $warn_factor = (defined($o_meg)) ? 1048576 : (defined($o_gig)) ? 1073741824 : 1024;
+                     }
+-                    $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_in_Bps'=" . sprintf("%.0f", $checkperf_out_raw[0]) . ";";
++                    $perf_out .= "'" . $descr[$i] . "_in_Bps'=" . sprintf("%.0f", $checkperf_out_raw[0]) . ";";
+                     $perf_out .= ($o_warn[0] != 0) ? $o_warn[0] * $warn_factor . ";" : ";";
+                     $perf_out .= ($o_crit[0] != 0) ? $o_crit[0] * $warn_factor . ";" : ";";
+                     $perf_out .= "0;" . $speed_real / 8 . " ";
+-                    $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_Bps'=" . sprintf("%.0f", $checkperf_out_raw[1]) . ";";
++                    $perf_out .= "'" . $descr[$i] . "_out_Bps'=" . sprintf("%.0f", $checkperf_out_raw[1]) . ";";
+                     $perf_out .= ($o_warn[1] != 0) ? $o_warn[1] * $warn_factor . ";" : ";";
+                     $perf_out .= ($o_crit[1] != 0) ? $o_crit[1] * $warn_factor . ";" : ";";
+                     $perf_out .= "0;" . $speed_real / 8 . " ";
+                 }
+             }
+         } else {    # output in octet counter
+-            $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_in_octet'=" . $$result{ $oid_perf_inoct[$i] } . "c ";
+-            $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_octet'=" . $$result{ $oid_perf_outoct[$i] } . "c ";
++            $perf_out .= "'" . $descr[$i] . "_in_octet'=" . $$result{ $oid_perf_inoct[$i] } . "c ";
++            $perf_out .= "'" . $descr[$i] . "_out_octet'=" . $$result{ $oid_perf_outoct[$i] } . "c ";
+         }
+         if (defined($o_perfe)) {
+-            $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_in_error'=" . $$result{ $oid_perf_inerr[$i] } . "c ";
+-            $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_in_discard'=" . $$result{ $oid_perf_indisc[$i] } . "c ";
+-            $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_error'=" . $$result{ $oid_perf_outerr[$i] } . "c ";
+-            $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_out_discard'=" . $$result{ $oid_perf_outdisc[$i] } . "c ";
++            $perf_out .= "'" . $descr[$i] . "_in_error'=" . $$result{ $oid_perf_inerr[$i] } . "c ";
++            $perf_out .= "'" . $descr[$i] . "_in_discard'=" . $$result{ $oid_perf_indisc[$i] } . "c ";
++            $perf_out .= "'" . $descr[$i] . "_out_error'=" . $$result{ $oid_perf_outerr[$i] } . "c ";
++            $perf_out .= "'" . $descr[$i] . "_out_discard'=" . $$result{ $oid_perf_outdisc[$i] } . "c ";
+         }
+         if (defined($o_perfs)) {
+ 	    $speed_real = "" unless (defined($speed_real));
+-            $perf_out .= "'" . $descr[$i] =~ s/\./_/r . "_speed_bps'=" . $speed_real . " ";
++            $perf_out .= "'" . $descr[$i] . "_speed_bps'=" . $speed_real . " ";
+         }
+         if (defined($o_weather) && $usable_data == 1) {
+             $perf_out .= "in=" . sprintf("%.0f", $checkperf_out_raw[0]) . ";;;0;" . sprintf("%.0f", $speed_real / 8) . " ";


=====================================
debian/patches/21_check_snmp_load_update_fortiswitch_and_fortigate4.3
=====================================
@@ -0,0 +1,90 @@
+From 946bd37f5632fead9382f05a3600f0328dae53a1 Mon Sep 17 00:00:00 2001
+From: Martin Botka <16738302+Haxk20 at users.noreply.github.com>
+Date: Mon, 1 Aug 2022 12:14:37 +0200
+Subject: [PATCH] check_snmp_load.pl: Add Fortiswitch & 4.3+ firmware fortigate
+
+This commit adds support for checking the fortiswitch CPU usage
+and also fortigate 4.3 and above firmware. This OID got changed but to keep
+backwards compatibility and not to break already running platforms depending on this
+the new OID was added as new type.
+
+Signed-off-by: Martin Botka <martin.botka at somainline.org>
+---
+ plugins/check_snmp_load.pl | 21 ++++++++++++++-------
+ 1 file changed, 14 insertions(+), 7 deletions(-)
+
+diff --git a/plugins/check_snmp_load.pl b/plugins/check_snmp_load.pl
+index 0959f6a..ecafb59 100755
+--- a/plugins/check_snmp_load.pl
++++ b/plugins/check_snmp_load.pl
+@@ -81,6 +81,12 @@
+ # Fortigate CPU
+ my $fortigate_cpu = ".1.3.6.1.4.1.12356.1.8.0";               # Fortigate CPU % usage
+ 
++# Fortigate CPU
++my $fortigate43_cpu = "1.3.6.1.4.1.12356.101.4.1.3.0";        # Fortigate 4.3 firmware CPU % usage
++
++# Fortigate CPU
++my $fortiswitch_cpu = ".1.3.6.1.4.1.12356.106.4.1.2.0";       # Fortiswitch CPU % usage
++
+ # Linkproof Appliance
+ my $linkproof_cpu = "1.3.6.1.4.1.89.35.1.55.0";               # CPU RE (Routing Engine Tasks)
+ 
+@@ -95,12 +101,12 @@
+ 
+ # valid values
+ my @valid_types
+-    = ("stand", "netsc", "netsl", "as400", "cisco", "cata", "cisg", "nsc", "fg", "bc", "nokia", "hp", "lp", "hpux", "n5k");
++    = ("stand", "netsc", "netsl", "as400", "cisco", "cata", "cisg", "nsc", "fg", "fg43", "fs", "bc", "nokia", "hp", "lp", "hpux", "n5k");
+ 
+ # CPU OID array
+ my %cpu_oid = (
+     "netsc", $ns_cpu_idle,  "as400", $as400_cpu,     "bc", $bluecoat_cpu,  "nokia", $nokia_cpu,
+-    "hp",    $procurve_cpu, "lp",    $linkproof_cpu, "fg", $fortigate_cpu, "n5k",   $n5k_cpu
++    "hp",    $procurve_cpu, "lp",    $linkproof_cpu, "fg", $fortigate_cpu, "fg43", $fortigate43_cpu, "fs", $fortiswitch_cpu, "n5k",   $n5k_cpu
+ );
+ 
+ # Globals
+@@ -113,7 +119,7 @@
+ my $o_verb      = undef;         # verbose mode
+ my $o_version   = undef;         # print version
+ 
+-# check type  : stand | netsc |  netsl | as400 | cisco | cata | cisg | nsc | fg | bc | nokia | hp | lp  | hpux
++# check type  : stand | netsc |  netsl | as400 | cisco | cata | cisg | nsc | fg | fg43| fs | bc | nokia | hp | lp  | hpux
+ my $o_check_type = "stand";
+ 
+ # End compatibility
+@@ -139,7 +145,7 @@
+ 
+ sub print_usage {
+     print
+-"Usage: $0 [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>])  [-p <port>] [-P <protocol>] -w <warn level> -c <crit level> -T=[stand|netsl|netsc|as400|cisco|cata|cisg|nsc|fg|bc|nokia|hp|lp|hpux] [-f] [-t <timeout>] [-V]\n";
++"Usage: $0 [-v] -H <host> -C <snmp_community> [-2] | (-l login -x passwd [-X pass -L <authp>,<privp>])  [-p <port>] [-P <protocol>] -w <warn level> -c <crit level> -T=[stand|netsl|netsc|as400|cisco|cata|cisg|nsc|fg|fg43|fs|bc|nokia|hp|lp|hpux] [-f] [-t <timeout>] [-V]\n";
+ }
+ 
+ sub isnnum {                     # Return true if arg is not a number
+@@ -201,6 +207,8 @@ sub help {
+ 		cisg  : Cisco small business (SG500) CPU usage (1,5 & 15 minutes values)
+ 		nsc   : NetScreen CPU usage
+ 		fg    : Fortigate CPU usage
++		fg43  : Fortigate CPU usage for 4.3 firmware
++		fs    : Fortiswitch CPU usage
+ 		bc    : Bluecoat CPU usage
+ 		nokia : Nokia CPU usage
+ 		hp    : HP procurve switch CPU usage
+@@ -806,8 +814,8 @@ sub is_legacy_snmp_version {
+     exit $exit_val;
+ }
+ 
+-################## CPU for : AS/400 , Netsnmp, HP, Bluecoat, linkproof, fortigate  ###########
+-if ($o_check_type =~ /netsc|as400|bc|nokia|^hp$|lp|fg/) {
++################## CPU for : AS/400 , Netsnmp, HP, Bluecoat, linkproof, fortigate, fortigate43, fortiswitch  ###########
++if ($o_check_type =~ /netsc|as400|bc|nokia|^hp$|lp|fg|fg43|fs/) {
+ 
+     # Get load table
+     my @oidlist = $cpu_oid{$o_check_type};
+@@ -965,4 +973,3 @@ sub is_legacy_snmp_version {
+     ? print " | cpu_prct_used=$cpu_used%;$o_warn;$o_crit\n"
+     : print "\n";
+ exit $exit_val;
+-


=====================================
debian/patches/series
=====================================
@@ -7,5 +7,8 @@
 16_check_snmp_win_max_message_size
 17_check_snmp_storage_okifempty
 18_check_snmp_int_fix_perf_out
+19_check_snmp_int_remove_unneeded_my
+20_check_snmp_int_avaid_huge_amount_of_regex
+21_check_snmp_load_update_fortiswitch_and_fortigate4.3
 50_disable_epn
 51_fix_privacy_doc



View it on GitLab: https://salsa.debian.org/nagios-team/nagios-snmp-plugins/-/compare/7456f80b015fa980daff1c66ea013b9c73495483...f4939717cc28b910b160b9879458c659ee0d8289

-- 
View it on GitLab: https://salsa.debian.org/nagios-team/nagios-snmp-plugins/-/compare/7456f80b015fa980daff1c66ea013b9c73495483...f4939717cc28b910b160b9879458c659ee0d8289
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/20230113/8fe4d844/attachment-0001.htm>


More information about the pkg-nagios-changes mailing list