cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
597
Views
0
Helpful
7
Replies

How to Enable/Diable the workflow dynamically?

Prashant Raghav
Cisco Employee
Cisco Employee

Hi,

My workflow triggered via email event. I need to activate/deactivate the workflow for a specific host or set of hosts if it recieves more than 3 email request in an hour.

Please help me if anybody knows how we can do it dynamically?

Thanks,

Prashant

7 Replies 7

Shaun Roberts
Cisco Employee
Cisco Employee

Use the built-in Powershell CLI with CPO.

You would need to use a powershell execute activity and in there you would need to add the snap-in first and then call one of the CPO commandlets.

To pull all the CPO commandlets do this...

PS C:\> get-command "*TEO*"

This produces:

The code snippets for TEO would be someting like, assuming you pass in the name of the process to enable/disable as 1 variable:

FOR ENABLE:

Add-PSSnapin CorePSSnapin

Enable-TEOProcess -name $args[0]

FOR DISABLE:

Add-PSSnapin CorePSSnapin

Disable-TEOProcess -name $args[0]

For enable something like this:

--Shaun Roberts
Principal Engineer, CX
shaurobe@cisco.com

Prashant, I'm curious what your use case is that you want to do this.

Hi Christopher/Michael,

Thanks for your responses!

With your help I can enable/diable the workflow but i need to do little more here.

My workflow trigger some commands via email on a particular host:

  • SA must be able to enable/disable the workflow for a specific host or set of hosts (in the event that an ongoing issue keeps triggering the workflow)
  • In case several emails will be generated, Only the first 3 events must capture information if several events happens within the same hour.

Please let me know if you need furthur information on this.

Thanks,

Prashant

I cannot tell if those are use-cases or questions or ???

What is the question?

You can enable/disable the workflows via the commands I gave. If you need to flag certain processes then you could do that with an ETP on each target.

I'm not sure what a host references to? A target? An ESX host? An Email server? A Windows box?

It sounds like you want to cap your trigger or something? Then do a count variable as a definition variable or something like that. Or again, maybe an ETP to count.

Again I am quite confused on your use-case/overall automation and not sure if those bullet points are statements or questions.

--Shaun Roberts
Principal Engineer, CX
shaurobe@cisco.com

Besides, there may be other ways to throttle your process automation than simply disabling workflows (which wouldn't achieve per-server throttling anyway) might not your best approach.

As Shaun asked, it would be best if you shared your use case in a little more detail.

You can also explore the Correlate Events activity to see if that might help you.

My workflow triggered via an email event(Server generated). Email contains the Unix/Linux host(Target) on which i execute set of commands and store the output.

What I need here :- If a server sends more than 3 emails for the same Target then i want to stop the execution for that particular Host.

Trying to make a workflow in such a way that only first 3 events must capture information if several events happens within the same hour.

Not sure how exactly i can disabled the workflow for particular host for an hour?

You don't want to disable the workflow.  As I understand things, you are parsing values out of the email, etc.  In any case, I would use extended target properties on each target in which you store whether you are ignoring events and for how long, and the the last few email times or the number of times in the last hour.  In your workflow logic, when you receive an email, check the times and if the last times are too recent, just exit the workflow. There's no need to disable it, just examine the emails and exit if you want to do nothing. If you are not ignoring, go on to do your work.  Make sure that this process which checks the timing is non-persistent so its overhead is low.  This may mean you want to invoke a separate workflow for the case when you want to stop the host.