SNMP Manager

Has anybody done a simple manager for SNMP so that PACs could get SNMP data from a third party device i.e. The status of the power available from a UPS.
The command required is GetNextRequest

Hi Fernando,

We don’t have SNMP manager functionality in our devices, only agent functionality. However, since you can build tcp (and udp) packets using communication handles in your strategy, you might be able to build some SNMP manager functionality. Do you know exactly what those packets look like (perhaps by sniffing the exchange between some other SNMP manager and your UPS)?

But before you go down that not-so-easy path, are there any other protocols your UPS uses that might be easier? (Perhaps a web page that could be read/parsed by the strategy, for example?)



I’m echoing Mary here in a lot of ways…

At the hospital we had some big UPS’s with built-in web servers; screen scraping them would have been an option that I would have looked at for sure.

If the UPS sends SNMP for status every X seconds, or on some (just to make it easier to test) user generated trigger, it might be worth checking to see if it can be sent to a specific IP address. If so, you could knock together a chart that opens a comm handle and just see what you get as a quick test.
There is a thread that talks about how to do this with UDP (TCP is the same concept) over here;

Have fun and let us know what you end up using / finding out.


Mary & Ben:
Thanks for the feedback, parsing SNMP is not trivial. (should be simple).
The UPS at hand has a serial port with their protocol intended to be used with their software on a server.
The Eth. interface talks their protocol and SNMP, their protocol would solve the problem for the particular app, SNMP would allow me to get data from other equipment. I could sniff both of them and buid a piece of code. Conecting via serial is out of the question.
I was just hopping that I was not the first one through the rabbit hole and that there was a HAT willing to share.

I have a need to implement an SNMP manager in an Opto chart, did anything ever come of this? I’m probably looking at implementing Get requests and possibly Traps.

Hello philip,

Welcome to the OptoForums! Could you give us a slightly broader big-picture view of what you’re trying to do? Even though I’m a huge fan of using comm handles to communicate with stuff, I wouldn’t want to roll my own SNMP manager in a PAC Control strategy/chart.

My guess is there’s a less painful way to get to where you want to go. For example, our partner, Kepware’s has a communications platform (KEPServerEX, which has a 2 hour trial) which has a driver for SNMP and is good at moving data from X to Y…

But we’d love to hear more about your setup/needs to give you the best suggestions possible!


Hi SNMP fans,

I whipped up this chart the other day to listen for SNMP traps, I thought I’d share in case anyone else out there is trying to get SNMP data into a PAC from another device.

As Fernando mentioned above, parsing SNMP data is not necessarily Simple like the acronym would imply.

However, have a look at this this sample string table, which shows some traps coming from another PAC, as well as some traps coming from the nearby Xerox printer, both configured to send v1 traps to my R1…
you can see some string info a the end of the strings that might include the info you need:

Don’t forget to set up your SNMP device (printer, UPS, etc.) to send traps to the PAC running the attached chart you can import into your strategy.

Hope that helps! (2.8 KB)

Hi, i know i am a little late here, i’m a peasant in cantv in Venezuela and the project i need to get data from the energy equipment in the main facility in Caracas, UPS, PDU, Precision air, dry coolers, etc. And SNMP is the best way to get the data, has Fernando said Connecting via serial is out of the question, and only 6 use MODBUS/TCP, so SNMP is the best way to get that data, here are my questions:

-Is it possible to use the PAC Sim to test the TrapListener Chart?
-Why is not available a SNMP manager integration kit? it seems odd that it is not one already, just saying, i will try to implement the PAC like a SNMP Manager because it is the protocol that it’s use in 80% of the equipment’s here

Maybe i need to use the snmpwalk request to get more than one value from only one MIB. Any help you can give me i would be fantastic, and hope you are all great.


Welcome to the OptoForums! Yes, you could try this out with PAC Sim. The chart uses a udp comm handle which is not yet officially supported, but it’s how we talk to all the I/O Units, and works in PAC Sim, SoftPAC, -R1, -R2, -S1, etc.

When you configure your SNMP devices, just send the traps to that IP address of the PC running PAC Sim.

As Fernando mentioned, SNMP is NOT simple, otherwise we might’ve done a kit. You’ll notice my example only parses part of the trap packets coming in. I’m hoping you’ll only need a little bit if info that’s easy to pick out from the traps. Normally the info you want is at the very end of the received string.

I did once write some OptoScript to do a “get” of one piece of SNMP info I needed, but it was not pretty. Essentially I just did a wireshark sniff of the packet my Windows MIB Browser sent, built that same packet in OptoScript, then figured out which byte coming back was the one I needed. Pretty brute force and not something I’d normally recommend.

thanks for the advice, maybe i can use the string to create the SNMP polling request then close that comm handle and open one like the TrapListener with port 161 to wait for the response, i was thinking to create the message in the string, the header and the PDU part and send it, i will be a different string for every value in an Agent MIB’s, it’s pretty brute force and limited but what do you think?
I was searching for the message format but i couldn’t find an example for the request message, i know the is the header and the PDU part maybe you can help me with an example, i know i need to know the specific OID i want in a particularly MIB, it is something like this:

Version, community, PDU type, request ID, Error status, Error index, Variable Bindings

Hi i want it to tell you that my code, with part of the traplistener code you did, works like a manager and does a succesfully Get request message, and the puts in a table the get response. Thanks for the TrapListener you gave us.


Where can i download the code? Need to test. Customer wants to include the APC UPS units into the existing OPTO 22 monitoring they have using SNMP.



Does the UPS send traps?

You may want to check if the UPS supports modbus, which would be “simpler” than SNMP. I’ve interfaced with multiple APC UPS units over modbus RTU (serial) with a modbus interface card. Had to use RS232* to RS485 adapters to do it since these only had serial ports on them.

*Beware that APC has a nonstandard RS232 pinout if you don’t use their proprietary cable.