When browsing around in the runbook designer console sometimes the “should this runbook be running” question pops up in the head. The runbook might start with a “monitor” activity, like monitor alert, so most likely it should be running all the time, monitoring a data source. When different teams and different engineers in each team works with Orchestrator is sometimes get difficult to keep track of which runbooks that should be running and which ones that should not. One way to handle this is by including “should be running” in the naming convention. “Should be running” might be a bit to much, so instead use for example “RUN” or “ON” or “MON” (as monitor).
If you name your runbooks including a info if they should be running or not it is easy to monitor this. Lets say we include “ON” in runbook names for all runbooks that should always be running. We can then use a SQL query to verify the status of these runbooks.
SELECT UniqueID, Name
WHERE (Deleted = ‘0’) AND (Name LIKE ‘%-ON-%’)
AND UniqueID NOT IN (SELECT RunbookId FROM [Microsoft.SystemCenter.Orchestrator.Runtime].Jobs WHERE Status = ‘RUNNING’)
The query will show you all runbooks with a name including -ON- which don’t have a running job (status equals 1). If all your monitor runbooks are running, then there should be no result. You can then use a rule or monitor in Operations Manager to monitor this, like I do in this blogpost and you can add this to your Orchestrator dashboard.