ExtremeCloud IQ- Site Engine & Extreme Management Center

Expand all | Collapse all

Get values from OID add create own alarm in EMC

  • 1.  Get values from OID add create own alarm in EMC

    Posted 01-16-2018 12:59
    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



  • 2.  RE: Get values from OID add create own alarm in EMC

    Posted 01-22-2018 20:24
    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



  • 3.  RE: Get values from OID add create own alarm in EMC

    Posted 01-22-2018 20:24
    Thanks for coming back to share the answer :)


  • 4.  RE: Get values from OID add create own alarm in EMC

    Posted 01-22-2018 20:24
    do you want to share the final script with us? would be great


  • 5.  RE: Get values from OID add create own alarm in EMC

    Posted 01-22-2018 20:24
    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


  • 6.  RE: Get values from OID add create own alarm in EMC

    Posted 01-22-2018 20:24
    Thanks for sharing this!


  • 7.  RE: Get values from OID add create own alarm in EMC

    Posted 01-22-2018 20:24
    yes, thanks for sharing!