Manual health monitor reset with Greenmachine

Iron Contributor

Introduction

Recently ran into some trouble with a problematic Management Pack that had quite a few Manual Reset Monitors which I really didn't want to reset by hand so I went ahead and tried to find a bit more automatic solution to deal with this.

After going over quite a few Powershell options I landed on GreenMachine by Tim Helton which provides quite a few command line options to reset or recalculate in bulk.

  

Command Line Arguments

These are for SCOM 2016 and differ from other versions

Spoiler
Command Line Arguments
These are for SCOM 2016 and differ from other versions
Command Line Arguments are:
GreenMachine2016.exe  -h
Starting GreenMachine 2016 Beta v1.07.0

Written by Tim Helton (timhe)
OpsMgr 2016 Edition!

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

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
 -username <Username> Sets the username to login as
 -domain   <Domain> Sets the username's domain to login as
 -password <Password> Sets the password to login with
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

 Example connection from remote machine to RMS server to recalcalculate Health for all Manual monitors

C:\GreenMachine2016>GreenMachine2016.exe -connect <host> -username <username> -domain <domain -password <password>

C:\GreenMachine2016>GreenMachine2016.exe -man -recalc

Requirements

  • Requires .NET 4.5

 

Supported versions

  • Operations Manager 2016 (tested with CU2)
  • Operations Manager 2012 R2
  • Operations Manager 2012
  • Operations Manager 2007

 

Sources

0 Replies