Header Only - DO NOT REMOVE - Extreme Networks

Get values from OID add create own alarm in EMC


Userlevel 5
Hello,

is there a way to do an snmp get for arbitrary OIDs (for other vendors,too) and create an alarm if needed via a script (python, TCL, ...).

As I can see netsnmp for python is not installed. Can I install netsnmp and use it with the GUI scripting section on EMC (not the legacy tool)?

I will check some MIB values with a program logic and create an alarm or an syslog entry (with these syslog entry I can use the alarm manager in a second step).

Best regards
Stephan

6 replies

Userlevel 5
Hello,

with the help of the GTAC if found a solution for my problem. There are two tools in /usr/bin.

First "snmpget" and second "logger" both are well documented linux tools. I can call both tools via a python script and get with snmpget the needed OID and after some program lines I can wrote an Syslog entry with logger.

Thank you very much to GTAC!

Best regards
Stephan
Userlevel 7
SH wrote:

Hello,

with the help of the GTAC if found a solution for my problem. There are two tools in /usr/bin.

First "snmpget" and second "logger" both are well documented linux tools. I can call both tools via a python script and get with snmpget the needed OID and after some program lines I can wrote an Syslog entry with logger.

Thank you very much to GTAC!

Best regards
Stephan

Thanks for coming back to share the answer 🙂
Userlevel 3
SH wrote:

Hello,

with the help of the GTAC if found a solution for my problem. There are two tools in /usr/bin.

First "snmpget" and second "logger" both are well documented linux tools. I can call both tools via a python script and get with snmpget the needed OID and after some program lines I can wrote an Syslog entry with logger.

Thank you very much to GTAC!

Best regards
Stephan

do you want to share the final script with us? would be great
Userlevel 5
SH wrote:

Hello,

with the help of the GTAC if found a solution for my problem. There are two tools in /usr/bin.

First "snmpget" and second "logger" both are well documented linux tools. I can call both tools via a python script and get with snmpget the needed OID and after some program lines I can wrote an Syslog entry with logger.

Thank you very much to GTAC!

Best regards
Stephan

Hello Kurt,

here is my short python testscript. Runs in the bash and in the EMC gui out of the box.

------
import commands

#snmpget command line for system contact
command = "/usr/bin/snmpget -v3 -l authPriv -u admin -a MD5 -A passwd -x DES -X passwd 192.168.1.1 1.3.6.1.2.1.1.4.0"

#snmpget
systemcontact = commands.getoutput(command)

#cut unnecessary parts in snmpget answer
start = systemcontact.find(":")
start = start+2
systemcontact = systemcontact[start:]

#create syslog entry
alarm = commands.getoutput("logger" + " " + systemcontact)

---

Now you will see a new syslog entry.

Best regards
Stephan
Userlevel 6
SH wrote:

Hello,

with the help of the GTAC if found a solution for my problem. There are two tools in /usr/bin.

First "snmpget" and second "logger" both are well documented linux tools. I can call both tools via a python script and get with snmpget the needed OID and after some program lines I can wrote an Syslog entry with logger.

Thank you very much to GTAC!

Best regards
Stephan

Thanks for sharing this!
Userlevel 3
SH wrote:

Hello,

with the help of the GTAC if found a solution for my problem. There are two tools in /usr/bin.

First "snmpget" and second "logger" both are well documented linux tools. I can call both tools via a python script and get with snmpget the needed OID and after some program lines I can wrote an Syslog entry with logger.

Thank you very much to GTAC!

Best regards
Stephan

yes, thanks for sharing!

Reply