cancel
Showing results for 
Search instead for 
Did you mean: 

Get values from OID add create own alarm in EMC

Get values from OID add create own alarm in EMC

StephanH
Valued Contributor III
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

Regards Stephan
6 REPLIES 6

StephanH
Valued Contributor III
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

Regards Stephan

yes, thanks for sharing!

Thanks for sharing this!

StephanH
Valued Contributor III
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
Regards Stephan
GTM-P2G8KFN