Shell Trying to use snmpd shell script but daemon won't restart

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:
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
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.
 
After much trial and error it seems to be the case that bsnmpd does not support shell scripts. I am wondering how I can make use of the snmpd.conf file to tell me information about certain files. I know I can already inject information into it such as
Code:
description:= "an informative string"
I basically need to gather things such as version info from various files and be able to pull that info through snmp using one OID. So I thought I could use this conf file to help me. I was thinking of writing a script which parsed all the files I need so I have all the info I need in one text file. Now what to do with this text file I have with the info I need to send through snmp is stumping me. Any ideas?
 
Back
Top