-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Net SNMP subagent executes arbitrary commands and provide results via snmpd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |