Wednesday, April 08, 2009

Windows Performance Monitoring in Zenoss using WMI

Now that we have our ZenPack, we need to begin making it do something for us. The goal here is to monitor Windows server performance using WMI and alert on overage. To do this we are going to start by importing a Perl script to access WMI.

Importing the Perl script
  1. There is a ZenPack available from Zenoss called Perfmon that includes a script called perfmon.pl. We could simply import this ZenPack and then reference the file, but I am going to import the file itself to keep things simple in the future.
  2. Download and extract the Perfmon ZenPack and copy perfmon.pl to the $ZENHOME/ZenPacks/ZenPacks./ZenPacks/lib
  3. Install the wmi-client tools -- apt-get install wmi-client
  4. Make a symbolic link for winexe -- ln -s /usr/bin/winexe /usr/local/zenoss/zenoss/bin/

Create the performance template - Data Sources
  1. Browse to Classes | Devices | Server | Windows and click the Templates tab
  2. Create a new template by selecting Available Performance Templates | Add Template
  3. Enter the name "Basic Windows Performance" and click OK
  4. Create a new Data Source by clicking Data Sources | Add Data Source
  5. For name, enter dsCpuPercentage, Type of Command
  6. For Command Template, enter
  7. $$ZENHOME/ZenPacks/ZenPacks../ZenPacks///lib/perfmon.pl 1 "${dev/manageIp}" "${dev/zWinUser}" "${dev/zWinPassword}" "\Processor(_Total)\% Processor Time" "cpu_ProcessorTime"
  8. Select DataPoints | Add Data Point
  9. Enter cpu_ProcessorTime and click Add

Create the performance template - Thresholds
  1. Browse to Classes | Devices | Server | Windows and click the Templates tab
  2. Click the Basic Windows Performance template
  3. Select Thresholds | Add Threshold
  4. Enter a name of thCpuPercentage, type MinMaxThreshold, click OK
  5. On the threshold page, select the appropriate Data Points
  6. For Max Value, type 80
  7. Set Event Class to /Perf/CPU
  8. Click Save


Create the performance template - Graph Definitions
  1. Browse to Classes | Devices | Server | Windows and click the Templates tab
  2. Click the Basic Windows Performance template
  3. Select Graph Definitions | Add Graph
  4. For name, enter CPU Utilization
  5. Select Graph Points | Add DataPoint, select the data points to include
  6. Click OK, Save

Include the template in the ZenPack

  1. Browse to Classes | Devices | Server | Windows and click the Templates tab
  2. Click the Basic Windows Performance template
  3. Select Performance Template | Add to ZenPack

2 comments:

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

Hello! I'm newbie in Internet, can you give me some useful links? I know only about Yahoo [url=http://yahoo.com]Yahoo[/url] http://yahoo.com Yahoo