How to create a monitor to inspect the value of a registry key
<!--[if lt IE 9]>
<![endif]-->
Comments
Anonymous
January 01, 2003
The comment has been removedAnonymous
January 01, 2003
Ryan - you still will want to use PS or VBscript and a propertybag.... if you need to do any complex calculations on the information you get from the registry, or need a monitor to inspect multiple keys/values...etc. A script is still the simplest method when you need to do a lot of work. This is just an example for when we just need something very simple, and I feel like there just arent enough examples out there of all the monitortype options.Anonymous
January 01, 2003
Yes - that is planned for a future post. This is 101 baby steps to get people used to creating their first monitortypes. How to make custom monitortypes reuseable is one of my next posts.Anonymous
January 01, 2003
Nice demo, Kevin. If someone wanted to make this MonitoringType more flexible and "reusable", we could expose configuration elements as input when creating the monitor(s) that will use this type, such as Regstry Path, Attribute Name, Path Type, Value and Frequency could be input during monitor creation.Anonymous
January 01, 2003
Yikes - my bad.
Your design is correct. I missed the concept that you want to know when the reg is missing! I need to slow down and read more sometimes! Sorry about that. I believe a single monitor like this will only work to tell you a BAD value and a MISSING value if you are using only a VALUE. If the entire Key hosting the value is missing, this may fail. I am not 100% sure on that, I'd have to test. In this case, I'd do two monitors - one for a missing value, and one for the incorrect value.
If you cannot get it working - post the monitortype and monitor configuration from the XML here and we can take a look.Anonymous
January 01, 2003
You should not be TARGETING servers with this monitor, that don't have the registry key or value. That's your first problem.Anonymous
August 02, 2010
Nice Kevin. This is probably much more efficient than my PS modules for reading the registry. Never crossed my mind to use the builting registry provicer for anything other than simple discoveries.Anonymous
September 01, 2010
I make my own management pack to inspect a value of two registry key, but how can I create a report or a view to see all servers that have a bad value, instead of open each server in health explorer. ?!Anonymous
December 22, 2010
The comment has been removedAnonymous
May 30, 2012
Great post. Thanks It's possible in the System.ExpressionFilter make some like this: Operator: Contains Value: get-date -UFormat "%Y%m%d"Anonymous
April 16, 2015
Struggling with this. using it to monitor a Reg Value of Either "Stopped" or "Running" for "Current State" on some services which don't appear as Windows Services (SCCM SMS Exec threads).
Do you need the Values Prefix for a string match?
I'm getting Healthy on the monitor, even on servers which don't have the Key or Value?!Anonymous
April 16, 2015
Thanks Kevin. My Bad. I'm targeting Windows Server Operating System, and using overrides to enable this for two servers. one with the reg key present and in a status of running (so should be healthy) and another that does not have the reg key / value at all (which is also healthy). I am wondering if it should be "Value" instead of "Values" ? Or if I need this prefix at all when using a String for XpathQuery?Anonymous
April 16, 2015
May have misunderstood. Was expecting no Key / Value present to generate a Warning?
This monitor will change to a Warning state if:
•The reg value “ServerLevel” is missing.
•The reg value exists but has no value set.
•The reg value exists but is set to something other than the expected values.Anonymous
April 26, 2015
The comment has been removedAnonymous
October 21, 2015
Hey Kevin,
I can't seem to get this to work. Here is my code, the value I am checking is a DWORD and when it is 0 it is considered good, when it is 1 or higher it is considered bad. Here's my code:https://onedrive.live.com/redir?resid=1E4DBC60BCB4810D!10894&authkey=!ADyX3DVPkUwOogw&ithint=file%2ctxtAnonymous
August 12, 2016
For configuring the ComputerName in the Registry provider config, I had to remove the 'Host' in the string below:$Target/Host/Property[Type=”Windows!Microsoft.Windows.Computer”]/NetworkName$Changed to:$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$The documentation states that the second form is used for windows-based computers.This was in a SCOM 2007 R2 environment, yes, I know it's 2016... :)- Anonymous
August 12, 2016
Joe - if you had to remove the "host" this means you did a no-no and targeted Windows Computer.This is a known bad thing. My example targets windows operating system. No workflows should target Windows Computer.
- Anonymous
Anonymous
May 10, 2017
How do we to the same in SCOM 2012 R2? Because on 2012 R2 this tutorial breaks down at step 2: "In your custom management pack, using the Authoring Console, create a new Composite MonitorType." <-- there is no such thing there.- Anonymous
May 10, 2017
You would use the same tool as described above - which is the SCOM 2007 R2 Authoring tool - https://www.microsoft.com/en-us/download/details.aspx?id=18222Or - you would use Visual studio and fragments: https://blogs.technet.microsoft.com/kevinholman/2016/06/04/authoring-management-packs-the-fast-and-easy-way-using-visual-studio/
- Anonymous