Skip to content

Commit

Permalink
freebsd port added
Browse files Browse the repository at this point in the history
  • Loading branch information
newsgate committed Oct 6, 2015
1 parent d588fa0 commit 793f599
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 0 deletions.
33 changes: 33 additions & 0 deletions freebsd/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# $FreeBSD$

PORTNAME= net-snmp-subagent-shell
PORTVERSION= 2.3.0.1
CATEGORIES= net-mgmt
MASTER_SITES= https://github.com/sergevs/net-snmp-subagent-shell/releases/tag/${PORTVERSION}

MAINTAINER= [email protected]
COMMENT= A complete implementation of net-snmp subagent written on perl. Can be used to define arbitrary functions and provide the results via snmp.

USE_RC_SUBR= subagent_shell

USES=perl5
USE_PERL5= run
USE_AUTOTOOLS= aclocal:env automake:env autoconf:env

RUN_DEPENDS:= p5-XML-Simple>=2.10:${PORTSDIR}/textproc/p5-XML-Simple \
net-snmp>=5.5:${PORTSDIR}/net-mgmt/net-snmp

SUB_FILES= pkg-message
SUB_LIST= PERL=${PERL}

post-configure:
@cd ${CONFIGURE_WRKSRC}; \
aclocal; \
automake --add-missing; \
autoconf; \
./configure

post-install:
@mv ${STAGEDIR}${PREFIX}/bin/subagent-shell ${STAGEDIR}${PREFIX}/bin/subagent_shell

.include <bsd.port.mk>
2 changes: 2 additions & 0 deletions freebsd/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SHA256 (net-snmp-subagent-shell-2.3.0.1.tar.gz) = 2b06e2539f77754eae47e7c752dcd6a84092acf1d4edd2b7aa95c338a9f2678f
SIZE (net-snmp-subagent-shell-2.3.0.1.tar.gz) = 84079
12 changes: 12 additions & 0 deletions freebsd/files/pkg-message.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
**** This port installs net-snmp subagent-shell(subagent_shell) but does not start it by default.
If you want to auto-start subagent-shell, add the following to
/etc/rc.conf:

subagent_shell_enable="YES"

configuration files, MIBS, functions are located at %%PREFIX%%/etc/snmp/subagent-shell

please note that in the order to run subagent-shell you have to run net-snmp snmpd
and configure agentx; add the following line to snmpd configuration file(snmpd.conf):

master agentx
31 changes: 31 additions & 0 deletions freebsd/files/subagent_shell.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

# PROVIDE: subagent-shell
# REQUIRE: DAEMON snmpd
#
# Add the following line to /etc/rc.conf to enable subagent-shell:
#
# subagent_shell_enable="YES"
# subagent_shell_flags="<set as needed>"

. /etc/rc.subr

name=subagent_shell
rcvar=subagent_shell_enable

load_rc_config subagent-shell

subagent_shell_enable=${subagent_shell_enable:-"NO"}

pidfile=${subagent_shell_pidfile:-"/var/run/subagent_shell.pid"}
command_interpreter=%%PERL%%

command=%%PREFIX%%/bin/${name}
start_precmd=subagent_shell_precmd

subagent_shell_precmd () {
rc_flags="-d -b /usr/local/etc/snmp/subagent-shell -p ${pidfile} ${rc_flags}"
}


run_rc_command "$1"
1 change: 1 addition & 0 deletions freebsd/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Net SNMP subagent executes arbitrary commands and provide results via snmpd
23 changes: 23 additions & 0 deletions freebsd/pkg-plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@dir etc/snmp/subagent-shell
@dir etc/snmp/subagent-shell/mibs
@dir etc/snmp/subagent-shell/conf.d
bin/subagent_shell
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-APACHE-STATUS-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-DISKSTATS-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-DNSLOOKUP-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-EXEC-COMMAND-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-HTTP-RESPONSE-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-IP-CONNTRACK-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-LAST-LOGINS-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-MAILQ-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-NTPSYNC-STATUS-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-OSINFO-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-PING-STAT-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-PROC-STAT-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-RNDC-STAT-MIB.txt
etc/snmp/subagent-shell/mibs/SUBAGENT-SHELL-VMSTAT-MIB.txt
etc/snmp/subagent-shell/subagent-shell-base.functions
etc/snmp/subagent-shell/subagent-shell-conf.xml
etc/snmp/subagent-shell/subagent-shell-functions-conf.xml
share/man/man8/subagent-shell.8

0 comments on commit 793f599

Please sign in to comment.