SCOM 2012 Rule/Monitor based on outcome of a script

Sean de Fraine 1 Reputation point
2021-06-24T13:53:43.193+00:00

Hi,

Hope everyone is well.

We use SCOM2012 to monitor our environment.

We run live out of 1 of 2 sites.

I have a script that tells us which site is live. How best to use that before the rule/alert?

Example:
We have a Rule to check event logs for error eventid 666 and alert
We are live on site A
We do want the alerts for site A but not site B

Can you put the live site script in before the alert rule is processed?

Any help appreciated.

Cheers,
Sean

Operations Manager
Operations Manager
A family of System Center products that provide infrastructure monitoring, help ensure the predictable performance and availability of vital applications, and offer comprehensive monitoring for datacenters and cloud, both private and public.
1,571 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. CyrAz 5,181 Reputation points
    2021-06-24T14:38:04.337+00:00

    You don't explain where the script runs nor how it determines which site is live, so the whole mechanism is quite unclear.
    However it is absolutely possible to base a monitor or a rule on a powershell script result.
    You can have a look at Kevin Holman's fragment library to get an idea of it's working, especially the Monitor.TimedScript.Powershell and Rule.AlertGEenrating.TimeScript.Powershell fragments.
    https://github.com/thekevinholman/FragmentLibrary

    0 comments No comments

  2. Sean de Fraine 1 Reputation point
    2021-06-24T14:52:39.497+00:00

    My script just gathers TRUE or FALSE from a DNS lookup.
    If LIVE SITE A is TRUE I want to run a rule against multiple servers in SITE A else run against servers in SITE B.

    I am not a coder so wondered if you could amend the Configuration Tab of the rule properties in any way by adding a Response before the Alert?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.