diff options
author | bouyer <bouyer@pkgsrc.org> | 2011-04-13 10:23:47 +0000 |
---|---|---|
committer | bouyer <bouyer@pkgsrc.org> | 2011-04-13 10:23:47 +0000 |
commit | ca3e2c3ed92fa815042224dc55887a9a9519b82f (patch) | |
tree | a3193d8fe1c0e9be2030f7068e4f7cb1ddae6003 /net | |
parent | 3c974a968a92b43e57c86a0e1282595e18ae8b84 (diff) | |
download | pkgsrc-ca3e2c3ed92fa815042224dc55887a9a9519b82f.tar.gz |
Import of snmptt 1.3
SNMPTT (SNMP Trap Translator) is an SNMP trap handler written in Perl for
use with the Net-SNMP / UCD-SNMP snmptrapd program (www.net-snmp.org).
SNMPTT supports Linux, Unix and Windows.
Snmptt can log to any of the following destinations: text log, syslog,
NT Event log or a SQL database. External programs can also be run to pass
the translated trap to an email client, paging software, Nagios etc.
In addition to variable substitution, SNMPTT allows complex configurations
allowing:
* the ability to accept or reject a trap based on the host name,
ip address, network range, or variable values inside of the trap
enterprise variables
* execute external programs to send pages, emails etc
* perform regular expression search and replace on the translated message
such as translating the variable value "Building alarm 4" to
"Moisture detection alarm"
Diffstat (limited to 'net')
-rw-r--r-- | net/snmptt/DESCR | 18 | ||||
-rw-r--r-- | net/snmptt/Makefile | 95 | ||||
-rw-r--r-- | net/snmptt/PLIST | 15 | ||||
-rw-r--r-- | net/snmptt/distinfo | 5 | ||||
-rw-r--r-- | net/snmptt/files/snmptt.sh | 24 |
5 files changed, 157 insertions, 0 deletions
diff --git a/net/snmptt/DESCR b/net/snmptt/DESCR new file mode 100644 index 00000000000..aba7f2a6bd4 --- /dev/null +++ b/net/snmptt/DESCR @@ -0,0 +1,18 @@ +SNMPTT (SNMP Trap Translator) is an SNMP trap handler written in Perl for +use with the Net-SNMP / UCD-SNMP snmptrapd program (www.net-snmp.org). +SNMPTT supports Linux, Unix and Windows. + +Snmptt can log to any of the following destinations: text log, syslog, +NT Event log or a SQL database. External programs can also be run to pass +the translated trap to an email client, paging software, Nagios etc. + +In addition to variable substitution, SNMPTT allows complex configurations +allowing: + + * the ability to accept or reject a trap based on the host name, + ip address, network range, or variable values inside of the trap + enterprise variables + * execute external programs to send pages, emails etc + * perform regular expression search and replace on the translated message + such as translating the variable value "Building alarm 4" to + "Moisture detection alarm" diff --git a/net/snmptt/Makefile b/net/snmptt/Makefile new file mode 100644 index 00000000000..3173761cc09 --- /dev/null +++ b/net/snmptt/Makefile @@ -0,0 +1,95 @@ +# $NetBSD: Makefile,v 1.1.1.1 2011/04/13 10:23:47 bouyer Exp $ +# + +DISTNAME= snmptt_1.3 +EXTRACT_SUFX= .tgz +PKGNAME= snmptt-1.3 +CATEGORIES= net +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=snmptt/} + +MAINTAINER= bouyer@NetBSD.org +HOMEPAGE= http://www.snmptt.org/ +COMMENT= SNMP trap handler written in Perl + +DEPENDS+= p5-Config-IniFiles-[0-9]*:../../devel/p5-Config-IniFiles +DEPENDS+= p5-Time-HiRes-[0-9]*:../../time/p5-Time-HiRes +DEPENDS+= p5-Text-Balanced-[0-9]*:../../textproc/p5-Text-Balanced +DEPENDS+= p5-DBI-[0-9]*:../../databases/p5-DBI +DEPENDS+= p5-DBD-ODBC-[0-9]*:../../databases/p5-DBD-ODBC +DEPENDS+= p5-Digest-MD5-[0-9]*:../../security/p5-Digest-MD5 + +WRKSRC= ${WRKDIR}/${DISTNAME} + +PKG_SYSCONFSUBDIR= snmptt + +PKG_DESTDIR_SUPPORT= user-destdir + +INSTALLATION_DIRS+= sbin + +RCD_SCRIPTS= snmptt + +BUILD_DEFS+= VARBASE +.include "../../mk/bsd.prefs.mk" + +EGDIR= ${PREFIX}/share/examples/snmptt +CONF_FILES= ${EGDIR}/snmptt.ini ${PKG_SYSCONFDIR}/snmptt.ini + +DOCDIR= ${PREFIX}/share/doc/html/snmptt + +MAKE_DIRS_PERMS+= ${VARBASE}/spool/snmptt ${ROOT_USER} ${ROOT_GROUP} 0755 + +USE_TOOLS+= perl:run +REPLACE_PERL+= snmptt +REPLACE_PERL+= snmptt-net-snmp-test +REPLACE_PERL+= snmpttconvert +REPLACE_PERL+= snmptthandler +REPLACE_PERL+= snmptthandler-embedded +REPLACE_PERL+= snmpttconvertmib + +SUBST_CLASSES+= installdir etcdir vardir log +SUBST_STAGE.installdir= pre-configure +SUBST_FILES.installdir= snmptt +SUBST_FILES.installdir+= snmptthandler +SUBST_FILES.installdir+= snmptthandler-embedded +SUBST_SED.installdir= -e "s|/sbin|${PREFIX}/sbin|g" +SUBST_MESSAGE.installdir= Fixing hardcoded install directory path. + +SUBST_STAGE.etcdir= pre-configure +SUBST_FILES.etcdir= snmptt +SUBST_FILES.etcdir+= snmptt.ini +SUBST_FILES.etcdir+= snmptthandler +SUBST_FILES.etcdir+= docs/faqs.html +SUBST_FILES.etcdir+= docs/snmptt.html +SUBST_FILES.etcdir+= docs/snmpttconvertmib.html +SUBST_FILES.etcdir+= snmptthandler-embedded +SUBST_SED.etcdir= -e "s|/etc|${PKG_SYSCONFDIR}|g" +SUBST_MESSAGE.etcdir= Fixing hardcoded /etc path. + +SUBST_STAGE.vardir= pre-configure +SUBST_FILES.vardir= snmptt snmptt.ini +SUBST_SED.vardir= -e "s|/var|${VARBASE}|g" +SUBST_MESSAGE.vardir= Fixing hardcoded /var path. + +SUBST_STAGE.log= pre-configure +SUBST_FILES.log= snmptt.ini +SUBST_SED.log= -e "s|/log/snmptt/|/log/|g" +SUBST_MESSAGE.log= move ${VARBASE}/log/snmptt/ to ${VARBASE}/log + +do-build: + +do-install: + for i in snmptt snmptt-net-snmp-test snmpttconvert \ + snmptthandler snmptthandler-embedded snmpttconvertmib; do \ + ${INSTALL_SCRIPT} ${WRKSRC}/$$i ${DESTDIR}${PREFIX}/sbin/; \ + done + ${INSTALL_DATA_DIR} ${DESTDIR}${EGDIR} + for i in snmptt.ini; do \ + ${INSTALL_DATA} ${WRKSRC}/$$i ${DESTDIR}${EGDIR}/; \ + done + ${INSTALL_DATA_DIR} ${DESTDIR}${DOCDIR} + for i in docs/*; do \ + ${INSTALL_DATA} ${WRKSRC}/$$i ${DESTDIR}${DOCDIR}/; \ + done + +.include "../../net/net-snmp/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/net/snmptt/PLIST b/net/snmptt/PLIST new file mode 100644 index 00000000000..36512b08c00 --- /dev/null +++ b/net/snmptt/PLIST @@ -0,0 +1,15 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2011/04/13 10:23:47 bouyer Exp $ +sbin/snmptt +sbin/snmptt-net-snmp-test +sbin/snmpttconvert +sbin/snmptthandler +sbin/snmptthandler-embedded +sbin/snmpttconvertmib +share/doc/html/snmptt/faqs.html +share/doc/html/snmptt/index.html +share/doc/html/snmptt/layout1.css +share/doc/html/snmptt/snmptt.html +share/doc/html/snmptt/snmpttconvert.html +share/doc/html/snmptt/snmpttconvertmib.html +share/examples/rc.d/snmptt +share/examples/snmptt/snmptt.ini diff --git a/net/snmptt/distinfo b/net/snmptt/distinfo new file mode 100644 index 00000000000..9898eb80aab --- /dev/null +++ b/net/snmptt/distinfo @@ -0,0 +1,5 @@ +$NetBSD: distinfo,v 1.1.1.1 2011/04/13 10:23:47 bouyer Exp $ + +SHA1 (snmptt_1.3.tgz) = 441077d806c877545c2ce5688e0c1ecf5cca9bbb +RMD160 (snmptt_1.3.tgz) = 3f12f45720c263ccf0d27c8b391537da08083cbe +Size (snmptt_1.3.tgz) = 146314 bytes diff --git a/net/snmptt/files/snmptt.sh b/net/snmptt/files/snmptt.sh new file mode 100644 index 00000000000..e6dcbbbb649 --- /dev/null +++ b/net/snmptt/files/snmptt.sh @@ -0,0 +1,24 @@ +#!@RCD_SCRIPTS_SHELL@ +# +# $NetBSD: snmptt.sh,v 1.1.1.1 2011/04/13 10:23:47 bouyer Exp $ +# +# PROVIDE: snmptt +# REQUIRE: DAEMON + +if [ -f /etc/rc.subr ]; then + . /etc/rc.subr +fi + +name="snmptt" +rcvar=$name +command="@PREFIX@/sbin/${name}" +pidfile="@VARBASE@/run/${name}.pid" +command_interpreter="@PREFIX@/bin/perl" + +if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -f /etc/rc.d/DAEMON ]; then + load_rc_config $name + run_rc_command "$1" +else + @ECHO@ -n " ${name}" + ${command} +fi |