Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

SNMP OIDs?

E

ElPatron

Guest
Hi all,

is there a list of the OIDs supported by freenas? I walked thru and I only got a handful of values like system description (.1.3.6.1.2.1.1.1.0), uptime (.1.3.6.1.2.1.1.3.0).

Perhaps there is a MIB file? Didn´t find much information about it...

Background: We have to monitor our customers devices concerning various aspects as free disk space, load, network et. al. We use Nagios for these purposes and all I got out of my FN box is some basic data:



Thanks for any hints, if anyone´s interested I will post the corresponding Nagios Check-Commands.

Markus
 

Durkatlon

FreeNAS Experienced
Joined
Aug 19, 2011
Messages
415
OK, I had to heavily edit this reply because my initial solution did not persist across reboots.

Basically you should first try editing /etc/snmpd.config and restarting the daemon until you see all the MIBs that you are interested in. In this example I'll add the MIB-II module which is not loaded by default into the bsnmpd daemon.

First we'll just try getting it to work (this will not be persistent yet). Add the following line to the configuration file /etc/snmpd.config:

Code:
begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so"


Then restart the service:

Code:
# /etc/rc.d/bsnmpd restart


If all is well you should now be able to see all the usual network statistics entries when you snmpwalk from a remote machine. For ideas on additional helper modules you can load, take a look at the /conf/base/etc/snmpd.config file. This has all kinds of modules loading into the daemon. Note that this file is not used by FreeNAS at all!

OK, so now to make it persistent. The way the snmpd.config is created during system boot, is from the /etc/rc.d/ix-bsnmpd script. Now, if we were to modify this script directly this would not survive a reboot either, so we will modify /conf/base/etc/rc.d/ix-bsnmpd.

First, make the root file system mount read-write:

Code:
# mount -uw /
# vi /conf/base/etc/rc.d/ix-bsnmpd


Look for the section that reads:

Code:
...
sysDescr = \$(description)

E*O*F
          done
...


and add your own configuration lines before the EOF part, like for instance:

Code:
sysDescr = \$(description)

begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so"

E*O*F
          done
...


Now try rebooting the system. If everything was done right, you should see the new /etc/snmpd.config created with the extra configuration lines that load your modules.
 
E

ElPatron

Guest
Hi Durkatlon,

I just read your reply, great thanks! I will try it out tomorrow and report my experiences.

Markus
 

William Grzybowski

FreeNAS Guru
iXsystems
Joined
May 27, 2011
Messages
1,745
FWIW you should be able to use "Auxiliary parameters" field within the GUI SNMP settings intead of this black magic voodoo...
 

Durkatlon

FreeNAS Experienced
Joined
Aug 19, 2011
Messages
415
FWIW you should be able to use "Auxiliary parameters" field within the GUI SNMP settings intead of this black magic voodoo...
Oh snap, I had figured that was for command-line options or somesuch. Never even noticed the SQLite command after the "E*O*F done" part that reads the extra parameters.

You are absolutely correct. You can put extra options you want in the "Auxiliary parameters" field of the SNMP configuration dialog. This will stick the values into the configuration database, which means the changes will also persist if you upgrade FreeNAS to a newer version. My solution would have to be re-applied after each update.

The problem I have right now is that if I try to stick my particular option in there, it will not take it because it deems the slashes in my parameter to be illegal characters. This may just be a bug that needs to be addressed separately. I tried escaping the characters with backslashes, but those are also deemed illegal characters:

Code:
bad character '\'
  in file /etc/snmpd.config line 32
error in config file

For now I'll keep using my solution until I can figure out how to properly get the UI to accept the "illegal" characters.
 

Durkatlon

FreeNAS Experienced
Joined
Aug 19, 2011
Messages
415
What are you trying to use in auxiliary parameters? Can you paste the whole thing?
Just this one line that adds MIB-II to bsnmpd:
Code:
begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so"

The errors show on the console although from the GUI side everything appears to go normal.
 
E

ElPatron

Guest
Okay, first of all, thanks Durkatlon and William for your very helpful replies! Adding the 'mibII' module to the tree helped a lot. I can now gather at least some more information than before.

Unfortunately, FN still doesn´t report anything about the status of any storage devices (disk(s), volume(s), zpool status) and memory allocation. I think, this question goes a little bit deeper into FNs system so I don´t expect an answer, but if you have any idea how to gather more information I´d be really glad.

Here is a paste of the snmp-walk (FreeNAS-8r7350-amd64).


Regards,
Markus
 

snowmirage

Newbie
Joined
Sep 20, 2011
Messages
29
Thanks for the info this is just what I had been searching for.

I do seem to be having an issue with this though.

I added

"begemotSnmpdModulePath."mibII" = "/usr/lib/snmp_mibII.so"

to the Auxiliary parameters of the SNMP config window

and it saved the changes. However when I try to start the SNMP service it errors.

Checking my log server I find

freenas8 snmpd[19756]: error in config file

I'm not sure why, maybe something changed between versions?

I am currently running FreeNAS-8.0.1-RC2-amd64 (7813)

*EDIT*

Hmmm maybe I am hitting the same problem Durkatlon was having in post #5
 

Durkatlon

FreeNAS Experienced
Joined
Aug 19, 2011
Messages
415
The newer builds already have snmp_mibII.so in the default configuration. When you added it to the Aux Params the system detected a duplicate entry and refused to start the SNMP daemon. Just blank out the Aux Params field again and you should be fine. There's some other libraries that are not included by default that you could still enable through this field though.
 

wussy

Newbie
Joined
Jan 11, 2012
Messages
50
Hi,

I really wan´t to check the system with nagios by snmp. I have the mib2 already linked into the system and it is working. But for what i can see MIB2 only uses Network and some minior things like uptime. Is there a way to expand the possibilities of checks?!
 
Joined
Jun 6, 2012
Messages
1
Old thread, but what you (probably) want if you're trying to monitor disk usage is this:
Code:
begemotSnmpdModulePath."hostres" = "/usr/lib/snmp_hostres.so"

Which will expose the HOST-RESOURCES MIB, which itself has information on filesystems and other stuff.
 
Top