summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2021-02-10 15:26:46 +0000
committerwiz <wiz@pkgsrc.org>2021-02-10 15:26:46 +0000
commite20ec3b721dea433379f98edb1ef3a7b2c5f6091 (patch)
tree0ba1e39659bafae6f39c505dd220f8399b0cd2b7 /net
parentfcad44b2af72716c0c9f671cbf90040ce5b6987e (diff)
downloadpkgsrc-e20ec3b721dea433379f98edb1ef3a7b2c5f6091.tar.gz
net/nagios-plugin-printer: import nagios-plugin-printer-0.0.363nb1
Packaged for wip by Edgar Fuß. Perl script that retrieves supply metrics from printers using the snmpwalk command.
Diffstat (limited to 'net')
-rw-r--r--net/nagios-plugin-printer/DESCR2
-rw-r--r--net/nagios-plugin-printer/Makefile46
-rw-r--r--net/nagios-plugin-printer/PLIST2
-rw-r--r--net/nagios-plugin-printer/distinfo7
-rw-r--r--net/nagios-plugin-printer/patches/patch-aa36
5 files changed, 93 insertions, 0 deletions
diff --git a/net/nagios-plugin-printer/DESCR b/net/nagios-plugin-printer/DESCR
new file mode 100644
index 00000000000..6d321b74f77
--- /dev/null
+++ b/net/nagios-plugin-printer/DESCR
@@ -0,0 +1,2 @@
+Perl script that retrieves supply metrics from printers using the snmpwalk
+command.
diff --git a/net/nagios-plugin-printer/Makefile b/net/nagios-plugin-printer/Makefile
new file mode 100644
index 00000000000..58c0b5240e2
--- /dev/null
+++ b/net/nagios-plugin-printer/Makefile
@@ -0,0 +1,46 @@
+# $NetBSD: Makefile,v 1.1 2021/02/10 15:26:46 wiz Exp $
+
+DISTNAME= check_printer
+REVISION= 363
+PKGREVISION= 1
+PKGNAME= nagios-plugin-printer-0.0.${REVISION}
+CATEGORIES= sysutils net
+# Can this be converted to GITHUB_*?
+MASTER_SITES= ${MASTER_SITE_GITHUB:=bzed/pkg-nagios-plugins-contrib/raw/debian/25.20191015+1/check_printer/}
+EXTRACT_SUFX= # empty
+DIST_SUBDIR= check_printer-${REVISION}
+
+COMMENT= Gather supply metrics from a printer via SNMP query
+LICENSE= 2-clause-bsd
+
+USE_LANGUAGES= # empty
+USE_TOOLS+= perl:run
+
+DEPENDS+= net-snmp-[0-9]*:../../net/net-snmp
+
+WRKSRC= ${WRKDIR}
+
+PLUGINDIR= libexec/nagios
+PLIST_SUBST+= PLUGINDIR=${PLUGINDIR}
+
+INSTALLATION_DIRS+= ${PLUGINDIR}
+
+REPLACE_PERL+= check_printer
+
+SUBST_CLASSES+= paths
+SUBST_STAGE.paths= pre-configure
+SUBST_MESSAGE.paths= Fixing paths
+SUBST_FILES.paths= check_printer
+SUBST_SED.paths= -e 's;@LIBDIR@;${PREFIX}/${PLUGINDIR};'
+SUBST_VARS.paths= PREFIX
+
+NO_BUILD= yes
+
+do-extract:
+ ${CP} ${DISTDIR}/${DIST_SUBDIR}/${DISTNAME} ${WRKSRC}
+
+do-install:
+ ${INSTALL_SCRIPT} ${WRKSRC}/check_printer ${DESTDIR}${PREFIX}/${PLUGINDIR}
+
+.include "../../mk/bsd.prefs.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/net/nagios-plugin-printer/PLIST b/net/nagios-plugin-printer/PLIST
new file mode 100644
index 00000000000..1bc4b0bfe99
--- /dev/null
+++ b/net/nagios-plugin-printer/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2021/02/10 15:26:46 wiz Exp $
+${PLUGINDIR}/check_printer
diff --git a/net/nagios-plugin-printer/distinfo b/net/nagios-plugin-printer/distinfo
new file mode 100644
index 00000000000..d418859b603
--- /dev/null
+++ b/net/nagios-plugin-printer/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2021/02/10 15:26:46 wiz Exp $
+
+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) = 53e44cdc5f4ad8b7815a7ca6188c0b0b34b237f4
diff --git a/net/nagios-plugin-printer/patches/patch-aa b/net/nagios-plugin-printer/patches/patch-aa
new file mode 100644
index 00000000000..51a4f6a7db7
--- /dev/null
+++ b/net/nagios-plugin-printer/patches/patch-aa
@@ -0,0 +1,36 @@
+$NetBSD: patch-aa,v 1.1 2021/02/10 15:26:46 wiz Exp $
+
+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);
+