Quick Post – SCOM Script Monitor Customizing Alert Name

This time I needed to build a two-state script monitor to test several file shares for availability. The script works in multiple steps…

  1. Try to access the shared folder
  2. Create a file within the share
  3. Check if the file exists
  4. Delete the file

If one of the tests above would fail, we need to get an alert. Well, this is actually not that hard to create and don’t worry I am not going to publish another VBScript. What is more interesting is to create a meaningful alert. It makes sense to have the file share name in the alert name e.g. “Failed to access share \\server01\temp”. But how are we going to achieve this?

Some might try to do something like this…

image

Well this would not work, the result would look like this…

image

What should we try to do instead? Well, try to use place holders like this…

image

Depending of the position of your parameters in your alert description you need to pick the proper “place holder”. Since the first parameter is $Data/Context/Property[@Name=’Folder’]$ we choose {0}. Cool and how does it look like?

image

Nice! For those who are MP authors they might are familiar with this technique, but for all others I think it is a smart quick tip 😉 . I don’t know if anybody has blogged about this before, in any case it might help you improving your alerts.

Update 07.03.2014: If you author your MP’s in VSAE it is just the other way around as you can see in this example below, there you must use e.g. $Data/Context/Property[@Name=’Folder’]$ …

image

VSAE will convert this appropriately.

8 Comments

  1. Hi,

    Thanks for the trick. But I’m facing issue when receiving mail in mailbox coming with parameter (like: Number of pending reports to upload on website Files {0}) and SCOM console is showing perfecly (like: Number of pending reports to upload on website Files 300). Please suggest why this is not coming proper in mail subject.

    • Hi

      There is a downside using dynamic parameters. They don’t show up as soon they “leave” SCOM like sending mail, alert connector and you will only see the placeholder {0}, . They only show in the SCOM console properly.

      Bad news, I know but this is the way it is.

      Cheers,

      Stefan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s