Get values from OID add create own alarm in EMC
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎01-16-2018 12:59 PM
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
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎01-22-2018 08:24 PM
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
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎01-22-2018 08:24 PM
yes, thanks for sharing!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎01-22-2018 08:24 PM
Thanks for sharing this!
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
‎01-22-2018 08:24 PM
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
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
