How to start, stop and delay an Opalis Policy

May 19, 2011 at 12:00 pm in Uncategorized by Christopher Keyaert

Hi all,

Today, I will present a little case that I need to deal with at one of my customer. My case Study is quite simple, I’ve got a Monitor Policy which creates an Incident/Ticket each time that a critical alert is raised in Operations Manager.

I will simplify this policy to the one below :


The scenario, a maintenance is planned on my Incident management platform, so at the convenience time I need to stop my Monitor Policy, wait the end of the maintenance window and after start my Monitor Policy again. As Opalis allows us to orchestrate our activities, I want to automate that task.

No object presents in the default integration packs allow us to do these actions easily.

· How could I stop an Opalis policy through another policy ?
· How could I schedule the start of an Opalis policy ?
· How could I pause my policy for some minutes ?

So we just have to create it with the Opalis Quick Integration Kit (QIK). J

Basically, I need to schedule an action, stop a policy, wait the end of the maintenance window and start my policy.


I invite you to read carefully the post of Adam Hall, Snr. Technical Product Manager for System Center Opalis/Orchestrator : Migrating a PowerShell script to an Opalis Activity

Thanks to this article and some PowerShell command I’ve been able to create three 3 new Opalis objects :


1. Sleep object: As input it simply takes a number of seconds and your policy will pause for the define time.
2. Start At: Specify a date and time for starting/continuing your policy.

3. Stop Policy:
This object allows you to stop an Opalis policy from another one. It uses the sp_StopAllRequestsForPolicy SQL store procedure. As input it needs the Opalis Sql server name, database name, and the name of the policy that you want to stop.

Be carefull, the policy name that you specified must be unique, because this object will stop all the policies that are using the specified policy name. For example, if you’ve go more than one policy that is named “1.Monitor”, this object will stop all of them, and that certainly not what you want because that impact directly the others running policies. So be careful with it and always use an unique name for the policy that you want to top.
Now, we will use these news objects for stopping the Monitor Policy below during a maintenance window and restart it after, for that we created a Maintenance Window Policy.

Let’s configuring it

Monitor policy (Policy that we want to plan the stop)

Maintenance window policy


Start At: We decided to plan the stop of the Monitor policy the 05/17/2011 at 04:28 PM.clip_image005

Stop Policy: We want to stop the Monitor policy (which is my OEA-IncidentCreation).

Sleep: Here we defined a maintenance window of 5 minutes.clip_image007

Start Policy: Simply use the Trigger Policy object provided in the default integration pack for starting the Monitor Policy.clip_image008


Let’s testing it

1. Now, we just have to start the Maintenance Window policy and go on weekend, Opalis will orchestrate the maintenance for us.

2. The Start At object will wait the specified date/time for releasing/continuing the rest of the policy.

3. At the defined date/time, the policy is released and our Monitor Policy well is stopped by the Maintenance Policy.

4. Our monitor policy is stopped

5. The sleep object will now pause the policy for the duration of your maintenance window.

6. When the maintenance window is ended, the monitor policy will start automatically.clip_image015

7. Our Monitor Policy has been well started.

You can directly download the integration pack which is containing these news objects and the source code: Download.

Remember, this is provided “As is” without any support and/or guarantee.

Feel free to contact me through the blog comments for any questions and/or remarks.

Christopher KEYAERT