Extreme API with Python

Table Of Contents
Extreme API with Python
Page | 84
Part no.9036931-00 Rev AA February 2021
For example, using XMC 8.4.4, the list shown below displays the keys in the emc_vars Python dictionary
when a workflow is triggered by an Alarm, compared to a script in a workflow:
There are 92 entries in emc_vars in Alarm Workflow Engine
There are 72 entries in emc_vars in Workflow Engine
emc_vars not in Workflow Engine:
Not found: deviceIp
Not found: eventCategory
Not found: sysDescr
Not found: chassisId
Not found: alarmSource
Not found: sysName
Not found: deviceFirmware
Not found: deviceIpCtx
Not found: eventClient
Not found: alarmName
Not found: eventType
Not found: sysUpTime
Not found: deviceStatus
Not found: eventTitle
Not found: deviceBootProm
Not found: alarmId
Not found: eventUser
Not found: severity
Not found: eventSeverity
Not found: deviceNickName
Not found: message
Not found: chassisType
Not found: sysContact
emc_vars not in Alarm Workflow Engine:
Not found: hostName
Not found: extreme.hideLegacyDesktopApps
Not found: ports
In this example, the Alarm context adds context-specific variables in the emc_vars dictionary. Notice
that there is also a deviceIp variable that appears beside the usual deviceIP variable.
This section describes a simple workflow to show how to configure an Alarm that can execute a specific
workflow, using the new variables.
Start with a regular workflow, and run a Python script when an alarm for a Device Down appears in
XMC. This script is not especially useful, but it illustrates the framework.
The script you run first checks to make sure it is triggered by the Alarms and Events process and that it
can detect specific device types.
# You want to be notified by this workflow only if specific network devices are down
# You could also look at the model type to narrow even further the worflow