Blog

SCOM 2007: Setup Command Notification Channel + Subscriber

Sometimes it’s necessary to launch a custom script or other action after an alert is detected. This can be all executable scripts or programs.

In my particular case I’m using this to launch scripts when an alert is detected to properly escalate the alert and perform additional tasks on the alert.

So how do you make sure that the script you intend to run will actually run when a predefined alert is raised?

By creating a Command notification channel and subscription…

Let’s start with setting up the command notification channel.

Note: I’m using my script Create_Ticket.Ps1 as documented here. The parameters I’m passing are useful for this script but you can pass many more parameters according to your needs.

First of all open the Notification Channels by opening the SCOM console > administration > Notifications > Channels

notification_channel

Right click in the Right pane > choose New > Command…

notification_channel3

In the settings tab you need to fill in what you prefer to run:

  • Full Path of the command file: In my case this is PowerShell as I would like to run a PowerShell script
  • Command Line Parameters: In my case I’m running a PowerShell script and I’m passing the AlertID of the specific alert as an argument which I’m using in my script. Again you can use any arguments here if you like.
  • Startup folder for the command line: This is basically the path of your program you want to run.

Click Finish.

notification_channel4

At this point your Command Notification Channel is set up. The next thing you need to configure is the trigger which will run this Command Notification Channel. This is done by creating a Subscriber:

Open the Scom console and navigate to Administration > notifications > Subscribers

notification_channel5

Right click in the right pane and choose New…

notification_channel6

Fill in a name for the Subscriber

notification_channel7

Leave the “always send notifications” or specify a time window (ex. during business hours only) and click next.

notification_channel8

Click Add to ad a subscriber address to the list. The following window appears:

notification_channel9

Fill in the address name and click next

notification_channel10

  • Channel Type: Select Command in the drop down list
  • Command Channel: Select the previously created Channel in this case it’s “Ticket” from the drop down list.
  • Click Next

notification_channel11

Leave the always send notifications setting or change according to your needs.

notification_channel12

Click Finish and you have configured your Command to run whenever you subscribe to an alert with this channel.

Enough talk, let’s build
Something together.