pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Import nagios plugins printer and snmp_environment
Module Name: pkgsrc-wip
Committed By: Edgar Fuß <ef%math.uni-bonn.de@localhost>
Pushed By: ef
Date: Tue Feb 9 18:17:29 2021 +0100
Changeset: 2de216f5043c8dfd0444bc803bfc5c503aa3b57b
Added Files:
nagios-plugin-printer/DESCR
nagios-plugin-printer/Makefile
nagios-plugin-printer/PLIST
nagios-plugin-printer/distinfo
nagios-plugin-printer/patches/patch-aa
nagios-plugin-snmp_environment/DESCR
nagios-plugin-snmp_environment/Makefile
nagios-plugin-snmp_environment/PLIST
nagios-plugin-snmp_environment/distinfo
nagios-plugin-snmp_environment/patches/patch-aa
Log Message:
Import nagios plugins printer and snmp_environment
Import nagios printer plugin (revision 363, from https://www.secure-computing.net/trac/export/${REVISION}/SCN%20Open%20Source/trunk/nagios/) as nagios-plugin-printer.
Import nagios snmp_environment plugin (version 0.7, from https://exchange.nagios.org/directory/Plugins/Hardware/Network-Gear/Cisco/Check-various-hardware-environmental-sensors/details) as nagios-plugin-snmp_environment.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=2de216f5043c8dfd0444bc803bfc5c503aa3b57b
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
nagios-plugin-printer/DESCR | 2 ++
nagios-plugin-printer/Makefile | 44 +++++++++++++++++++++++++
nagios-plugin-printer/PLIST | 2 ++
nagios-plugin-printer/distinfo | 7 ++++
nagios-plugin-printer/patches/patch-aa | 35 ++++++++++++++++++++
nagios-plugin-snmp_environment/DESCR | 21 ++++++++++++
nagios-plugin-snmp_environment/Makefile | 39 ++++++++++++++++++++++
nagios-plugin-snmp_environment/PLIST | 2 ++
nagios-plugin-snmp_environment/distinfo | 7 ++++
nagios-plugin-snmp_environment/patches/patch-aa | 37 +++++++++++++++++++++
10 files changed, 196 insertions(+)
diffs:
diff --git a/nagios-plugin-printer/DESCR b/nagios-plugin-printer/DESCR
new file mode 100644
index 0000000000..6d321b74f7
--- /dev/null
+++ b/nagios-plugin-printer/DESCR
@@ -0,0 +1,2 @@
+Perl script that retrieves supply metrics from printers using the snmpwalk
+command.
diff --git a/nagios-plugin-printer/Makefile b/nagios-plugin-printer/Makefile
new file mode 100644
index 0000000000..225897185b
--- /dev/null
+++ b/nagios-plugin-printer/Makefile
@@ -0,0 +1,44 @@
+# $NetBSD: Makefile $
+
+REVISION= 363
+PKGREVISION= 1
+PKGNAME= nagios-plugin-printer-${REVISION}
+COMMENT= Gather supply metrics from a printer via SNMP query
+CATEGORIES= sysutils net
+DISTNAME= check_printer
+EXTRACT_SUFX= # empty
+DIST_SUBDIR= check_printer-${REVISION}
+MASTER_SITES= https://www.secure-computing.net/trac/export/${REVISION}/SCN%20Open%20Source/trunk/nagios/
+LICENSE= 2-clause-bsd
+
+USE_LANGUAGES= # empty
+USE_TOOLS+= perl:run
+
+DEPENDS+= net-snmp-[0-9]*:../../net/net-snmp
+
+WRKSRC= ${WRKDIR}
+
+do-extract:
+ ${CP} ${DISTDIR}/${DIST_SUBDIR}/${DISTNAME} ${WRKSRC}
+
+PLUGINDIR= libexec/nagios
+PLIST_SUBST+= PLUGINDIR=${PLUGINDIR}
+
+INSTALLATION_DIRS+= ${PLUGINDIR}
+
+REPLACE_PERL+= ${WRKSRC}/check_printer
+
+SUBST_CLASSES+= paths
+SUBST_STAGE.paths= post-patch
+SUBST_MESSAGE.paths= Fixing paths
+SUBST_FILES.paths= check_printer
+SUBST_SED.paths= -e 's;@LIBDIR@;${PREFIX}/${PLUGINDIR};'
+SUBST_SED.paths+= -e 's;@PREFIX@;${PREFIX};'
+
+NO_BUILD= YES
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/check_printer ${DESTDIR}${PREFIX}/${PLUGINDIR}
+
+.include "../../mk/bsd.prefs.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/nagios-plugin-printer/PLIST b/nagios-plugin-printer/PLIST
new file mode 100644
index 0000000000..c919eca6ed
--- /dev/null
+++ b/nagios-plugin-printer/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST$
+${PLUGINDIR}/check_printer
diff --git a/nagios-plugin-printer/distinfo b/nagios-plugin-printer/distinfo
new file mode 100644
index 0000000000..056b25474f
--- /dev/null
+++ b/nagios-plugin-printer/distinfo
@@ -0,0 +1,7 @@
+$NetBSD$
+
+SHA1 (check_printer-363/check_printer) = d2b7d0f7ca09d2813aca9d0904f069337bb6fe53
+RMD160 (check_printer-363/check_printer) = 203afd4e7dab9dc76075ee8d75dcd3b50c21637e
+SHA512 (check_printer-363/check_printer) = 6f041eb8fdc24eb37fdeed731faa5f65d12abb6e420fb32eb428249eb40462a1ac31d72523315af4e16f1381d7fce647c2c973f737631aed9afd6de0cbd02ee3
+Size (check_printer-363/check_printer) = 10325 bytes
+SHA1 (patch-aa) = bea311f0c23785b02efde5733b8924829728125d
diff --git a/nagios-plugin-printer/patches/patch-aa b/nagios-plugin-printer/patches/patch-aa
new file mode 100644
index 0000000000..124271b094
--- /dev/null
+++ b/nagios-plugin-printer/patches/patch-aa
@@ -0,0 +1,35 @@
+$NetBSD: patch-aa$
+Replace 'use lib' logic by something that can be SUBST'd
+Make snmpwalk paths absolute
+
+--- check_printer.orig 2016-10-12 15:53:09.000000000 +0200
++++ check_printer 2016-10-12 16:00:37.000000000 +0200
+@@ -33,12 +33,7 @@
+ use strict;
+ use warnings;
+
+-my $OS = `uname`;
+-if ($OS =~ m/^\wBSD/){
+- use lib "/usr/local/libexec/nagios";
+-} elsif ($OS =~ m/Linux/){
+- use lib "/usr/local/nagios/libexec";
+-}
++use lib "@LIBDIR@";
+
+ use Data::Dumper;
+ use Getopt::Long;
+@@ -80,10 +75,10 @@
+
+ my $comm = $ARGV[1];
+
+-my @vars = ("snmpwalk -On -v 1 -c $community $host $base_oid.$name_oid",
+- "snmpwalk -On -v 1 -c $community $host $base_oid.$uom_oid",
+- "snmpwalk -On -v 1 -c $community $host $base_oid.$max_oid",
+- "snmpwalk -On -v 1 -c $community $host $base_oid.$curr_oid");
++my @vars = ("@PREFIX@/bin/snmpwalk -On -v 1 -c $community $host $base_oid.$name_oid",
++ "@PREFIX@/bin/snmpwalk -On -v 1 -c $community $host $base_oid.$uom_oid",
++ "@PREFIX@/bin/snmpwalk -On -v 1 -c $community $host $base_oid.$max_oid",
++ "@PREFIX@/bin/snmpwalk -On -v 1 -c $community $host $base_oid.$curr_oid");
+
+ my(@values, @names, @max, @min);
+
diff --git a/nagios-plugin-snmp_environment/DESCR b/nagios-plugin-snmp_environment/DESCR
new file mode 100644
index 0000000000..de8c0f1e59
--- /dev/null
+++ b/nagios-plugin-snmp_environment/DESCR
@@ -0,0 +1,21 @@
+Nagios plugin to check various hardware environmental sensors, like power
+supply's, fans, cards, modules etc. Cisco, Nokia, BlueCoat, IronPort, Foundry,
+Linux, Extreme, Juniper, HP ProCurve, NetScreen, Citrix and Transmode.
+
+Supported Checks:
+cisco Cisco Systems: Fan, power-supply, voltage, temperature
+ciscoSW Cisco Systems: Card and module status check
+ciscoNEW Cisco Systems: Sensor check for devices that have the
+ CISCO-ENTITY-SENSOR-MIB
+nokia Nokia IP: Fan, power-supply
+bc Blue Coat Systems: Fan, power-supply, voltage, disk
+iron IronPort: Fan, power-supply, temperature
+foundry Foundry Network: power supply, temperature
+linux lm-sensors: Fan, voltage, temperature, misc
+extremeSW Extreme Networks: Slot, power-supply, fan, temperature
+juniper Juniper Networks: Component status check
+procurve HP ProCurve: Fan, power-supply, temperature
+netscreen NetScreen: Slot, fan, power-supply
+citrix Citrix NetScaler: Fan, voltage, temperture, HA state, SSL engine
+transmode Transmode Systems: Check alarm table that is not deactivated and
+ not acknowledged
diff --git a/nagios-plugin-snmp_environment/Makefile b/nagios-plugin-snmp_environment/Makefile
new file mode 100644
index 0000000000..b78d83f67e
--- /dev/null
+++ b/nagios-plugin-snmp_environment/Makefile
@@ -0,0 +1,39 @@
+# $NetBSD: Makefile $
+
+VERSION= 0.7
+PKGREVISION= 1
+PKGNAME= nagios-plugin-snmp_environment-${VERSION}
+COMMENT= Check various hardware environmental sensors
+CATEGORIES= sysutils net
+HOMEPAGE= https://exchange.nagios.org/directory/Plugins/Hardware/Network-Gear/Cisco/Check-various-hardware-environmental-sensors/details
+
+EXTRACT_SUFX= # empty
+DIST_SUBDIR= check_snmp_environment-${VERSION}
+MASTER_SITES= -https://exchange.nagios.org/components/com_mtree/attachment.php?link_id=483&cf_id=24
+DISTNAME= check_snmp_environment.pl
+LICENSE= gnu-gpl-v3
+
+USE_LANGUAGES= # empty
+USE_TOOLS+= perl:run
+
+DEPENDS+= net-snmp-[0-9]*:../../net/net-snmp
+
+WRKSRC= ${WRKDIR}
+
+do-extract:
+ ${CP} ${DISTDIR}/${DIST_SUBDIR}/${DISTNAME} ${WRKSRC}
+
+PLUGINDIR= libexec/nagios
+PLIST_SUBST+= PLUGINDIR=${PLUGINDIR}
+
+INSTALLATION_DIRS+= ${PLUGINDIR}
+
+REPLACE_PERL+= ${WRKSRC}/check_snmp_environment.pl
+
+NO_BUILD= YES
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/check_snmp_environment.pl ${DESTDIR}${PREFIX}/${PLUGINDIR}/check_snmp_environment
+
+.include "../../mk/bsd.prefs.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/nagios-plugin-snmp_environment/PLIST b/nagios-plugin-snmp_environment/PLIST
new file mode 100644
index 0000000000..77b595e79b
--- /dev/null
+++ b/nagios-plugin-snmp_environment/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST$
+${PLUGINDIR}/check_snmp_environment
diff --git a/nagios-plugin-snmp_environment/distinfo b/nagios-plugin-snmp_environment/distinfo
new file mode 100644
index 0000000000..7768f9df7c
--- /dev/null
+++ b/nagios-plugin-snmp_environment/distinfo
@@ -0,0 +1,7 @@
+$NetBSD$
+
+SHA1 (check_snmp_environment-0.7/check_snmp_environment.pl) = b73ce7ea9b4170aa3aba74571ca1745d1c385936
+RMD160 (check_snmp_environment-0.7/check_snmp_environment.pl) = 256eedb5c6241cdfe1d579a24665815a58f5081d
+SHA512 (check_snmp_environment-0.7/check_snmp_environment.pl) = dbb128a5820c15d27076094d39c04ca52ec527beb44289a8261833d7cbe7ee2079f70cbff9210e3043f3e0df05c7b142c9fc0be2b46eee468bfc327953b0079a
+Size (check_snmp_environment-0.7/check_snmp_environment.pl) = 97676 bytes
+SHA1 (patch-aa) = 6981376d02d65c4b18d8f62aa2de65c6f7ceab38
diff --git a/nagios-plugin-snmp_environment/patches/patch-aa b/nagios-plugin-snmp_environment/patches/patch-aa
new file mode 100644
index 0000000000..69e112f353
--- /dev/null
+++ b/nagios-plugin-snmp_environment/patches/patch-aa
@@ -0,0 +1,37 @@
+$NetBSD: patch-aa $
+Don't warn for non-present power supplies
+--- check_snmp_environment.pl.orig 2016-11-08 11:39:49.000000000 +0100
++++ check_snmp_environment.pl 2016-11-08 11:42:56.000000000 +0100
+@@ -273,7 +273,7 @@
+ my $extreme_ps_table = "1.3.6.1.4.1.1916.1.1.1.27.1";
+ my $extreme_ps_status = "1.3.6.1.4.1.1916.1.1.1.27.1.2";
+ my @extreme_ps_status_text = ("--Invalid--","notPresent","presentOK","presentNotOK");
+-my @extreme_ps_nagios = (3,1,0,2);
++my @extreme_ps_nagios = (3,0,0,2);
+ my $extreme_fan_table = "1.3.6.1.4.1.1916.1.1.1.9.1";
+ my $extreme_fan_number = "1.3.6.1.4.1.1916.1.1.1.9.1.1";
+ my $extreme_fan_operational = "1.3.6.1.4.1.1916.1.1.1.9.1.2";
+@@ -1753,14 +1753,16 @@
+ $tmp_status = $extreme_ps_nagios[$ps_status];
+ $final_status = &set_status($tmp_status,$final_status);
+
+- if ($tmp_status == 0) {
+- $num_ps_ok++;
+- }
++ if ($ps_status != 1) {
++ if ($tmp_status == 0) {
++ $num_ps_ok++;
++ }
+
+- else {
+- if ($ps_output ne "") {$ps_output.=", ";}
+- $ps_output.= "(Power-supply status: " . $ps_status_text . ")";
+- }
++ else {
++ if ($ps_output ne "") {$ps_output.=", ";}
++ $ps_output.= "(Power-supply status: " . $ps_status_text . ")";
++ }
++ }
+ }
+ }
+ if ($ps_output ne "") {$ps_output.=", ";}
Home |
Main Index |
Thread Index |
Old Index