SNMP Extension
-
Hi,
Searched around, but can't seem to find an answer to this. Does pfSense support SNMP Extension?
Thanks!
-
Could you elaborate on what you mean by "SNMP Extension"?
pfSense supports SNMP (Services > SNMP) using the bsnmp daemon from FreeBSD, and there are some modules that add extra functionality to SNMP, but without knowing specifically which "Extension" is being referred to there, it's impossible to say if it's supported.
-
You bet!
SNMP allows you to "extend" it, using exec or extend commands (some info / examples below). By adding this information to the snmpd.conf file, you can have snmp return information outside of the normal / stock info (by executing shell commands, and returning the information).
http://net-snmp.sourceforge.net/wiki/index.php/Tut:Extending_snmpd_using_shell_scripts
http://net-snmp.sourceforge.net/docs/man/snmpd.conf.html#lbAZ
http://www.net-snmp.org/docs/FAQ.html#What_s_the_difference_between__exec____sh____extend__and__pass__Make sense?
I have been using it on my (Tomato-based) router as well .. adding information to the configuration file, and yes - it returns custom information … :). Very powerful, and very handy. I think pfSense just needs to allow these commands to be added to the snmpd.conf file (assuming "stock" net-snmp is supported, which I think is likely the case).
Thanks!
-
These extensions are particular to the net-snmp implementation. pfSense uses bsnmp which is a different implementation.
-
dennypage is correct. Those are for a different SNMP daemon. Ours does not support those mechanisms for running commands.
-
Gotcha. And there are no custom extension options for bsnmp?
Thanks!
-
No
-
Hmmm … OK, was typing this in parallel ... :). There seem to be, noted here,
https://www.freebsd.org/cgi/man.cgi?query=bsnmp-ucd&apropos=0&sektion=8&manpath=FreeBSD+Ports+10.2-RELEASE&arch=default&format=htmlOr is this not fully supported? Just trying to understand!
Here is what I'm talking about,
With bsnmp-ucd you can also extend bsnmpd agent functionality specifying
arbitrary commands in UCD-SNMP-MIB::extTable. To add new command you
should add following lines in bsnmpd(1) configuration file, in bsnmp-ucd
module section:extNames. <index>= <name>extCommand. <index>= <commandline>For example, to collect lastpid statistics under mib UCD-SNMP-
MIB::extOutput.0 you can specify:extNames.0 = "lastpid"
extCommand.0 = "/sbin/sysctl -n kern.lastpid"</commandline></index></name></index> -
Keep reading. They are not executed on demand, and the output control is limited. It's not quite the same.
-
Yep, agreed - you're absolutely right! I did try a custom command (manually edited /var/etc/snmpd.conf) - and the command does work, but it doesn't update on demand (just like you said), rather it executes on a preset / configured schedule. That may be OK though - is there a way to set the custom commands? If not, not a biggie - would just be handy.
Thanks!