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