OpsMgr 2007 Command Line Notifications and Alert ID

Published Jan 21 2019 03:44 PM 54 Views

First published on MSDN on Oct 18, 2008

Was working on setting up some command line notifications this week and ran into an issue I didn't find documented anywhere so thought I'd post it here.

When using command line notifications it is often of interest to pass command line variables to the program being called.  One such variable is to specify the web console URL and associated alert ID of the alert that generated the notification so an operator can click the URL to see details about the alert.

Selecting the web console URL and alert ID in combination is as easy as choosing the WebConsole Link variable from the fly-out menu as shown

This will populate the command line with the variable - "$Target/Property[Type="Notification!Microsoft.SystemCenter.AlertNotificationSubscriptionServer"]/WebConsoleUrl$?DisplayMode=Pivot&AlertID=$UrlEncodeData/Context/DataItem/AlertId$"

This variable includes both the web console URL and the alert ID.  The problem is - the alert ID variable doesn't resolve when used in command line notifications - it works fine elsewhere just not for command lines.  If you use this variable through command lines you will see a web console and alert link similar to the following:

" href="http://STEVERACRMS:51908/default.aspx?DisplayMode=Pivot&AlertID={bc24890a-2196-4d7d-b4b7-35...

The workaround for this issue is easy, just use the variable $Data/Context/DataItem/AlertId$ for the alert ID instead of the one available on the flyout.

A working WebConsole Link variable would appear as follows - "$Target/Property[Type="Notification!Microsoft.SystemCenter.AlertNotificationSubscriptionServer"]/WebConsoleUrl$?DisplayMode=Pivot&AlertID=$Data/Context/DataItem/AlertId$"

Version history
Last update:
‎Apr 07 2020 09:37 AM
Updated by: