02-21-2013 02:59 AM
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
02-21-2013 03:31 AM
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:
02-21-2013 06:21 AM
Prashant, I'm curious what your use case is that you want to do this.
02-22-2013 03:01 AM
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:
Please let me know if you need furthur information on this.
Thanks,
Prashant
02-22-2013 04:02 AM
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.
02-24-2013 08:58 PM
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.
02-27-2013 01:12 AM
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?
02-27-2013 05:01 AM
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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide