1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-19 19:59:43 +00:00

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).
This commit is contained in:
Bruce M Simpson 2004-05-24 18:41:01 +00:00
parent dddf36e361
commit 63d81145bf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=109885
6 changed files with 147 additions and 0 deletions

View File

@ -130,6 +130,7 @@
SUBDIR += sendip
SUBDIR += sing
SUBDIR += sipcalc
SUBDIR += snmptt
SUBDIR += sting
SUBDIR += subcalc
SUBDIR += sysmon

76
net-mgmt/snmptt/Makefile Normal file
View File

@ -0,0 +1,76 @@
# ports collection makefile for: snmptt
# Date created: 21 May 2004
# Whom: Bruce M Simpson <bms@FreeBSD.org>
#
# $FreeBSD$
#
PORTNAME= snmptt
PORTVERSION= 0.9
CATEGORIES= net-mgmt
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
DISTNAME= ${PORTNAME}_${PORTVERSION}
EXTRACT_SUFX= .tgz
MAINTAINER= bms@FreeBSD.org
COMMENT= SNMP trap handler/translator/swiss-army-knife
WRKSRC= ${WRKDIR}/${PORTNAME}_${PORTVERSION}
USE_PERL5= yes
USE_REINPLACE= yes
SCRIPTS= snmptt snmptt-net-snmp-test snmpttconvert \
snmpttconvertmib snmptthandler
DOCS= faqs.html index.html layout1.css snmptt.html \
snmpttconvert.html snmpttconvertmib.html
RUN_DEPENDS+= \
${SITE_PERL}/${PERL_ARCH}/SNMP.pm:${PORTSDIR}/net-mgmt/net-snmp \
${SITE_PERL}/Config/IniFiles.pm:${PORTSDIR}/devel/p5-Config-IniFiles
SED_SCRIPT= -e 's,%%PREFIX%%,${PREFIX},g' \
-e 's,%%RC_SUBR%%,${RC_SUBR},g' \
-e 's,%%RC_DIR%%,${RC_DIR},g' \
-e 's,%%RC_SUFX%%,${RC_SUFX},g'
PLIST_SUB+= RC_DIR=${RC_DIR} \
RC_SUFX=${RC_SUFX}
.include <bsd.port.pre.mk>
.if ${OSVERSION} >= 500038
RC_SUBR?= ${DESTDIR}/etc/rc.subr
RC_DIR= ${DESTDIR}/etc/rc.d
RC_SUFX=
.else
USE_RC_SUBR= yes
RC_DIR= ${PREFIX}/etc/rc.d
RC_SUFX= .sh
.endif
do-build:
post-build:
@${SED} ${SED_SCRIPT} ${FILESDIR}/snmptt.sh > ${WRKDIR}/snmptt.sh
@${ECHO_CMD} ${WRKSRC}/snmptt ${WRKSRC}/snmptthandler | ${XARGS} \
${REINPLACE_CMD} -e \
"s|/etc/snmptt.ini|${PREFIX}/etc/snmptt.ini|g ; \
s|/etc/snmp/snmptt.ini|${PREFIX}/etc/snmp/snmptt.ini|g"
do-install:
.for _SCRIPT in ${SCRIPTS}
${INSTALL_SCRIPT} ${WRKSRC}/${_SCRIPT} ${PREFIX}/sbin
.endfor
${INSTALL_DATA} ${WRKSRC}/snmptt.ini ${PREFIX}/etc
${INSTALL_DATA} ${WRKSRC}/examples/snmptt.conf.generic ${PREFIX}/etc
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
.for _DOC in ${DOCS}
${INSTALL_MAN} ${WRKSRC}/docs/${_DOC} ${DOCSDIR}
.endfor
.endif
${INSTALL_SCRIPT} ${WRKDIR}/snmptt.sh ${RC_DIR}/snmptt${RC_SUFX}
.include <bsd.port.post.mk>

2
net-mgmt/snmptt/distinfo Normal file
View File

@ -0,0 +1,2 @@
MD5 (snmptt_0.9.tgz) = 85090dee54ed5772c4e6ec939d954271
SIZE (snmptt_0.9.tgz) = 107679

View File

@ -0,0 +1,45 @@
#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: snmptt
# REQUIRE: LOGIN
# KEYWORD: FreeBSD
#
# Add the following lines to /etc/rc.conf to enable snmptt:
#
#snmptt_enable="YES"
#
# See snmptt documentation for flags.
#
. %%RC_SUBR%%
name=snmptt
rcvar=`set_rcvar`
command=%%PREFIX%%/sbin/${name}
command_args="--daemon"
pidfile=/var/run/${name}.pid
# XXX: Makes assumptions about the interpreter path and version. However,
# USE_PERL5 should guarantee that this path is valid. In any event, we
# don't sed-ify the #! operators.
procname=/usr/bin/perl
required_files=%%PREFIX%%/etc/${name}.ini
# set defaults
snmptt_enable=${snmptt_enable:-"NO"}
snmptt_flags=${snmptt_flags:-""}
stop_postcmd=stop_postcmd
stop_postcmd()
{
rm -f $pidfile
}
load_rc_config ${name}
run_rc_command "$1"

View File

@ -0,0 +1,7 @@
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).
WWW: http://www.snmptt.org/
Bruce
bms@FreeBSD.org

16
net-mgmt/snmptt/pkg-plist Normal file
View File

@ -0,0 +1,16 @@
sbin/snmptt
sbin/snmptt-net-snmp-test
sbin/snmpttconvert
sbin/snmpttconvertmib
sbin/snmptthandler
etc/snmptt.ini
etc/snmptt.conf.generic
%%PORTDOCS%%%%DOCSDIR%%/faqs.html
%%PORTDOCS%%%%DOCSDIR%%/index.html
%%PORTDOCS%%%%DOCSDIR%%/layout1.css
%%PORTDOCS%%%%DOCSDIR%%/snmptt.html
%%PORTDOCS%%%%DOCSDIR%%/snmpttconvert.html
%%PORTDOCS%%%%DOCSDIR%%/snmpttconvertmib.html
%%PORTDOCS%%@dirrm %%DOCSDIR%%
@cwd %%RC_DIR%%
snmptt%%RC_SUFX%%