Why cant I just highlight a server and reset its health to green? (Using Green Machine as a console task)

The lack of a native ability to reset the health state of a server without opening Health Explorer, finding the lowest level red (or yellow) and resetting each step upward has really bugged me for a while now. With manual reset monitors and servers where significant changes have occurred, it is not uncommon to need to reset the health state of the entire server to see what will change back into a yellow or red state. There are some great tools out there to reset health state, my personal go-to utility is Green Machine by Tim Helton. Green Machine lets me reset the health of a server or a group of servers via the command line. However in Operations Manager I should be able to take any computer (or group of computers), right-click and reset their health state to green. With Tim’s extremely helpful feedback and insights, the result is the new Green Machine management pack. This management pack lets you reset the health of a server or a group of servers from within the Operations Manager console.

I will say, this is not a pretty management pack however it is a functional management pack – I built it in the Operations Manager console and have not provided the level of documentation that I provided for the ReSearch This Management Pack as an example. If you find this management pack (download available here) to be useful please let me know if it would be worth the investment in time to rebuild it in the authoring console and to fully document it. This management pack is designed to run locally on the the RMS but can be configured to run from any system with the console installed by performing the optional tasks listed in the “How to install the management pack” section of this blog article.

 

What’s in the management pack?

There are 10 console tasks which are included in the pack – two sets of five (one targeted to computers, one targeted to groups) which perform these tasks:

  • Reset All monitors regardless of state
  • Reset All monitors regardless of state – including rollups which is only available in R2
  • Reset manual reset monitors
  • Reset monitors not currently healthy
  • Reset monitors not currently healthy – including rollups which is only available in R2

 

How to install the management pack?

Download Green Machine, create a c:\scripts folder on your RMS and copy the GreenMachine.exe into the folder.

Download and install the Green Machine management pack.

Optional: If you want to be able to perform these tasks from other systems with the console installed these steps need to be done:

Copy GreenMachine.exe to c:\scripts on any systems with the console installed.

Change each of the 10 tasks where the parameters says “localhost” to the name of the RMS server in your environment.

  • To find these tasks, open the Operations Manager console / Authoring / Management Pack Objects / Tasks and look for GreenMachine as shown below.

image

Each of these tasks will need to be changed by opening their properties, and on the Parameters field change localhost to the name of your RMS (such as Hydra in my case).

image

 

How to use the management pack?

The Green Machine management pack provides two views which can be used to easily add either a computer or a group into maintenance mode. They are available in the Operations Manager console / Monitoring / Green Machine and either the Computer View or Group View.

image

The Green Machine tasks are also available in the default views which expose either computers or computer groups such as the default computer view shown below:

image

In diagram views (shown below) or even in Live Maps views if computer or group objects are displayed.

image

Issues: In the computers view, selecting multiple computers and running any of the Green Machine tasks will only execute on one item. Based upon this:

Table 7.1 Various Properties of the Task Views

Task View Type Definition

Tasks Available in Operator console Views Types

Multi-select

Alert

Alert

No

Event

Event

No

Computer

Alert

Event

Computer

Attribute

Computer Performance

Performance Data

Diagram

No

Multi-select won’t work from the computer view (http://technet.microsoft.com/en-us/library/cc179959.aspx). While it is unfortunate limitation it can be mitigated somewhat by either filtering the computers requiring Green Machine and running them individually or by using the Computer Group view in the management pack.

Thank you: I owe huge thanks to Tim who not only wrote the Green Machine utility but also helped me work through how we could integrate this into a management pack!

Summary: While there are other options to reset health in Operations Manager (including temporarily putting a computer into maintenance mode) the Green Machine management pack has been a really useful way to integrate health reset functionality into our environment.

0 thoughts on “Why cant I just highlight a server and reset its health to green? (Using Green Machine as a console task)

  1. Andreas Zuckerhut

    What I really don’t like about it: the executable

    It can easily be done by using a powershell script and a powershell write action, there’s no need for that additional application.

  2. Michael Skov

    The idea is very cool, and it all looks quite simple. However, after installing the MP, changing the RMS name on the tasks and creating the dir for the exe, i tried running one of the tasks.

    It completes in two seconds, but the server stays in the same state as before. What am i doing wrong?

    Regards

    Michael

  3. Cameron Fuller Post author

    Hey Tenchuu, if you want to get a powershell script put together on this I will be glad to work with you to get it integrated into a management pack.

    Michael – Try running it with localhost first and see if that works. Also, try different GreenMachine tasks – some will reset with the option to only change state on those already yellow or green and others will not. If I use the reset all monitors including rollups it has worked for me in my environment every time. Also, was there any error messages and/or can you cut and paste the text results here?

  4. Michael Skov

    Hi Cameron

    Thanks for the quick reply. I have tried all the tasks, both with win2003 and 2008. I have also tried to use both localhost and my rms. When running the tasks, this returns (notice line 11):

    Starting GreenMachine v1.00.016 RC2!

    Written by Tim Helton (timhe)

    Portions written and testing by Charles Champion (cchamp)

    Inspired by a discussion at the 2008 R2 Tap Event.

    Shoutouts to the OpsMgr MVPs. Keep up the good work!

    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 -connect

    Command Line Usage:

    -q Quiet – print NO output

    -v Print verbose messages

    -r Reset the health of any monitors in an error or warning state

    Use this to reset the health of monitors

    -rr Recalculate health of any monitors in an error or warning state

    Use this to recalculate the health of monitors. Can be used with -r

    Recalculate only works for monitors that have designed to be recalculated

    -ra Reset or Recalculate ALL monitors. Only unit monitors are reset by default

    By default, only unit monitors are reset. Use this to reset all monitors.

    Including Aggregrate or Dependancy monitors that are in a Error or Warning state

    -man Only Reset ‘Manual Reset’ monitors

    Some monitors are of a type of ‘Manual Reset’, for example, the Manual Reset Event log

    Detection monitor. This will check the type of each monitor, and only reset those of a

    ‘Manual Reset’ type. All other monitor types will be skipped, and not reset.

    Requires -r or -rr (also works with -v -all to identify monitors)

    -d Debug

    -c Display last 3 state change events

    This will display the state change events for monitors in an error or warning state.

    -M Sets the name of the RMS to connect to

    Use this option to connect to a remote RMS. Requires OpsMgr DLL’s are installed

    -A Scan only the agent name specified

    By default, we will scan all windows computer objects in the management group.

    You can specify a wildcard scan with -A. Similar to Select * where name like ‘%name%’

    -w Scan for agents in a warning state

    By default, only agents in an ERROR state are scanned. Use -w to also scan warning

    -s Scan for agents in a success state

    Same as -w, but for agents in a success state

    -all Display all monitors for an agent (not just those in a warning or error state

    -all is noisy. Use this to show ALL monitors on a scanned agent. Including those in

    a an Unitialized or Success state

    -noresize Don’t resize the console to 150 width by 50 height

    -bp, -bs, -bc, -ba Scan only a single tree: Performance, Security, Configuration, Availability

    —– OpsMgr SDK Client Cache mode settings — Experimental — May help performance —

    See msdn for ManagementGroupConnectionSettings() for documentation

    -cc Configuration cache mode (default)

    -cm Management packs cache mode

    -cn No caching

  5. Cameron Fuller Post author

    Interesting. I ran both of these (from my RMS and from localhost) from the command line as well with no issues. Do you have the latest version of GreenMachine on your system in the c:\scripts directory? I have a 1.04.1 version on mine which looks to be the difference.

  6. Layne

    Re: the “unknown command line option -connect” error. Cameron is correct. In GreenMachine 1.00.016, you had to use -M RMSName. In 1.04.0 and later, you use -connect RMSName. From Michael’s comment you can see he’s using 1.00.016.

  7. JB

    Thx Cameron. This is a great addition.

    FWIW, as you asked above, documentation would help but it’s not a necessity.

    Cheers,

    John Bradshaw

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.