summaryrefslogtreecommitdiff
path: root/net/nagios-plugin-snmp
diff options
context:
space:
mode:
authorbouyer <bouyer@pkgsrc.org>2006-02-18 17:23:43 +0000
committerbouyer <bouyer@pkgsrc.org>2006-02-18 17:23:43 +0000
commit683d68d763f3560b05078c90d413ffd30bb40ccc (patch)
tree392b5404162078779663b23d40fd23df40008ceb /net/nagios-plugin-snmp
parent8e6581c009d41ffe99909990f0a81ade39343458 (diff)
downloadpkgsrc-683d68d763f3560b05078c90d413ffd30bb40ccc.tar.gz
Initial import of nagios-plugin-snmp 1.4.2, based on nagios-plugin-snmp
from pkgsrc-wip. This is a package for the SNMP monitoring plug-ins for nagios. For more information about nagios, see the 'nagios-base' package.
Diffstat (limited to 'net/nagios-plugin-snmp')
-rw-r--r--net/nagios-plugin-snmp/DESCR2
-rw-r--r--net/nagios-plugin-snmp/Makefile23
-rw-r--r--net/nagios-plugin-snmp/PLIST7
-rw-r--r--net/nagios-plugin-snmp/distinfo8
-rw-r--r--net/nagios-plugin-snmp/patches/patch-ad13
-rw-r--r--net/nagios-plugin-snmp/patches/patch-ae81
-rw-r--r--net/nagios-plugin-snmp/patches/patch-ak105
7 files changed, 239 insertions, 0 deletions
diff --git a/net/nagios-plugin-snmp/DESCR b/net/nagios-plugin-snmp/DESCR
new file mode 100644
index 00000000000..8227cc9a23e
--- /dev/null
+++ b/net/nagios-plugin-snmp/DESCR
@@ -0,0 +1,2 @@
+This is a package for the SNMP monitoring plug-ins for nagios. For
+more information about nagios, see the 'nagios-base' package.
diff --git a/net/nagios-plugin-snmp/Makefile b/net/nagios-plugin-snmp/Makefile
new file mode 100644
index 00000000000..e47ee9f5ce6
--- /dev/null
+++ b/net/nagios-plugin-snmp/Makefile
@@ -0,0 +1,23 @@
+# $NetBSD: Makefile,v 1.1.1.1 2006/02/18 17:23:43 bouyer Exp $
+#
+
+PKGNAME= nagios-plugin-snmp-${PLUGINSVERSION}
+CATEGORIES= net sysutils
+
+MAINTAINER= tech-pkg@NetBSD.org
+COMMENT= Nagios snmp plugins
+
+DEPENDS+= nagios-plugins-${PLUGINSVERSION}:../../net/nagios-plugins
+DEPENDS+= p5-Net-SNMP-[0-9]*:../../net/p5-Net-SNMP
+
+.include "../../net/nagios-plugins/Makefile.common"
+
+BINARY_TARGET= check_snmp check_hpjd
+SCRIPT_TARGET= check_ifoperstatus check_ifstatus
+SCRIPT_TARGET+= check_breeze check_wave
+
+.include "../../net/nagios-plugins/Makefile.plugin"
+.include "../../net/net-snmp/buildlink3.mk"
+.include "../../security/openssl/buildlink3.mk"
+.include "../../devel/gettext-lib/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/net/nagios-plugin-snmp/PLIST b/net/nagios-plugin-snmp/PLIST
new file mode 100644
index 00000000000..2c3ede30228
--- /dev/null
+++ b/net/nagios-plugin-snmp/PLIST
@@ -0,0 +1,7 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2006/02/18 17:23:43 bouyer Exp $
+libexec/nagios/check_breeze
+libexec/nagios/check_hpjd
+libexec/nagios/check_ifoperstatus
+libexec/nagios/check_ifstatus
+libexec/nagios/check_snmp
+libexec/nagios/check_wave
diff --git a/net/nagios-plugin-snmp/distinfo b/net/nagios-plugin-snmp/distinfo
new file mode 100644
index 00000000000..f8fdbda4226
--- /dev/null
+++ b/net/nagios-plugin-snmp/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1.1.1 2006/02/18 17:23:43 bouyer Exp $
+
+SHA1 (nagios-plugins-1.4.2.tar.gz) = d12238c75c0bbb0c7cb8e81585effe5375b9ced4
+RMD160 (nagios-plugins-1.4.2.tar.gz) = 93d747bb445e4e59cdb72ef210feb052b7855cac
+Size (nagios-plugins-1.4.2.tar.gz) = 971447 bytes
+SHA1 (patch-ad) = 75bb44093f1fe0d18668cb9aec787d760fe16ad4
+SHA1 (patch-ae) = 42a2767b290e4a10c93f170e85138e8c639906dc
+SHA1 (patch-ak) = c3d9f6ea9a971c45ec4159f800c2a975a3013c82
diff --git a/net/nagios-plugin-snmp/patches/patch-ad b/net/nagios-plugin-snmp/patches/patch-ad
new file mode 100644
index 00000000000..758379fcd32
--- /dev/null
+++ b/net/nagios-plugin-snmp/patches/patch-ad
@@ -0,0 +1,13 @@
+$NetBSD: patch-ad,v 1.1.1.1 2006/02/18 17:23:43 bouyer Exp $
+
+--- plugins-scripts/check_breeze.pl.orig 2005-08-04 07:37:19.000000000 -0700
++++ plugins-scripts/check_breeze.pl 2005-08-04 07:47:00.000000000 -0700
+@@ -47,7 +47,7 @@
+ ($opt_C) || ($opt_C = "public") ;
+
+ my $sig=0;
+-$sig = `/usr/bin/snmpget $host $opt_C .1.3.6.1.4.1.710.3.2.3.1.3.0`;
++$sig = `$utils::PATH_TO_SNMPGET -c $opt_C $host .1.3.6.1.4.1.710.3.2.3.1.3.0`;
+ my @test=split(/ /,$sig);
+ $sig=$test[2];
+ $sig=int($sig);
diff --git a/net/nagios-plugin-snmp/patches/patch-ae b/net/nagios-plugin-snmp/patches/patch-ae
new file mode 100644
index 00000000000..406618cea9e
--- /dev/null
+++ b/net/nagios-plugin-snmp/patches/patch-ae
@@ -0,0 +1,81 @@
+$NetBSD: patch-ae,v 1.1.1.1 2006/02/18 17:23:43 bouyer Exp $
+
+--- plugins-scripts/check_wave.pl.orig 2002-10-28 05:05:08.000000000 -0800
++++ plugins-scripts/check_wave.pl 2005-08-10 13:50:01.000000000 -0700
+@@ -8,7 +8,7 @@
+ use utils qw($TIMEOUT %ERRORS &print_revision &support);
+ use vars qw($PROGNAME);
+ use Getopt::Long;
+-use vars qw($opt_V $opt_h $verbose $opt_w $opt_c $opt_H);
++use vars qw($opt_V $opt_h $verbose $opt_w $opt_c $opt_H $opt_C);
+ my (@test, $low1, $med1, $high1, $snr, $low2, $med2, $high2);
+ my ($low, $med, $high, $lowavg, $medavg, $highavg, $tot, $ss);
+
+@@ -27,6 +27,7 @@
+ "v" => \$verbose, "verbose" => \$verbose,
+ "w=s" => \$opt_w, "warning=s" => \$opt_w,
+ "c=s" => \$opt_c, "critical=s" => \$opt_c,
+- "H=s" => \$opt_H, "hostname=s" => \$opt_H);
++ "H=s" => \$opt_H, "hostname=s" => \$opt_H,
++ "C=s" => \$opt_C, "community=s" => \$opt_C);
+
+ if ($opt_V) {
+@@ -40,6 +41,7 @@
+ }
+
+ $opt_H = shift unless ($opt_H);
++$opt_C = "public" unless ($opt_C);
+ print_usage() unless ($opt_H);
+ my $host = $1 if ($opt_H =~ m/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-zA-Z][-a-zA-Z0]+(\.[a-zA-Z][-a-zA-Z0]+)*)$/);
+ print_usage() unless ($host);
+@@ -50,34 +52,34 @@
+ ($opt_w) || ($opt_w = shift) || ($opt_w = 60);
+ my $warning = $1 if ($opt_w =~ /([0-9]+)/);
+
+-$low1 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`;
++$low1 = `$utils::PATH_TO_SNMPGET -c $opt_C $host .1.3.6.1.4.1.74.2.21.1.2.1.8.1`;
+ @test = split(/ /,$low1);
+ $low1 = $test[2];
+
+-$med1 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`;
++$med1 = `$utils::PATH_TO_SNMPGET -c $opt_C $host .1.3.6.1.4.1.74.2.21.1.2.1.9.1`;
+ @test = split(/ /,$med1);
+ $med1 = $test[2];
+
+-$high1 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`;
++$high1 = `$utils::PATH_TO_SNMPGET -c $opt_C $host .1.3.6.1.4.1.74.2.21.1.2.1.10.1`;
+ @test = split(/ /,$high1);
+ $high1 = $test[2];
+
+ sleep(2);
+
+-$snr = `snmpget $host public .1.3.6.1.4.1.762.2.5.2.1.17.1`;
++$snr = `$utils::PATH_TO_SNMPGET -c $opt_C $host .1.3.6.1.4.1.762.2.5.2.1.17.1`;
+ @test = split(/ /,$snr);
+ $snr = $test[2];
+ $snr = int($snr*25);
+
+-$low2 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.8.1`;
++$low2 = `$utils::PATH_TO_SNMPGET -c $opt_C $host .1.3.6.1.4.1.74.2.21.1.2.1.8.1`;
+ @test = split(/ /,$low2);
+ $low2 = $test[2];
+
+-$med2 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.9.1`;
++$med2 = `$utils::PATH_TO_SNMPGET -c $opt_C $host .1.3.6.1.4.1.74.2.21.1.2.1.9.1`;
+ @test = split(/ /,$med2);
+ $med2 = $test[2];
+
+-$high2 = `snmpget $host public .1.3.6.1.4.1.74.2.21.1.2.1.10.1`;
++$high2 = `$utils::PATH_TO_SNMPGET -c $opt_C $host .1.3.6.1.4.1.74.2.21.1.2.1.10.1`;
+ @test = split(/ /,$high2);
+ $high2 = $test[2];
+
+@@ -108,7 +110,7 @@
+
+
+ sub print_usage () {
+- print "Usage: $PROGNAME -H <host> [-w <warn>] [-c <crit>]\n";
++ print "Usage: $PROGNAME -H <host> [-C <community>] [-w <warn>] [-c <crit>]\n";
+ }
+
+ sub print_help () {
diff --git a/net/nagios-plugin-snmp/patches/patch-ak b/net/nagios-plugin-snmp/patches/patch-ak
new file mode 100644
index 00000000000..2dd1f0d7dfe
--- /dev/null
+++ b/net/nagios-plugin-snmp/patches/patch-ak
@@ -0,0 +1,105 @@
+$NetBSD: patch-ak,v 1.1.1.1 2006/02/18 17:23:43 bouyer Exp $
+
+--- lib/mountlist.c.orig 2005-10-14 22:09:29.000000000 +0200
++++ lib/mountlist.c 2005-10-14 22:23:14.000000000 +0200
+@@ -66,7 +66,11 @@
+ # if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
+ # define FS_TYPE(Ent) ((Ent).f_fstypename)
+ # else
+-# define FS_TYPE(Ent) mnt_names[(Ent).f_type]
++# ifdef STAT_STATVFS
++# define FS_TYPE(Ent) mnt_names[(Ent).f_fsid]
++# else
++# define FS_TYPE(Ent) mnt_names[(Ent).f_type]
++# endif
+ # endif
+ #endif /* MOUNTED_GETFSSTAT */
+
+@@ -109,6 +113,10 @@
+ # include <sys/statfs.h>
+ #endif
+
++#ifdef HAVE_SYS_STATVFS_H
++#include <sys/statvfs.h>
++#endif
++
+ #ifdef MOUNTED_LISTMNTENT
+ # include <mntent.h>
+ #endif
+@@ -173,7 +181,7 @@
+
+ #if MOUNTED_GETMNTINFO
+
+-# if ! HAVE_F_FSTYPENAME_IN_STATFS
++# if ! HAVE_F_FSTYPENAME_IN_STATFS && ! STAT_STATVFS
+ static char *
+ fstype_to_string (short t)
+ {
+@@ -271,12 +279,16 @@
+
+ /* __NetBSD__ || BSD_NET2 || __OpenBSD__ */
+ static char *
++#ifdef STAT_STATVFS
++fsp_to_string (const struct statvfs *fsp)
++#else
+ fsp_to_string (const struct statfs *fsp)
++#endif
+ {
+-# if defined HAVE_F_FSTYPENAME_IN_STATFS
++# if defined HAVE_F_FSTYPENAME_IN_STATFS || defined STAT_STATVFS
+ return (char *) (fsp->f_fstypename);
+ # else
+- return fstype_to_string (fsp->f_type);
++ return fstype_to_string (fsp->f_type);
+ # endif
+ }
+
+@@ -381,7 +393,11 @@
+
+ #ifdef MOUNTED_GETMNTINFO /* 4.4BSD. */
+ {
++#ifdef STAT_STATVFS
++ struct statvfs *fsp;
++#else
+ struct statfs *fsp;
++#endif
+ int entries;
+
+ entries = getmntinfo (&fsp, MNT_NOWAIT);
+@@ -543,9 +559,17 @@
+ {
+ int numsys, counter;
+ size_t bufsize;
++#ifdef STAT_STATVFS
++ struct statvfs *stats;
++#else
+ struct statfs *stats;
++#endif
+
++#ifdef STAT_STATVFS
++ numsys = getfsstat ((struct statvfs *)0, 0L, MNT_NOWAIT);
++#else
+ numsys = getfsstat ((struct statfs *)0, 0L, MNT_NOWAIT);
++#endif
+ if (numsys < 0)
+ return (NULL);
+ if (SIZE_MAX / sizeof *stats <= numsys)
+@@ -608,10 +632,18 @@
+ # ifdef GETFSTYP /* SVR3. */
+ if (need_fs_type)
+ {
++#ifdef STAT_STATVFS
++ struct statvfs fsd;
++#else
+ struct statfs fsd;
++#endif
+ char typebuf[FSTYPSZ];
+
++#ifdef STAT_STATVFS
++ if (statvfs (me->me_mountdir, &fsd, sizeof fsd, 0) != -1
++#else
+ if (statfs (me->me_mountdir, &fsd, sizeof fsd, 0) != -1
++#endif
+ && sysfs (GETFSTYP, fsd.f_fstyp, typebuf) != -1)
+ {
+ me->me_type = xstrdup (typebuf);