System Center Operations Manager 2007– Come resettare o ricalcolare facilmente lo stato di monitor

Ciao a tutti,

quante volte ci capita che il nostro SCOM 2007 per un motivo o per l’altro ci mostri dei dati non coerenti (dovuti a record sporchi nei DB,reinstallazione agente senza la dovuta rimozione o upgrade da versioni RTM) o semplicemente ci serve ricalcolare o resettare lo stato di alcuni monitor,eccovene un esempio pratico :

incorrect health state 2

In questo caso per esempio il Roll Up Monitor “Availability” prende il suo stato di Critical dal Roll up Monitor “Windows Computer Role Health Rollup” ma come si nota i monitor che sono al di sotto nell’alberatura relativa sono tutti in stato Healthy, quindi dalla vostra view il vostro server risulta in stato Critical quando realmente non è cosi.

Esiste un fantastico tool “Green Machine” scaricabile da questo link http://blogs.technet.com/b/timhe/archive/2010/04/26/green-machine-1-04.aspx che ci permette di resettare lo stato del monitor o addirittura ricalcolarlo.

Guardiamo come funziona

  • Scaricate il tool  su un RMS o un MS ,oppure su una macchina dove avete installato la console di SCOM 2007 con anche l’add on di SCOM 2007 Power shell installato
  • Aprite un command prompt e posizionatevi dove avete scompattato l’utility "Green Machine”
  • Ecco l’help della command line

Starting GreenMachineR2 v1.04.1

Written by Tim Helton (timhe)
Update Edition, added -group

This utility is provided "AS IS" with no warranties, and confers no rights.
Use of included utilities are subject to the terms specified at

http://www.microsoft.com/info/cpyright.htm

Unknown command line option /?

Command Line Usage:

Output:
-q quiet - prints NO output
-v verbose
-d debug
Connection:
-connect <RMS> Sets the name of the RMS to connect to Action:
-reset Reset the health of any monitors in an error or warning state
-recalc Recalculate health of any monitors in an error or warning state Default Action is to only display monitors (No reset)
-maint Put the target of the Monitor in maintenance mode for 5 minutes
WARNING: DO NOT put your RMS into maintenance mode, or the workflow responsible for taking it out of maintenance mode will not load.
Please See KB 946426 for more information. You will have to manually take the RMS out of Maintenance mode to regain functionality.
Filtering:
-man Only Perform a Recalc or Reset operation on 'Manual Reset' monitors
-filter <String> Scan only the computer name specified
-class Specify the class of object to scan. Uses Microsoft.Windows.Computer by default.
-group Specify a group to filter objects by.
-rollup Include Dependancy and Aggregrate monitors in the reset or recalc list. Without this only Unit monitors will be reset.
State Filtering:
-w Scan for agents in a warning state
-s Scan for agents in a success state
-i Ignore state -- Will scan Error, Warning, Success, and Unitialized state objects
This is a potentially dangerous operation when combined with -maint, as it can put all your monitors into maintenance mode

Display:
-all Display all monitors for an agent / class (not just those in a warning or error state
-noresize Don't resize the console to 150 width by 50 height

Note: You can use -d -h to see additional help options

  • Cercate di capire quale command line lanciare per coprire le vostre esigenze ,qui di seguito ve ne fornisco un esempio pratico

Example

GreenMachine.exe -group "All Windows Computers" -v –reset

Tramite l’esecuzione di questo comando d’esempio stiamo resettando di fatto tutti i monitor delle istanze presenti all’interno del gruppo “All windows computer”, di seguito l’output eseguito nel mio laboratorio.

Starting GreenMachineR2 v1.04.1

Written by Tim Helton (timhe)
Update Edition, added -group

This utility is provided "AS IS" with no warranties, and confers no rights.
Use of included utilities are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Verbose mode activated
Reset Health mode activated.
Connecting to ManagementGroup localhost
SDK Cache mode: Configuration
Connected to localhost!
Management group: lucada
Version: 6.1.7221.0
Found Class with query Name = 'Microsoft.Windows.Computer'

Legend:
(MM) = Monitor is in Maintenance Mode (Gray)
(-) = Monitor is not available (Gray)
(+) = Monitor is available (Green)

[E] = Monitor is in an ERROR state
[W] = Monitor is in an WARNING state
[S] = Monitor is in an SUCCESS state
[ ] = Monitor is in an UNINITIALIZED state

{A} = Monitor is an Aggregrate Monitor
{D} = Monitor is a Dependancy Monitor
{U} = Monitor is an Unit Monitor
-----------------------------------------------------

3 Monitoring objects found.
monitoringObject DC01.lucada.com was found in group All Windows Computers

------------------------------------------
Agent/Instance DC01.lucada.com is in a state of Success
monitoringObject SERVER1.lucada.com was found in group All Windows Computers

------------------------------------------
Agent/Instance SERVER1.lucada.com is in a state of Error

SERVER1.lucada.com:
Monitor: Entity Health - Error
Description: Root roll up monitor.
(+)[E]{A} Entity Health - SERVER1.lucada.com(Entity)
(+)[W]{A} Performance - SERVER1.lucada.com(Entity)
(+)[W]{D} Hardware Performance Rollup - SERVER1.lucada.com(Windows Server)
(+)[W]{A} Performance - C:(Entity)
(+)[W]{U} Logical Disk Fragmentation Level - C:(Windows Server 2008 Logical Disk)
--ResetMonitoringState Result Id db5975f7-611e-4e80-8f14-941817cf2d0c on Microsoft.Windows.Server.2008.LogicalDisk:SERVER1.lucada.com;C:: Succeeded
(+)[E]{A} Availability - SERVER1.lucada.com(Entity)
(+)[E]{D} Windows Local Application Health Rollup - SERVER1.lucada.com(Windows Computer)
(+)[E]{A} Availability - AFS Service(Entity)
(+)[E]{U} AFS Service Health - AFS Service(Microsoft Audit Forwarder System Service)
--ResetMonitoringState Result Id f69887aa-f9d9-41d4-8e6f-9495ce87b96b on Microsoft.Audit.Forwarder.System.Service:SERVER1.lucada.com: Succeeded
monitoringObject server2.lucada.com was found in group All Windows Computers

------------------------------------------
Agent/Instance server2.lucada.com is in a state of Warning
1 Monitoring objects scanned.

Come vedete esegue lo scan e il reset di tutti i monitor presenti e in stato Critical.

Mi raccomando seguite sempre la guideline spiegate nell’help file…e Buon divertimento!!!