I am working with snmpd using FreeBSD and am trying to test a simple shell script using snmpd.conf. Here is what my snmpd.conf file looks like:
The last line is the script I am trying to run but when I kill the daemon process and try to start it again in order for the daemon to re-read the configuration file it will not start.
When I comment out the last line it restarts again just fine. I have tried writing this many different ways thinking it is syntactically wrong such as exec or sh instead of extend but no matter which changes I make the daemon will not restart. I have tried mimicking many tutorials for extending snmpd.conf with shell scripts but none of them work.
Code:
location :="default_SNMP"
contact :="contact string"
read :="public"
description :="test string"
system :=1# pfSense%snmpd
begemotSnmpdDebugDumpPdus =2
begemotSnmpdDebugSyslogPri =7
begemotSnmpdCommunityString.0.1= $(read)
begemotSnmpdCommunityDisable =1
begemotSnmpdPortStatus.0.0.0.0.161=1
begemotSnmpdLocalPortStatus."/var/run/snmpd.sock"=1
begemotSnmpdLocalPortType."/var/run/snmpd.sock"=4
# These are bsnmp macros not php vars.
sysContact = $(contact)
sysLocation = $(location)
sysDescr = $(description)
sysObjectId =1.3.6.1.4.1.12325.1.1.2.1.$(system)
snmpEnableAuthenTraps =2
begemotSnmpdModulePath."mibII"="/usr/lib/snmp_mibII.so"
begemotSnmpdModulePath."netgraph"="/usr/lib/snmp_netgraph.so"%netgraph
begemotNgControlNodeName ="snmpd"
begemotSnmpdModulePath."pf"="/usr/lib/snmp_pf.so"
begemotSnmpdModulePath."hostres"="/usr/lib/snmp_hostres.so"
#extend testSnmp /bin/sh /usr/local/bin/testSnmp.sh
When I comment out the last line it restarts again just fine. I have tried writing this many different ways thinking it is syntactically wrong such as exec or sh instead of extend but no matter which changes I make the daemon will not restart. I have tried mimicking many tutorials for extending snmpd.conf with shell scripts but none of them work.