SNMP function for Ignition version 8

Hi all.

Here you have a simple SNMP function tested with v1/v2c devices under V8

As of now the only operation available is snmp Get and can be called by using system.snmp.snmpGet(‘community’, ‘address’, port, ‘OID’)
Returns value as string

I was in need of a simple function for SNMP. The driver on market seems a little complicated and
the free one made by BYES for V7.9 is not free anymore for V8 ( for a good reason )

So I asked my son for help, we took the function example, tweaked the code from here and we got
exactly what I needed. Module and source are available on github.

Any comments are welcomed.
Enjoy

1 Like

Looks good!

One nit: You have your java package name backwards, and it doesn’t have elements to uniquely identify your module. It should be something like ca.allnetauto.ignition.snmp, assuming your company’s domain name is allnetauto.ca. Consider adding an element to the package names to indicate their scope, like ca.allnetauto.ignition.snmp.common.

1 Like

Thank you for pointing that one out, good observation.
Will fix it in the next revision.

Unrelated to your direct post - how did you make a modl for Ignition? It was something I was thinking about trying my hand at just to learn how but I can’t find any good resources. I assume you had to do it in Java?

Start here:
https://docs.inductiveautomation.com/display/SE/Creating+a+Module

Warning. You are expected to know at least the basics of Java programming. But really need to be at least at an intermediate level to understand what is going on.

With that said, once you have your environment set up you can find ready made examples at:

1 Like

There’s also some cool stuff in the works for quick generation of module ‘skeletons’ - expect to hear more about that soon, probably here on the forums.

6 Likes

Though it seems overwhelming at start, following the examples gives you a pretty good understanding on how to make a module. And also the .modl file was generated at the end when running mvn package, just keep trying to figure it out. Good luck

Ver 1.0.1 is now here.

This version adds the ability to get multiple OIDs from a single request, and also to change the snmp version, retry count and timeout.