cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 

Start XMC scripts or workflows via NAC Notifications" or NetSight "Alarms Manager"

Start XMC scripts or workflows via NAC Notifications" or NetSight "Alarms Manager"

StephanH
Valued Contributor III
Hello,

is there a way to start scripts (Python!) or workflows created via XMC triggered by NAC "Notifications" or Netsight "Alarms manager"?

I know I can start every script/executable in the file system and the python scripts are stored in the file system. But if I start these files directly I have to handle myself the "Device Selection" for the correct device the script should run against.
I hope there is a smoother way to do that because that's a normal scenario:

  • Something happens on a device (like port goes down)
  • Alarms manager detects this issue
  • Alarms manager starts a script to fix it
In Workflows there is a "Signal" element in the Events category. But It's not clear for me whether the signal is something from outside or a event within the workflow.
For me the event is from outside (example port down on an arbitrary switch in XMC).

Best regards
Stephan

Regards Stephan
14 REPLIES 14

Zdeněk_Pala
Extreme Employee
If you run the workflow by executing it against the switch then the workflow does have access to emc_variable deviceIP.
If you run it from notification engine then the workflow does have emc_variable switchIP.

Check the list of variables here. if the workflow was executed you can see variables available for the workflow in the results window...
Regards Zdeněk Pala

Hi Zdenek,

could you elaborate on that answer?
Our specific situation is that we try to get a workflow going after plugging in an AP which generates a notification.
This works when we run it in XMC but fails when we test it by plugging in an AP. The workflow runs but fails.

The big difference between the 2 variable results (XCM test vs real) is the fact that our devices variable stays empty whereas the devices variable in the test shows the switchIP.

I tried forcing the switchIP into the devices variable, but no difference, this looks like it's enforced (because it is system-defined?).

Any idea why this would be happening? Or do you have a way to get some debug level logging?

Thanks in advance,

Lennert

When I execute the workflow by notification engine I can use variables in the workflow.

Example of Notification:

d540311325a84844a7d6efcd1cd18e9e_5e078f93-44b7-47e8-9d2b-19398103e94e.png


Example of variables:

d540311325a84844a7d6efcd1cd18e9e_7bcb3581-bd74-41b5-a943-890f0d113606.png



Example of python code to check those variables:

if emc_vars["oldstate"] != emc_vars["state"]:


Hope it helps.

Z.
Regards Zdeněk Pala

Thanks for your answer. I think I get that.

Our notification looks just like yours and works.
But the problem lies with the fact that our workflow doesn't find the compatible devices.

7fcb9562acbc4e7ba54ca62bbead671a_59e859d8-48ba-4aae-9acb-74b6192c5c86.png


In this instance our devices variable is empty.

7fcb9562acbc4e7ba54ca62bbead671a_3ea289e4-98c4-404e-849a-644d3fc17f92.png


This comes from a workflow with only a CLI activity in it.

7fcb9562acbc4e7ba54ca62bbead671a_46d948b1-0860-4182-9b21-b152243de5d5.png



Do you have an idea why our "devices" variable doesn't automatically get our Summit switch, or how we could enforce that?

Thanks in advance,

Lennert

StephanH
Valued Contributor III
Hello Pala,

works great (with 8.2.x), thanks for the good pictures.

Regards
Stephan

Regards Stephan
GTM-P2G8KFN