Reading custom MIB snmp value

I was able to “walk” through SNMP values of my RMS-200 board. I even added the MIB provided bt EtherTek and I’m able to read everything I wanted. That is good.

I wanted to graph my batteries plugged to the voltmeter 1. Easy, right-click on the proper value in SNMPwalk and select add data source. But when I click on the TEST button, I get no result. This is bad.

Where things get ugly is that I can create a data source on every other SNMP values. But I cannot read anything from provided by the RMS-200 manufacturer. It simply doesn’t work by name, neither Oid. The SNMP Walk work just fine, but no datasource data gets through.

Of course, I feel like I’m the only one on the planet having this specific problems…

I’m running the latest stable release, 3.6.

Dany Chouinard
Abicom inc

Datasources are useful for charts, they look roughly like this… oid_raw(“1.3.6.1.2.1.1.7.0”, 5, 5, “192.168.1.1”, “v1-public”)

Adding the SNMP MIB only replaces the number with the name (unless the oids are not in the internet mib 2 specification). i.e. all oids will start 1.3.6. Although it is handy to be able to read the names you do not need to add the mib to find the oid you might be interested in.

If you just want to chart your voltage just go to charts, create a new chart, add your datasource and you are done. If you want to create probes to complain when you have something out of range you should read around the user manual a bit.

Here is a template that everyone should follow. Use a function to read the OID values and use a probe to verify those values. Every function should have two results, the result you are interested in graphing and the result you get when the OID is not available. Every probe should return true, the error value or indicate the inability to read any value. (Note: true = “”)

The following function checks to make sure that the OID that is attempted to be read actually has a value in it even if it is “0” the result will be true. Notice the +1, this should be subtracted out just before graphing and testing the value in the probe.
Function: test
CODE: if(string_size(oid(“x.x.x”)), oid(“x.x.x”)+1, “False”)

The following probe verifies that the oid is actually available, then tests the oid vs a value and returns an error if the value is outside the range and then if the device is down it will complain that the oid is unreachable. Finally drop the value in to graph -1. This was based on a CPU probe.
Probe: testoid
AVAILABLE: test() <> “False”
ERROR: if(test()<>“False”,if(test() -1< 80, “”, concatenate("Warning: high CPU = ", test(), “%”)), “Device unreachable”)
VALUE: test()-1
UNIT: %

Note to verify that your function works go to the appearance of a device and put test() on the device label.

HTH,
Lebowski

I’m really amaze by what can be done with The Dude. I have overlooked the product too long before rediscovering it and it’s features are endless! The information given by lebowski are really awesome.

But for some reason I still cannot read some Oid - either by name or by number. You mentionned the function oid_raw(), i’ll give it a shout tonight. Hopefully I’ll get something else than my usual “0”

Just as a reminder :

  • I can read Oid’s with ManageEngine MibBrowser (well, I wasn’t on my Linux machine at that time, sorry)
  • I can read Oid’s with the SNMPWALK found in the Dude
  • I can read most Oid within a data source (system name or interface details for example)
  • I cannot get value from the a data source, for the voltage information.

I’m reading an Ethertek RMS-200 board.

Thanks for the Karma! I meant to mention oid_raw… That will probably fix your trouble. Also what value do you get when you right click and copy the value? Pasting the copied value into notepad might help determine why you are not seeing it with just OID.

Every time I start work on a new function I put it on the device label so I can tell if it is working, if it is on a test device I will set the label refresh interval down to 15 seconds or so.

No ethertek boards here so I can’t help there but instead of using a datasource build a probe then you can add that as a service on the device (make certain it is working as planned) and that service can be added to a chart.

Let us know what you find,
Lebowski