So where are we... we've built out our MP, added a state view and added monitors to the objects discovered. Now we want to collect information that we can build some performance views and store it in the datawarehouse so we can report on it.
Once again, open up the Authoring Console (I'm trying to do as much as I can through the console), goto the Health Model tab and select the Rules object.
Let's add a new Rule:
- Right click and select New->Collection->Performance Based->Windows Performance Collection
- Give our rule a name, I'm going to gather Logical Process Hypervisor Run Time so I'll name my rule BridgeWays.Windows.HyperV.LP.HypervisorRunTime
- Give it a friendly display name, Logical Processor Hypervisor Run Time
- Set the target, for me it's Microsoft.Windows.HyperV.ServerRole
- Click next
- Now we specify the perfmon counter we want to gather, Object = Hyper-V Hypervisor Logical Processor, Counter = % Hypervisor Run Time, Instance is empty and check the "Include all instances..." check box.
- Set the time interval, 15 minutes is the minimum you should start with
- Click Next
- Optimized vs. Non-Optimized... it really comes down to your tolerance for 'real time' data. If you hate seeing missed polls (ie no data returned for 30 minutes because the data hasn't changed), don't use Optimized collection. If you'd like to reduce the amount of data flowing over the network, use optimized.
- Click Finished
That's it, we've created a rule.
Rules are used to collect data and store it out so that other things, like Performance Views, can consume the data and present it to the user.
So while we've created a rule, now we need to create a performance view that uses that rule.
To build the performance view we need to switch to the Presentation tab and click on the Views object.
First thing is to create a nice folder hierarchy to put our views into. I created two folders, Performance and Processor so that my folder hierarchy in SCOM looks like:
Now to create out Performance View:
- Right Click, New->Performance View
- Give it a name, I use BridgeWays.Windows.HyperV.LP.HypervisorRunTime.Perf (I simply mimic the rule name and add .Perf)
- Give it a friendly display name, Logical Processor Hypervisor Run Time
- Select the target, Microsoft.Windows.HyperV.ServerRole
- Click finish
So, are you done? nope, that little wizard didn't really do all that much. Now we have to actually create the tie from the View to the Rule.
- Right click the view, select Properties, goto the Configuration tab
- You'll see an interesting dialog showing Criteria... click Edit
- Specify the editor you want to use (you can make this permanent using the Tools->Options dialog), I use Visual Studio whose default install path is C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
- Time for the voodoo, you can find most of the Schema items in the authoring guide, in this case we're going to tie our view to the perfmon counter we collect in our rule so we need to specify that in the XML using:
<Criteria>
<Object>Hyper-V Hypervisor Logical Processor
<Instance />
<Counter>% Hypervisor Run Time</Counter>
</Criteria> - Close the editor
- Click the folder tab and ensure that the right folder is selected, I select the BridgeWays.Windows.HyperV.Processor only
- Click Options and make the view public
- Click OK
Ok, now we're done. It would actually be pretty easy if the console would simply allow you to select the rule and it auto-magically generated the XML... but we're not that lucky yet.
In the end we have a performance view, showing up in the tree.
You can repeat this process to build additional Rules and Performance views on those rules. Once that is done it's time to combine those views into Dashboards... we'll go over that another time.
Part 1: Getting Started with writing a more robust Hyper-V MP
Part 2: Adding your own Monitors
Part 3: Adding Rules and Performance Views
Part 4: Adding Dashboards
Comments