Cross-platform failover
With default settings cross-platform agents in Operations Manager 2007 R2 don’t fail-over to another management server if the primary management server goes offline. If the primary management server goes offline you will loose monitoring of all cross-platform machines communicating through that management server. The System Center Cross platform and Interop team blog has a couple of scripts that can help you manage cross-platform machines. One of these scripts is used to to change the current management server monitoring a UNIX/Linux server (or group of UNIX/Linux servers) to a new management server.
But if you move a cross-platform over to another management server you will get an alert like this
A simple explanation to this is that the new management server don’t trust the CA which have issue the certificate that the cross-platform machine is communicating with. You can solve this by copy the certificate from the management server that first discover the cross-platform machine over to the second management server. Store the certificate under Local Computer/Trusted Root Certification Authorities (in the certificates MMC). The certificate is named SCX-Certificate, issued by the primary management server.
When the new management server has the certificate installed it will start communicate with the cross platform machine. You could build a timed script two state monitor to check if the first management server is working, else run the script to move all cross-platform agents.
Update resolution state with a script
This is a script you can use to update resolution state. It will look at all new alerts (resolutionstate = 0) and see if the alert description contains “domain” or “AD”, if they do, the script will set a new resolution state. The ID for the resolution state can be found under alert settings in the administration workspace, in the Operations Manager console. You can schedule task to run this script every X minute to update all new alerts.
$RMS = “myRMSHost”
Add-PSSnapin “Microsoft.EnterpriseManagement.OperationsManager.Client”
Set-Location “OperationsManagerMonitoring::”
New-ManagementGroupConnection -ConnectionString:$RMS
Set-Location $RMS$resState =Â 42Â
$alerts = get-alert -criteria ‘ResolutionState =”0″‘ | where-object {($_.Description -match “AD”) -or ($_.Description -match “domain”)}
If ($alerts) Â {
   foreach ($alert in $alerts)
   {
    $alert.ResolutionState = $resState
    $alert.Update(“”)
   }
  }Â
The schedule task command can be
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -command C:\myscripts\change_resolutionstate.ps1
Importing knowledge into Service Manager 2010 – part 2
In this post I wrote about how-to import knowledge into Service Manager 2010. This week I did some tests about importing knowledge including data from a word file (docx) and a rich text format file (rtf). In my previous post about importing knowledge I wrote how you could use files and how they are mapped to the knowledge article text fields. If I use a Word file (docx) the result is “raw data”, not how we see the same file in Word.
Â
If I instead use a Rich Text form file it looks really nice in the Service Manager console.
Summary: Try to use rich text format files instead of normal Word files when importing knowledge into Service Manager.
The System Center Configuration Manager 2007 Dashboard with Operations Manager
The System Center Configuration Manager 2007 Dashboard can show you a web based status report, including system deployments, security updates, system health status and more for your Configuration Manager environment. More info about the dashboard at the System Center Team Blog. Timothy McFadden posted a good post about how to use this dashboard with Operations Manager 2007 R2. I have tried this in my sandbox and it works really good.
Here are some example queries to use
Total number of computers in the management group
SELECT COUNT(*) AS NumManagedComps FROM (
SELECT bme2.BaseManagedEntityID
FROM BaseManagedEntity bme WITH (NOLOCK)
INNER JOIN BaseManagedEntity bme2 WITH (NOLOCK) ON bme2.BaseManagedEntityID = bme.TopLevelHostEntityID
WHERE bme2.IsDeleted = 0
AND bme2.IsDeleted = 0
AND bme2.BaseManagedTypeID = (SELECT TOP 1 ManagedTypeID FROM ManagedType WHERE TypeName = ‘microsoft.windows.computer’)
GROUP BY bme2.BaseManagedEntityID
) AS Comps
Number of new active alerts
SELECT COUNT(1) AS ActiveAlerts FROM Alert WHERE ResolutionState = ‘0’
Health State summary of all Windows Computers based
SELECT [State] = CASE ManagedEntityGenericView.HealthState
WHEN 1 THEN ‘Healthy’
WHEN 2 THEN ‘Warning’
WHEN 3 THEN ‘Critical’
ELSE ‘Unknown’
END
, COUNT(1) AS GroupCountFROM ManagedEntityGenericView INNER JOIN
ManagedTypeView ON ManagedEntityGenericView.MonitoringClassId = ManagedTypeView.Id
WHERE (ManagedTypeView.Name LIKE ‘Microsoft.Windows.Computer’)
GROUP BY ManagedEntityGenericView.HealthState
ORDER BY GroupCount
Top 10 alerts
SELECT TOP 10 SUM(1) AS AlertCount, AlertStringName
FROM Alertview WITH (NOLOCK)
WHERE TimeRaised is not NULL
GROUP BY AlertStringName, AlertStringDescription, MonitoringRuleId, Name
ORDER BY AlertCount DESC
If you would like to replace the banner you will find it in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\IMAGES\Microsoft.DashboardFramework. One idea for a new banner could be
Thanks to my colleague Ola Ahrens for SQL support.
How-to monitor file size
This script can be used with a monitor to monitor size of a file. In this example it monitor file C:\temp\myfile.txt and will generate an alert if that file is bigger then 50Mb (52428800 bytes). Settings for your two state script monitor can be
- General
- Name: Contoso – check file monitor
- Monitor Target: choose a suitable class
- Management Pack: choose a suitable MP
- Schedule
- Run every 15 Minutes
- Script
- File Name: contosocheckfilesize.vbs
- Script: see below
- Unhealthy Expression
- Property[@Name=’Status’] does not contain Ok
- Healthy Expression
- Property[@Name=’Status’] contain Ok
- Health
- Healthy Healthy Healthy
- Unhealthy Unhealthy Warning
- Alerting
- check Generate alerts fort this monitor
- check Automatically resolve the alert when the monitor returns to a healthy state
- Alert Name: Contoso – File Size monitor
- Alert Description: Warning. C:\temp\myfile.txt is to big. The file is $Data/Context/Property[@Name=’Size’]$ bytes.
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
Set objFile = objFSO.GetFile(“C:\temp\myfile.txt”)
varSize = objFile.SizeDim oAPI, oBag
If varSize > 52428800 Then
Set oAPI = CreateObject(“MOM.ScriptAPI”)
Set oBag = oAPI.CreatePropertyBag()
Call oBag.AddValue(“Status”,”Bad”)
Call oBag.AddValue(“Size”, varSize)
Call oAPI.Return(oBag)
Else
Set oAPI = CreateObject(“MOM.ScriptAPI”)
Set oBag = oAPI.CreatePropertyBag()
Call oBag.AddValue(“Status”,”Ok”)
Call oAPI.Return(oBag)
End If
Investigate most common alert
The following SQL queries can be used to first list which machine or path and then rules or monitors that generate most alerts in your environment. The first query will show you which computer or path that generate most alerts. The second query will show you which rule or monitor that generate most alerts on one singel machine or path. Run both queries against your data warehouse database (OperationsManagerDW).
Â
SELECT
vManagedEntity.Path, COUNT(1) AS pathcountFROM Alert.vAlertDetail INNER JOIN
Alert.vAlert ON Alert.vAlertDetail.AlertGuid = Alert.vAlert.AlertGuid INNER JOIN
vManagedEntity ON Alert.vAlert.ManagedEntityRowId =
vManagedEntity.ManagedEntityRowId
GROUP BY vManagedEntity.Path
ORDER BY pathcount DESCÂ Â Â
SELECT
Alert.vAlert.AlertName,
Alert.vAlert.AlertDescription,
vManagedEntity.Path, COUNT(1) AS alertcount
FROM Alert.vAlertDetail INNER JOIN
Alert.vAlert ON Alert.vAlertDetail.AlertGuid = Alert.vAlert.AlertGuid INNER JOIN
vManagedEntity ON Alert.vAlert.ManagedEntityRowId =
vManagedEntity.ManagedEntityRowIdWHERE Path = 'opsmgr29.hq.contoso.local'
GROUP BY Alert.vAlert.AlertName, Alert.vAlert.AlertDescription, vManagedEntity.Path
ORDER BY alertcount DESCYou could also use these queries in a report, take a look at this post about author custom reports.
Automate failover in SMA with Operations Manager
Installing the Service Manager Authoring Tool






Recent Comments