Skip to content

Commit 793f599

Browse files
committed
freebsd port added
1 parent d588fa0 commit 793f599

File tree

6 files changed

+102
-0
lines changed

6 files changed

+102
-0
lines changed

freebsd/Makefile

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# $FreeBSD$
2+
3+
PORTNAME= net-snmp-subagent-shell
4+
PORTVERSION= 2.3.0.1
5+
CATEGORIES= net-mgmt
6+
MASTER_SITES= https://github.com/sergevs/net-snmp-subagent-shell/releases/tag/${PORTVERSION}
7+
8+
MAINTAINER= [email protected]
9+
COMMENT= A complete implementation of net-snmp subagent written on perl. Can be used to define arbitrary functions and provide the results via snmp.
10+
11+
USE_RC_SUBR= subagent_shell
12+
13+
USES=perl5
14+
USE_PERL5= run
15+
USE_AUTOTOOLS= aclocal:env automake:env autoconf:env
16+
17+
RUN_DEPENDS:= p5-XML-Simple>=2.10:${PORTSDIR}/textproc/p5-XML-Simple \
18+
net-snmp>=5.5:${PORTSDIR}/net-mgmt/net-snmp
19+
20+
SUB_FILES= pkg-message
21+
SUB_LIST= PERL=${PERL}
22+
23+
post-configure:
24+
@cd ${CONFIGURE_WRKSRC}; \
25+
aclocal; \
26+
automake --add-missing; \
27+
autoconf; \
28+
./configure
29+
30+
post-install:
31+
@mv ${STAGEDIR}${PREFIX}/bin/subagent-shell ${STAGEDIR}${PREFIX}/bin/subagent_shell
32+
33+
.include <bsd.port.mk>

freebsd/distinfo

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SHA256 (net-snmp-subagent-shell-2.3.0.1.tar.gz) = 2b06e2539f77754eae47e7c752dcd6a84092acf1d4edd2b7aa95c338a9f2678f
2+
SIZE (net-snmp-subagent-shell-2.3.0.1.tar.gz) = 84079

freebsd/files/pkg-message.in

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
**** This port installs net-snmp subagent-shell(subagent_shell) but does not start it by default.
2+
If you want to auto-start subagent-shell, add the following to
3+
/etc/rc.conf:
4+
5+
subagent_shell_enable="YES"
6+
7+
configuration files, MIBS, functions are located at %%PREFIX%%/etc/snmp/subagent-shell
8+
9+
please note that in the order to run subagent-shell you have to run net-snmp snmpd
10+
and configure agentx; add the following line to snmpd configuration file(snmpd.conf):
11+
12+
master agentx

freebsd/files/subagent_shell.in

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
# PROVIDE: subagent-shell
4+
# REQUIRE: DAEMON snmpd
5+
#
6+
# Add the following line to /etc/rc.conf to enable subagent-shell:
7+
#
8+
# subagent_shell_enable="YES"
9+
# subagent_shell_flags="<set as needed>"
10+
11+
. /etc/rc.subr
12+
13+
name=subagent_shell
14+
rcvar=subagent_shell_enable
15+
16+
load_rc_config subagent-shell
17+
18+
subagent_shell_enable=${subagent_shell_enable:-"NO"}
19+
20+
pidfile=${subagent_shell_pidfile:-"/var/run/subagent_shell.pid"}
21+
command_interpreter=%%PERL%%
22+
23+
command=%%PREFIX%%/bin/${name}
24+
start_precmd=subagent_shell_precmd
25+
26+
subagent_shell_precmd () {
27+
rc_flags="-d -b /usr/local/etc/snmp/subagent-shell -p ${pidfile} ${rc_flags}"
28+
}
29+
30+
31+
run_rc_command "$1"

freebsd/pkg-descr

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Net SNMP subagent executes arbitrary commands and provide results via snmpd

freebsd/pkg-plist

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@dir etc/snmp/subagent-shell
2+
@dir etc/snmp/subagent-shell/mibs
3+
@dir etc/snmp/subagent-shell/conf.d
4+
bin/subagent_shell
5+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-APACHE-STATUS-MIB.txt
6+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-DISKSTATS-MIB.txt
7+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-DNSLOOKUP-MIB.txt
8+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-EXEC-COMMAND-MIB.txt
9+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-HTTP-RESPONSE-MIB.txt
10+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-IP-CONNTRACK-MIB.txt
11+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-LAST-LOGINS-MIB.txt
12+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-MAILQ-MIB.txt
13+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-MIB.txt
14+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-NTPSYNC-STATUS-MIB.txt
15+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-OSINFO-MIB.txt
16+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-PING-STAT-MIB.txt
17+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-PROC-STAT-MIB.txt
18+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-RNDC-STAT-MIB.txt
19+
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-VMSTAT-MIB.txt
20+
etc/snmp/subagent-shell/subagent-shell-base.functions
21+
etc/snmp/subagent-shell/subagent-shell-conf.xml
22+
etc/snmp/subagent-shell/subagent-shell-functions-conf.xml
23+
share/man/man8/subagent-shell.8

0 commit comments

Comments
 (0)