Configuring Microsoft System Center Operations Manager as an event source

System Center Operations Manager (SCOM) is a cross-platform data center monitoring system for operating systems and hypervisors. You can set up an integration with Netcool® Operations Insight® to receive notifications created by SCOM.

About this task

Download the integration package from event management and import the scripts into your SCOM server. Sample commands are provided for Windows operating systems. Copy the notification script scom-cem.ps1 to any accessible directory on your SCOM server. A channel, a subscriber, and a subscription are required in SCOM to use the scom-cem.ps1 script to forward notifications to event management.

The default resource type is Server. Database, Application, and Service are also supported.

Procedure

  1. Click Administration > Integrations with other systems.
  2. Click New integration.
  3. Go to the Microsoft System Center Operations Manager tile and click Configure.
  4. Enter a name for the integration.
  5. Click Download file to download the scom-cem.ps1 script file.
  6. Copy the script to any accessible directory on your SCOM server. Use the following command (on Windows) to copy scom-cem.ps1 to any directory on your SCOM server:
    copy scom-cem.ps1 C:\<cem-scom>\
    Replacing <cem-scom> with your chosen directory.
  7. To prevent malicious scripts from running on your machine, Windows prevents downloaded internet files from being runnable. Complete these steps to unblock the file:
    1. Browse to the scom-cem.ps1 file using Windows Explorer.
    2. Right-click the file and select Properties.
    3. On the General tab, under Security, click the Unblock check box.
    4. Click OK.
  8. Edit the scom-cem.ps1 script file and locate the following line:
    Import-Module "C:\Program Files\Microsoft System Center 2016\Operations Manager\Powershell\OperationsManager\OperationsManager.psm1"
    Replace the file path with the location of OperationsManager.psm1 on your environment.
  9. Open the SCOM Operations Console to create a command channel, subscriber, and subscription for event management to integrate with the scom-cem.ps1 script file.

    To create a command channel:

    1. In the SCOM Console, go to Administrator > Notifications > Channels > New > Command.
    2. Enter a name for the channel and click Next.
    3. The following sample input is entered on the Settings tab:
      Full path of the command line:
      C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
      Command line parameters:
      "C:\cem-scom\scom-cem.ps1" -AlertID "$Data[Default='NotPresent']/Context/DataItem/AlertId$" -CreatedByMonitor "$Data[Default='NotPresent']/Context/DataItem/CreatedByMonitor$" -ManagedEntitySource "$Data[Default='NotPresent']/Context/DataItem/ManagedEntityDisplayName$" -WorkflowId "$Data[Default='NotPresent']/Context/DataItem/WorkflowId$" -DataItemCreateTimeLocal "$Data[Default='NotPresent']/Context/DataItem/DataItemCreateTimeLocal$" -ManagedEntityPath "$Data[Default='NotPresent']/Context/DataItem/ManagedEntityPath$" -ManagedEntity "$Data[Default='NotPresent']/Context/DataItem/ManagedEntity$" -MPElement "$MPElement$"
      Startup folder for the command line:
      C:\Windows\System32\WindowsPowerShell\v1.0\
    4. Click Finish and Close.
  10. Create a notification subscriber and subscription in Microsoft System Center Operations Manager for event management. In the SCOM Console, go to Administrator > Notifications > Subscribers > New.

    For new subscriptions click Administrator > Notifications > Subscription > New.

  11. Save the integration in event management. To start receiving notifications from Microsoft System Center Operations Manager, ensure that Enable event management from this source is set to On..

What to do next

Because the SCOM notification does not track the script execution history, a log has been added to the powershell script to track if the script has been called and executed successfully. Therefore, you must create a tmp directory and log files on the SCOM server for the script to write to.
Complete the following steps to create a tmp directory and log files on the SCOM server:
  1. By default, the powershell script writes the log to C:\tmp\postResultCEM.text.
  2. Create the C:\tmp directory. If you want to set a different directory, change the following line in scom-cem.ps1:
    ## Temp directory to capture the raw event
    $tmpdir = "C:\tmp"
  3. Create the C:\tmp\postResultCEM.txt file. If you want to set a different file, change the following line in scom-cem.ps1:
    $postFile = "$tmpdir\postResultCEM.txt"
  4. Add read and execute permission for directory and file that you created in steps 2 and 3.
  5. If you want to disable logs, make the following changes in scom-cem.ps1:
    ## Comment out the following two lines:
    #$postFile = "$tmpdir\postResultCEM.txt"
    #Add-content $postFile -value $json
    
    ## Change the following line as shown:
    Invoke-RestMethod -Verbose -Method Post -ContentType "application/json" -Body $json -Uri $Url