Monitoring a Service in SCOM

Overview

Monitoring a service in SCOM is very easy to set up – thankx to the Windows Service Management Pack Template.  Many times there is a Management Pack already created that you can import to monitor a service (Active Directory, SQL Server, etc.)  When there is no Management Pack available for a Specific Service, or one is too complex for your environment, you can use this template to configure monitoring.  This quick process will create the Monitors and Rules necessary to:

  • Verify the service is running, and alert when it is stopped
  • Alert when performance thresholds are met
  • Collect performance data (% processor time, )

 

Setting up the Service for Monitoring

  1. Go to the Authoring workspace in the SCOM Console.
  2. Right-click anywhere in the Management Pack Templates node, and select Add Monitoring Wizard.
    The Add Monitoring Wizard will launch.
  3. On the Monitoring Type page, select Windows Service.
    CreateServiceMonitor-Wizard-02
  4. On the General Page:
    Provide a Name for the Service.
    Optionally provide a Description.
    Select an existing Management Pack, or click the New button to create a new Management Pack to add the monitoring objects to.
    CreateServiceMonitor-Wizard-03
  5. On the Service Details Page:
    Provide a service to monitor.  Type in the Service Name, or click on the ellipsis button to bring up a Window from which you can select a Service.
    If you type in the name, you can find the Service Name when looking at the Service Properties in the Services Console.
    CreateServiceMonitor-Wizard-04-c
    If you want to select the Service from a list of installed services, click on the ellipsis button.  The Select Windows Service window will appear.  You can look through and select a service installed locally, or connect to a different computer if the desired service is not installed locally.
    CreateServiceMonitor-Wizard-04-b
    Select a group to Target monitoring of this service to.
    Select whether you want to monitor the service only if its Startup Type is Automatic.
    CreateServiceMonitor-Wizard-04
  6. On the Performance Data page, you can specify whether you want alerts generated when CPU or Memory usage exceeds a specific threshold.
    In the Perofrmance counters section, check the box to generate an alert for CPU and/or Memory usage, and provide the thresholds you want to be alerted on.
    In the Performance counter sampling section, specify the number of samples in a row that have to exceed the threshold in order to generate an alert, and the sampling interval.
    Be careful with how frequent your sample interval is – the lower the internal, the more space it will use in the database.
    CreateServiceMonitor-Wizard-05
  7. The Summary page provides a summary of the service monitoring configuration you have provided.  Review the details and click Create to set up the Service Monitoring for the Service, or the Back button to make any changes to the configuration.

 

Making Changes to the Configuration of the Windows Service

If you need to make and changes to the monitoring configuration for the Windows Service:

  1. Go to the Authoring workspace in the SCOM Console.
  2. Navigate to Authoring – Management Pack Templates – Windows Service.
  3. Right-click the service and select Properties.
  4. The Service Properties window will appear, where you can reconfigure the monitoring for the service.

CreateServiceMonitor-Wizard-07

 

A Look at What the Template Does

Using the Windows Service Management Pack Template is a quick and easy way to configure Monitors and Rules.

To see the objects configured using the template, right-click on the service and select View Management Pack Objects – <Object Type>.

CreateServiceMonitor-Wizard-08

When viewing the Rules, note that there are six Rules, including ones to collect CPU and Memory performance data.

CreateServiceMonitor-Wizard-09

One of the really nice things about using the template is that the Collect Process\%Processor Time Rule is configured to account for multi-CPUs.  Note the ScaleBy property, which will take the % Processor Time value and divide it by the number of logical processors.
CreateServiceMonitor-Wizard-10

This is necessary because the Performance Counter does not take multiple CPUs into consideration.  While you think the maximum value for % CPU Time is 100%, The actual maximum value is 100 times the number of logical processors.  If you had created your own Performance Collection Rule, there is no way to add the ScaleBy option – other than manually editing the Management Pack’s XML.

There are also a number of Monitors created for you: to alert when service is not running, or when CPU/Memory performance thresholds have been met.

CreateServiceMonitor-Wizard-11

 

Creating a View to Display Performance Data

You may want to create a View to display CPU or Memory usage data that is being collected now.

  1. Go to the Monitoring workspace.
  2. Navigate to the folder named for the Management Pack you want to create the View in.
    (If you create a view in the root level of the Monitoring node, it will be created in the Default Management Pack – which you do not want to do.)
  3. Right-click on the folder and select New – Performance View.
  4. The Properties window will appear.
    Provide a name for the View.
    Click the ellipsis button next to Show data related to.  The Select Items to Target window will appear.  Select the name of the Windows Service that you created.
    Under Select conditions, check the box labelled collected by specific rules.
    Under Criteria description, click on the word specific in collected by specific rules.  Select the name of the Rule that collects the performance data (in the case for CPU usage, select Collect Process\% Processor Time.)
    CreateServiceMonitor-Wizard-13
  5. You can now review the performance data for the service.  As with any performance view, select the items (computers) from the legend that you want to appear on the graph.
    CreateServiceMonitor-Wizard-14

“SQL Reporting Server could not be contacted” when installing (upgrading to) SCOM 2012 SP-1

When upgrading my test SCOM server from RTM to SP-1, I got an error during the prerequisite check: “SQL Reporting Server could not be contacted.”   I verified that ReportServer was available, and the resolution did not offer anything helpful.

 SQL Reporting Server could not be contacted

When first installing SCOM several months ago I had configured SSRS to only use https.  One of the troubleshooting steps I performed to try to resolve this problem was re-enabling http, which made the prerequisite check pass.

Searching the registry for the SSRS http URL, I found two places that I needed to modify in order to get the prerequisite check to pass using https only.  Edit the ReportingServerUrl value located under both of the following keys: change http to https and :80 to :443.

  • HKLM\Software\Microsoft\Microosft Operations Manager\3.0\Reporting
  • HKLM\Software\Microsoft\System Center Operations Manager\12\Reporting

 

Of course, I could have just continued with the upgrade when I found the cause of the problem, leaving http enabled temporarily, since it made the prerequisites pass, but I was trying to avoid any additional problems in the future (additional upgrades, etc.) after setting it back to https only.

 

Deploying the SCOM 2012 Agent using SCCM

We are in the process of migrating our SCOM 2007 Agents to SCOM 2012, and starting to use SCOM to monitor a lot more servers that we are not currently monitoring in SCOM 2007.  This not only automates the SCOM Agent installation process, but prevents issues that have come up a few times when using the SCOM Discovery Wizard to push the Agent (most notably restrictive firewall policies that are in place for certain servers.)

To automate the SCOM Agent installation process, I have created a package in SCCM (we are still on SCCM 2007, with plans to migrate to SCCM 2012 in the next few months.)

Build the SCOM 2012 Agent package in SCCM

  1. Locate the Agent install files on the SCOM Server.
    (%ProgramFiles%\System Center 2012\Operations Manager\Server\AgentManagement)
    Note that there is a seperate installer (directory) for each processor architecture.)
  2. Create a new package in SCCM, using the SCOM Agent install files as the package source.
  3. Create a SCOM Agent Installation program for each architecture that you have in your environment (in my case, amd64 and x86.)

    Sample commandline:
    msiexec /i amd64\MOMAgent.msi /qn USE_SETTINGS_FROM_AD=0 USE_MANUALLY_SPECIFIED_SETTINGS=1 MANAGEMENT_GROUP=ITS MANAGEMENT_SERVER_DNS=scom.its.domain.com ACTIONS_USE_COMPUTER_ACCOUNT=1 AcceptEndUserLicenseAgreement=1

    Microsoft has documentation on the install parameters (Install Agent Using the Commandline: http://technet.microsoft.com/en-us/library/hh230736.aspx.) This was very helpful, with one exception: it left out an important parameter necessary when installing the Agent with no user interaction, causing my Agent installs to fail.  Reviewing the Windows Application Log I found “Product: System Center 2012 – Operations Manager Agent — By installing this software, you confirm acceptance of the relevant System Center 2012 license terms. The terms are in the “Licenses” folder on the disk image. If you agree with the license terms, add AcceptEndUserLicenseAgreement=1 to the command line. If you do not agree, do not install the software.”
    After adding AcceptEndUserLicenseAgreement=1 to the command line, the Agent installations were successful.

  4. Create a program for each Agent update applicable for each processor architecture (In my case, there was a single update needed: KB2784734 – Update Rollup 1 for SCOM 2012 SP-1.)  The update(s) that are available are based on what updates are installed on the Management Server and are present in the same directory as MOMAgent.msi.

    Sample command line:
    msiexec /update amd64\KB2784734-amd64-Agent.msp /qn /norestart

    HotFixInSameDirectoryAsMOMAgent

Create a Task Sequence to Deploy the SCOM Agent

Because we are still running SCCM 2007 (we don;t have the App Model capabilities of SCCM 2012 yet), I created a task sequence to deploy the SCOM Agent and the available update.

  1. Create a new Task Sequence for Deploying the SCOM Agent
  2. Add an Install Software step for each processor architecture.
    Select your SCOM Agent Package and the appropriate Program.
    TS1

    On the options tab, add a condition based on processor architecture so that the correct Agent is installed.
    (Such as a WMI Query: Select * FROM Win32_Processor WHERE AddressWidth=”64″)
    TS2

  3. Add an Install Software Step for each update for each processor architecture.
    Use a condition to make sure the correct update(s) get applied.