So now we have a script that we can put into either an existing management pack or a new management pack and have it drive a new type of monitor. For this example I will walk through putting this into a standalone management pack.
Step 1: Open Authoring Console –> File –> New Management Pack
Step 2: Give the Management Pack a unique and meaningful name
Step 3: Create the New Composite Data Source. Type Library –> Module Types –> Data Sources
Step 4: Give our new DataSource a unique meaningful name.
Step 5: Give the new DataSource a Display Name.
Step 6: Setup the Member Modules
Member Modules are the subcomponents of the DataSource. In our case we will need something to schedule the execution of our script, and something to execute and return values from our script.
System.Scheduler is the generic scheduler and will allow you execute any DataSource on a Schedule
Microsoft.Windows.PowerShellPropertyBagProbe is Built-in for running PowerShell scripts that return non-discovery data
Step 7: Setup the Configuration Schema of this DataSource
The Configuration Schema is simply a list of things that this DataSource needs defined for it inorder to run correctly. This includes all of the $Config/Parameter$ variables we declared previously (it needs to get the data from somewhere and this say that it can expect to have it passed to it from whatever ends up calling it)
Next Steps: Create the new Monitor Type for this DataSource (where we define what it means to be healthy or unhealthy) and then use that monitor type in an actual monitor! Stay Tuned!