Home » 2007 (Page 6)

Yearly Archives: 2007

Script that Returns Multiple Lines

I saw a couple of questions about a script searching for a word in a logfile and then create a event with the line including the “word” but also the two lines before that. This script search for the word “Warning” in the file logfile.txt. If found it will generate a local event with the line includning Warning but also the two lines before that.

Const ForReading = 1
Const EVENT_WARNING = 2Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Pattern = "Warning"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("logfile.txt", ForReading)

strLineNo = 1

Do Until objFile.AtEndOfStream

     strSearchString = objFile.ReadLine
     Set colMatches = objRegEx.Execute(strSearchString)

    strCacheC = strCacheB
  strCacheB = strCacheA
  strCacheA = strSearchString

   
 If colMatches.Count > 0 Then
        For Each strMatch in colMatches  
          
 Set objShell = CreateObject("Wscript.Shell")
 objShell.LogEvent EVENT_WARNING, _
 "Warning from logfile: " & vbCr &_
 "BEGINNING OF LINES" & vbCr &_
 "" & vbCr &_
  strCacheC & vbCr &_
         strCacheB & vbCr &_
         strCacheA & vbCr &_
 "" & vbCr &_
         "END OF LINES."
        Next

 End If   

strLineNo = strLineNo + 1

Loop
objFile.Close

Custom Service in Ops Mgr 2007 and Distributed Applications

I saw a question about including a custom service in a distributed application. This is a short step by step guide to include a custom service into a distributed application.

First I created a new service at one of my machines, CODC01. The new service was named SuperService. This is a service created only for this test. Then I created a process to monitor that service

  1. Start the console, go to Authoring, expand management pack templates, right-click Windows Service and choose “add monitoring wizard…”
  2. Add Monitoring Wizard – Monitoring Type: Choose Windows Service and click Next
  3. Add Monitoring Wizard – General Properties: Input name, description and choose a destination management pack, click Next
  4. Add Monitoring Wizard – Service Name: Input the name of the service or browse to pick it up, then click Create

Now we need to create a distributed application including this new service

  1. Start the console, go to Authoring, right-click Distributed Applications and choose to create a new
  2. Distributed Application Designer: Input a name and a description for your new distributed application. Choose “Blank” as template, choose a management pack to store your distributed application and then click OK
  3. Distributed Application Designer: If you now serach for a object, for example in my case I search for “Super” I will see my SuperService object. If I click “Add Component” and add a component group I can then drag and drog the SuperService object from the search result to the new component group.
  4. Distributed Application Designer: Click save and then move over to the monitoring part of the console, click Distributed Applications, open your new distributed application. As you can see, your custom service is included.

Remeber that after you create a new object it can take some time before you can add it in the Distributed Application Designer.

 

Microsoft Exchange Server 2003 Management Pack

A new version of the Microsoft Exchange Server 2003 Management Pack 

Version: 6.0.5000.11
Date Published: 6/29/2007

Update version addressing problems with empty alert parameter data in self-tuning threshold monitors, and discovery issues on Exchange 2003 running in a clustered setup. The library MP is unchanged from the initial release.

Download here

Links during June

  • System Center Operations Manager 2007 Technical Walkthrough, here
  • The Dell Management Pack for Microsoft System Center Operations Manager integrates Dell PowerEdge server alerts into Ops Manager. Download here
  • System Center Trial Software, here
  • System Center Operations Manager TechCenter, here
  • System Center Operations Manager 2007 Virtual Labs, introduction and advanced
  • System Center Operations Manager 2007 Traning Videos, here and for download/offline viewing here
  • New version of Microsoft Web Sites and Services Management Pack for MOM 2005, download here

 

 

Ping Script in Ops Mgr 2007

A time ago I wrote a simple ping script for MOM 2005. Today I needed a script like that in Ops Mgr 2007, this is how I implemented it in Ops Mgr 2007.

  1. Start the console, click Authoring and then expand Management Pack Objects, right-click Rules and choose Create a new rule…
  2. Create Rule Wizard – Rule Type: Choose Timed Command/Execute a script, choose management pack and click Next
  3. Create Rule Wizard – General: Input a name, description and choose target. In this example I have create a small group of machines that will be the target. Click Next
  4. Create Rule Wizard – Schedule: Choose how often the script should be executed, click Next
  5. Create Rule Wizard – Script: Paste the following script in the script box, input a filename (for example ping_script.vbs) and then click Create. In this example I ping two machines, CODC99 and ping.sunet.se.

Hosts = "CODC99,ping.sunet.se"aMachines = Split(Hosts, ",")
strLog = "1"
For Each machine in aMachines
Set objPing = GetObject("winmgmts:{impersonationLevel=impersonate}")._
ExecQuery("select * from Win32_PingStatus where address = '"_
& machine & "'")
For Each objStatus in objPing
If IsNull(objStatus.StatusCode) or objStatus.StatusCode<>0 Then
        Const EVENT_WARNING = 2
 Set objShell = CreateObject("Wscript.Shell")
 objShell.LogEvent EVENT_WARNING, _
 "Computer " & machine & " is not reachable (" & strLog & ")"
ELSE
 IF strLog = 1 Then
  Const EVENT_SUCCESS = 0
  Set objShell = CreateObject("Wscript.Shell")
  objShell.LogEvent EVENT_SUCCESS, _
  "Computer " & machine & " is reachable"
 End If
End If
Next
Next

If you set strLog = “1” you will get a local event for every sucessfully ping. If a machine is not reachable you will get a local event with event ID 2, type=warning and source=WSH. To get this into your console you will have to create a rule to collect them too. 

How to Monitor a Web Site with Ops Mgr 2007

This is a general guide how to monitor a web site with Operations Manager 2007.

  1. Start the console, click Authoring and then expand Management Pack Templates
  2. Right-click Web Application and choose add monitoring wizard
  3. Add monitoring Wizard – Monitoring Type: Select Web Application and click Next
  4. Add monitoring Wizard – General Properties: Input name, description and select a management pack, then click Next
  5. Add monitoring Wizard – Web Address: Input the URL, click test and verify that the URL works, then click Next
  6. Add monitoring Wizard – Watcher Node: Select the machine that will as watcher node, click Next
  7. Add monitoring Wizard – Summary: Verify your settings and then click Create

You can click on your new web application and then click “Record a browser session” or “Edit web application settings” to setup more advanced configuration for your web application monitoring.

System Center Operations Manager 2007 at Technet Download and MSDN

System Center Operations Manager 2007 are now available at Technet Download and MSDN. You will find it under System Center.

Management Pack for Exchange Server 2007 for MOM 2005

This version of the Exchange Server Management Pack monitors Microsoft Exchange Server 2007. The Exchange Server 2007 Management Pack includes rules and scripts to monitor and report on performance, availability, and reliability of all Exchange 2007 server roles including Mailbox, Client Access, Hub Transport, Edge Transport and Unified Messaging. The Exchange Server 2007 Management Pack for MOM 2005 topics explain how to monitor and maintain messaging resources.

File Name: Exchange2007ManagementPackForMOM2005.msi
Version: 08.01.0021.001
Date Published: 6/14/2007

Download here

 

Agentless Exception Monitoring (AEM) in Operations Manager 2007

Pete Zerger and I collaborated on a guide about Agentless Exception Monitoring (AEM) in Operations Manager 2007. Monitoring desktop client hardware, operating system and application faults can be of great value in terms of reducing total cost of ownership (TCO) through identification of widespread faults in the monitored environment. In Operations Manager 2007, there are actually three components for monitoring the client experience:

  • Agentless Exception Monitoring (AEM)
  • Customer Experience Improvement Program (CEIP)
  • Management Packs for Windows-based workstation operating systems and applications

In this document, we’ll focus specifically on configuration Agent Exception Monitoring feature.

Download the document here

If you want to do silent AEM reporting you can modify the following regkeys, but before you do that, make sure it approved in your organization.

for XP
HLKM\Software\Policies\Microsoft\PCHealth\ErrorReporting\ShowUI to DWORD 0 HKLM\Software\Policies\Microsoft\PCHealth\ErrorReporting\DW\DWByPassQueue to DWORD 1 HKLM\Software\Policies\Microsoft\PCHealth\ErrorReporting\DW\DWAlwaysReport to DWORD 1 HKLM\Software\Policies\Microsoft\PCHealth\ErrorReporting\DW\DWNeverUpload to DWORD 0

for Vista
Set DontShowUI key and appropriate Consent as per http://msdn.microsoft.com/en-us/library/bb513638(VS.85).aspx

Alerts Based on Event Description

There was a question in a news group about creating a rule to generate an alert if the alert description contains a special word. When you create a new alert generating alert/Event Based/NT Event Log (Alert) rule you can not choose alert descript as a parameter. Instead you will have to input a new parameter name, EventDescription. For example if you want a rule to generate an alert if the word “Pay” is in the alert descript the forumla would look like this ( EventDescription Contains pay ) .