The pfSense Store

Author Topic: SNMP Extension  (Read 4247 times)

0 Members and 1 Guest are viewing this topic.

Offline arrmo

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +7/-0
    • View Profile
SNMP Extension
« on: August 13, 2016, 07:02:59 pm »
Hi,

Searched around, but can't seem to find an answer to this. Does pfSense support SNMP Extension?

Thanks!

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21374
  • Karma: +1431/-26
    • View Profile
Re: SNMP Extension
« Reply #1 on: August 17, 2016, 09:44:53 am »
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.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline arrmo

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +7/-0
    • View Profile
Re: SNMP Extension
« Reply #2 on: August 17, 2016, 06:48:09 pm »
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!

Offline dennypage

  • Hero Member
  • *****
  • Posts: 697
  • Karma: +133/-0
    • View Profile
Re: SNMP Extension
« Reply #3 on: August 17, 2016, 07:33:01 pm »
These extensions are particular to the net-snmp implementation. pfSense uses bsnmp which is a different implementation.

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21374
  • Karma: +1431/-26
    • View Profile
Re: SNMP Extension
« Reply #4 on: August 17, 2016, 07:38:39 pm »
dennypage is correct. Those are for a different SNMP daemon. Ours does not support those mechanisms for running commands.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline arrmo

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +7/-0
    • View Profile
Re: SNMP Extension
« Reply #5 on: August 17, 2016, 07:40:36 pm »
Gotcha. And there are no custom extension options for bsnmp?

Thanks!

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21374
  • Karma: +1431/-26
    • View Profile
Re: SNMP Extension
« Reply #6 on: August 17, 2016, 07:41:01 pm »
No
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline arrmo

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +7/-0
    • View Profile
Re: SNMP Extension
« Reply #7 on: August 17, 2016, 07:42:52 pm »
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=html

Or 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"


Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21374
  • Karma: +1431/-26
    • View Profile
Re: SNMP Extension
« Reply #8 on: August 17, 2016, 07:45:31 pm »
Keep reading. They are not executed on demand, and the output control is limited. It's not quite the same.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline arrmo

  • Sr. Member
  • ****
  • Posts: 349
  • Karma: +7/-0
    • View Profile
Re: SNMP Extension
« Reply #9 on: August 17, 2016, 08:06:08 pm »
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!