How to configure to get data from SNMP Table of alarms
-
Hi All,
I have an Eaton UPS where the alarms are presented in what looks like a dynamic SNMP table.
I need to be able to get the alarms from this device to pass up and get an event handler to fire.
I've uploaded the MIB as an attachment (EATON-PXG-MIB) as well as a screenshot from my mib browser showing some sample results.
Other devices I've configured in the past have a static table of true/false OIDs for different alarms, but this one is a bit different.
Cheers!
-Shaun
[0_1502947011173_EATON-PXG-MIB.txt](Uploading 100%)
-
Hi shaun,
I'm not sure I understand what you mean by dynamic table. Can you try uploading the mib again?
It sounds like you mean the OIDs only exist when the alarm is active, rather than the they have consistent OIDs for an alarm condition. But, if the don't, how's the MIB going to describe them? You have to read the description each time? Googling "SNMP dynamic table" found an oppositional stackoverflow thread that disputed such a thing is valid.
-
@phildunlap
Try this URL for the mib:
https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiKosKUy93VAhWFy7wKHfsQBOAQFggoMAA&url=http%3A%2F%2Fpqlit.eaton.com%2Fll_download_bylitcode.asp%3Fdoc_id%3D29400&usg=AFQjCNFxtuKksQdwY-6tszPc-HOZmTn7_AThe file upload thing doesn't seem to be working for some reason...
Dynamic table was probably the wrong wording for it.. but the content of the table is variable.. if you have a look at the screenshot attached to this post, i did a walk on the 'activealarmstable' and you can see the alarmSequenceIndex.N results where N is a unique ID for the alarm. That index is then used as a suffix with the description, value, level and time to form what could be interpreted as a table. I called i dynamic (in error?) because the content and index numbers are totally variable.
Cheers!
-Shaun -
Have you seen that SNMP REST endpoints were added for doing walks or reads? There is no way to configure an SNMP to easily support this sort of system. Depending on what you're trying to achieve (storing all alarms into an alphanumeric of the alarms the device has had?) you may be able to do this with a combination of the API and a scripting data source.
If the SNMP API endpoints get you results, we can explore a way poll using walks through the API. It's probably possible, but it may get convoluted.
-
You could also do it more directly with a script, possibly. Maybe something like...
var container = new com.infiniteautomation.mango.rest.v2.util.MangoRestTemporaryResourceContainer("Script_"); var snmpSettings = new com.serotonin.m2m2.web.mvc.rest.v2.SnmpSettings(); snmpSettings.version = "v2c"; snmpSettings.host = "localhost"; snmpSettings.port = 9000; snmpSettings.retries = 0; snmpSettings.timeout = 250; snmpSettings.readCommunity = "Hi!"; snmpSettings.oid = "1"; var scriptUser = new com.serotonin.m2m2.vo.User(); scriptUser.username = "script"; scriptUser.id = 1; //will appear as admin in records, probably var walk = new com.serotonin.m2m2.snmp.mib.SnmpWalkTask("ScriptWalk", scriptUser, snmpSettings, container); var count = 0; while(count < 10 && !walk.isFinished()) { RuntimeManager.sleep(100); count += 1; } print(walk.getResults());
-
Thanks Phil, I'll see what I can come up with!
In the short term, Its probably going to be easier to just capture the values from the static OIDs and do checks within mango for out of range with an event detector.
Cheers!
-Shaun