Monday, May 16, 2011

SCOM: Monitor a custom Services on Windows server 2003

Hi, All
Few days back I was trying to monitor a ISCSI service on my one of Windows Server. But I was not get succeed to do it. Then I post it on SCOM mailing list. With the Help of  Kevin Holman and his blog post i am able to get this done.

To Monitor a specific server we need to create a New Class for it  and then we need to write a Discovery rule for it. So that Discovery find that Target and then we can write desired monitoring or Alert rule on it.

For example I am going to Monitor Solarwinds TFTP Server installed on one of my server and going to monitor its service.

Tools Needed.

We need System Center Operations Manager 2007 R2 Authoring Resource Kit. You can download it from here 

Step: 1

After Installation Open SCOM Authoring Console and create and New Management Pack.
Type the Name of Management Pack. for example "solarwinds.Tftp.server





















Now type Display Name for Management Pack and Type its description. for example display Name "Solarwinds TFTP Server" and then types its description.























Click on "Service Model" and select "Classes" and in detail pane , right click and select NEW and select Custom Class























Now give an Name to New Class. for example I am giving "TFTP Server"











In "General" tab click on "Base Class" and choose "Microsoft.windows.LocalApplication" and click on OK


In Display String  type name and description. Now Click on Apply and OK




















Now click on "Health Model" and click on "Discoveries" , right click on detail pane and right click and select "New" then  "Custom Discovery"

























Now choose an "Unique Identifier" for this discovery, I am giving its name "TFTP Discovery"









Select "General" tab and type Display Name , Description for Discovery and My service is running on Windows 2003 server so in Target choose "Microsoft.windows.Server.Computer"



















click on "Discovery Classes" tab, in "Discovered classes and their attributes" click on "Add" and select "Add Discovered type"
























Now choose "Solarwind TFTP server which we made previously" and click on OK












































click on "configuration" tab and click on "Browse for a type"


















I want to discover my Server using Registry value of its Computer Name, so we will choose  Registry to discover our server

Now Look for "registry" and choose Microsoft.windows.FilteredregistryDiscovery.Provider" and in Module ID type DS and click on OK















In "Schedule" tab choose the schedule to run, for demo purpose I am using 60 Seconds
























I want to discover my computer using computerName registry key and its Value.
the location of this key is "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName"
















Now click on "registry Probe Configuration" and click on "Value" because we need to find computer by its Name.
In Propertied type "TftpExists" and in path type "SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName"
and in "Attribute Type" choose "String"


















Now click on "Expression" tab and click on "Insert"













In "Parameter Name" choose "TFTexists"










In Operator choose "Equals"















and in "Value" type your computer Name (shown as exact in the "computerName"  registry key)





click on "Discover Mapper" and in "Key property" choose "Display Name"


In "Non Key Properties" choose "Network Name"


Now click on "Apply" and then "OK"

Again , click on "Apply" and then click on "OK"

Now save your "Management pack"


Step: 2

Open SCOM Console, click on "Administration" and choose "Import Management packs"

click on "Add" and select "Add from Disk"



click yes on "Online Catalog Connection" to resolve dependencies if required.


Select your management pack file and click "Open"

click on Install


After successfully import of Management Pack , click on Close.


Step: 3

Now we need to see if this management pack is working or not and see if it discovered our Mentioned Server.

Now click on "Monitoring" in Action Pane click on "change target Type" in select item  select "Solarwind Tftp server" and click on OK


great !!! It have found our DC3 server. and status is "Not Monitored"


Step: 3

Now we have to write a rule to monitor service, so if service stop running it send an alert.
click on "Authoring" and right click on "Monitor" and click on "Create a Monitor" and select "Unit Monitor"

Select "Basic service Monitor" in windows services and choose the Management pack which we have imported before. click on Next

Type "Name" and "description" of the service and in Monitor target choose "Solarwind TFTP server2 and click on Next


In "Service name" click on browse and Type the Computer name on which services are running fro example "DC3-Foo" , choose the service to monitor for example "SolarWinds TFTP server Service" click on OK

So , If the service is running then Server is healthy and if the service is not running then the server is critical , so just click on NEXT

Click on "Generate Alerts" and then just click on Create...


currently Solarwind TFTP server Service is running so Server status is healthy.


Step: 4
Testing.

Lets Stop the "Solarwinds TFTP Service" on our DC3-Foo server and then see if it Alerts Us.

And the result is :

Yes It Works :-) 



Thanks 
Aman Dhally



5 comments:

  1. Awesome post, exactly what I was looking for!

    ReplyDelete
  2. Hello,

    I'm looking for help, I need to monitor services which have differents names but have the same keyword in it (like xxxxservicenamexx-xxx.xxx)

    I would like to create a discovery rule based on that keyword, but I cant do that on a registery key.

    Are you able to give advices ?

    ReplyDelete

  3. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here.
    Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Online Training from India.
    or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.
    JavaScript Online Training from India

    ReplyDelete
  4. Thank you for all the useful information. We tend to consider modifying this article with new information. it is often terribly an exquisite item. I appreciate your efforts. Keep posting new updates with us.

    DedicatedHosting4u.com

    ReplyDelete