Jul 10, 2009 10:01 AM
WMI vs Snmp for perf monitoring with Zenoss Core
-
Like (0)
_______________________________________________
Hi,
I use Zenoss Core 2.4.2 (new install on Debian 5.0)
I need:
1) monitoring and graphing of "the usual stuff" (memory, cpu usage, swap etc)
2) monitoring and graphing processes that match a certain name, on certain devices and alert when their memory consumption goes above a certain treshhold.
I know item 2 may be too specific so I don't have a problem with implementing it myself. But if there are existing things I could use for this, please point me to them happy (I think that this is different from the "process monitoring" feature in zenoss, correct me if I'm wrong)
But for item 1 I have these problems:
1) I would avoid installing 3rd party tools such as "snmp informant" on production boxes. According the official documentation you need this to monitor the things I mentioned. However when I do an snmpwalk on the system I see various MIB's related to memory/cpu/processes so I think it should be possible using the default windows snmp agent, however this does not work out of the box (graphs do not show)
2) WMI seems to be "the way to go" on windows, but the official wmi zenpack is not free, so I cannot use it.
I tried the following zenpacks:
- http://blog.dastru
- http://www.zenoss.com/community/projects/zenpacks/windowswmidevicetemplatep.com/?p=13
But both of these also show no working graphs. (they show empty graphs with RRD errors). I guess this is because they are written for older Zenoss versions.
Thanks for any help.
Dieter
_______________________________________________
zenoss-windows mailing list
zenoss-windows@zenoss.org
http://lists.zenoss.org/mailman/listinfo/zenoss-windows
"jmp242" wrote:
I've successfully used the community WMI Zenpack with 2.3.3 anyway, so
it's generally version required and up...
You could also try using the PerfMon Zenpack (with proper configuration)
to read out windows data into zenoss.
As to your second question, you could probably set a threshold on the
graphs for the given process in the templates, just like for any
datasource/template, and alert based on that.
--
James Pulver
Information Technology Area Supervisor
LEPP Computer Group
Cornell University
_______________________________________________
jmp242 wrote:
I've successfully used the community WMI Zenpack with 2.3.3 anyway, so
it's generally version required and up...
You could also try using the PerfMon Zenpack (with proper configuration)
to read out windows data into zenoss.
As to your second question, you could probably set a threshold on the
graphs for the given process in the templates, just like for any
datasource/template, and alert based on that.
--
James Pulver
Information Technology Area Supervisor
LEPP Computer Group
Cornell University
Thanks, I got requirement 1 working by using a zenpack I found somewhere on the net. But I'm afraid I didn't explain the 2nd one in enough detail:
I need to monitor the memory usage of _single_ processes matching a certain name and raise an alert when a threshold is exceeded.
The built-in zenoss process monitoring feature adds up the usage of all processes matching a certain name, so that's not an option for me.
_______________________________________________
zenoss-windows mailing list
zenoss-windows@zenoss.org
http://lists.zenoss.org/mailman/listinfo/zenoss-windows
"jmp242" wrote:
You could create your own Template I suppose using whatever method you
like to get the process memory use (Maybe PerfMon?)...
select PageFileBytes,PoolNonpagedBytes,PoolPagedBytes,PrivateBytes,VirtualBytes,WorkingSet from win32_PerfFormattedData_PerfProc_Process where name LIKE '%indesign%'
_______________________________________________
jmp242 wrote:
You could create your own Template I suppose using whatever method you
like to get the process memory use (Maybe PerfMon?)...
Thanks.
I downloaded the new WMI datasource zenpack (http://www.zenoss.com/community/projects/zenpacks/wmidatasource)
Then, on the server I created a new performance template.
The wql for the datasource is:
Code:
select PageFileBytes,PoolNonpagedBytes,PoolPagedBytes,PrivateBytes,VirtualBytes,WorkingSet from win32_PerfFormattedData_PerfProc_Process where name LIKE '%indesign%'
This works fine, it shows the memory metrics for all 3 processes matching the name.
Then I made datapoints for each field, type GAUGE
Then I made a graph and added all datapoints to it.
Now when I go to the 'perf' tab, I see the border which goes around the graph, but no actual graph image. I checked in /usr/local/zenoss/zenoss/log but couldn't really find an error or reason for this.
_______________________________________________
zenoss-windows mailing list
zenoss-windows@zenoss.org
http://lists.zenoss.org/mailman/listinfo/zenoss-windows
"jmp242" wrote:
Are rrd files being created in ZENHOME/perf/device?
Executing command wmic -U '.username '%'*****' //192.168.68.25 --namespace='rootcimv2' "select PageFileBytes,PoolNonpagedBytes,PoolPagedBytes,PrivateBytes,VirtualBytes,WorkingSet from win32_PerfFormattedData_PerfProc_Process where name LIKE '%indesign%'" against QA Indesign server
CLASS: Win32_PerfFormattedData_PerfProc_Process
Name|PageFileBytes|PoolNonpagedBytes|PoolPagedBytes|PrivateBytes|VirtualBytes|WorkingSet
InDesignServer|217841664|39192|372012|217841664|398671872|59248640
InDesignServer|217841664|39192|372012|217841664|398671872|59432960
InDesignServer|217841664|39232|380380|217841664|398671872|59146240
_______________________________________________
jmp242 wrote:
Are rrd files being created in ZENHOME/perf/device?
Thanks for helping out James :)
Turns out I needed to be more patient. After a while it started working.
But now, here comes the tricky part.
Remember: my main problem is "alert if the memory usage of any single process matching a string goes above 1GB"
And I can't really figure out how to do this.
I thought I could just monitor all processes matching the name but I could not find anything about datasources returning data for multiple entities (
http://www.zenoss.com/community/docs/zenoss-guide/2.4.0/ch06s02.html ) (eg multiple rows)
Here is the output of a command execution:
Executing command wmic -U '.username '%'*****' //192.168.68.25 --namespace='rootcimv2' "select PageFileBytes,PoolNonpagedBytes,PoolPagedBytes,PrivateBytes,VirtualBytes,WorkingSet from win32_PerfFormattedData_PerfProc_Process where name LIKE '%indesign%'" against QA Indesign server
CLASS: Win32_PerfFormattedData_PerfProc_Process
Name|PageFileBytes|PoolNonpagedBytes|PoolPagedBytes|PrivateBytes|VirtualBytes|WorkingSet
InDesignServer|217841664|39192|372012|217841664|398671872|59248640
InDesignServer|217841664|39192|372012|217841664|398671872|59432960
InDesignServer|217841664|39232|380380|217841664|398671872|59146240
So in this case, there are 3 processes.
However, the graph only seems to draw each column once. It seems it does this only for the first found process and ignores to the two others.
Is there a way to have it making datapoints/graphs for each returned line? (and have the same alerting rules for all)
_______________________________________________
zenoss-windows mailing list
zenoss-windows@zenoss.org
http://lists.zenoss.org/mailman/listinfo/zenoss-windows
"jmp242" wrote:
Well, I'd just create multiple Data Sources in the Template, and then
graph them on the same graph with the set threshold... I think that
would work.
_______________________________________________
jmp242 wrote:
Well, I'd just create multiple Data Sources in the Template, and then
graph them on the same graph with the set threshold... I think that
would work.
Well, that sounds simple enough :)
But I fail at implementing it. WQL doesn't seem to support the 'limit' keyword. I've been googling around and most "solutions" I found on internet work around this by adding more condititions to the where clause, but that's not really an option for me. I need some way to get the first, second, third, fourth,... result from the query so I get the stats for all separate processes separately.
_______________________________________________
zenoss-windows mailing list
zenoss-windows@zenoss.org
http://lists.zenoss.org/mailman/listinfo/zenoss-windows
"jmp242" wrote:
Well, I'd just create multiple Data Sources in the Template, and then
graph them on the same graph with the set threshold... I think that
would work.
"jmp242" wrote:
Well, I'm afraid you'd be back to command based datasources then, and
you could use grep etc to parse the output before returning to Zenoss.
#!/bin/bash
# sample invocation:
# /usr/local/zenoss/common/bin/wmic -U .\USER%PASS //IP --namespace=root\cimv2 select
# PageFileBytes,PoolNonpagedBytes,PoolPagedBytes,PrivateBytes,VirtualBytes,WorkingSet
# from win32_PerfFormattedData_PerfProc_Process where name LIKE '%indesign%'
# if the query ends on 'ENTRY <INT>' only show the specified line from the output
query="${!#}" # last argument given
query="`echo $query`" # get rid of newlines
entry=$(echo "$query" | sed 's/.*ENTRY \([0-9]\+\)$/\1/')
args=("$@")
args[$#-1]=$(echo "${args[$#-1]}" | sed 's/ENTRY \([0-9]\+\)$//');
output=$(wmic_real "${args[@]}")
if [[ $entry = *[^0-9]* ]]
then
echo "$output"
else
#output header:
head -n 2 <<< "$output"
#output n'th actual record
sed -n "$((entry+2)) p" <<< "$output"
fi
all entries:
Executing command wmic -U '.\user'%'*****' //192.168.68.25 --namespace='root\cimv2' "select
PageFileBytes,PoolNonpagedBytes,PoolPagedBytes,PrivateBytes,VirtualBytes,WorkingSet
from win32_PerfFormattedData_PerfProc_Process where name LIKE '%indesign%'" against QA Indesign server
CLASS: Win32_PerfFormattedData_PerfProc_Process
Name|PageFileBytes|PoolNonpagedBytes|PoolPagedBytes|PrivateBytes|VirtualBytes|WorkingSet
InDesignServer|279666688|40960|390540|279666688|628465664|138317824
InDesignServer|280756224|41080|382340|280756224|635314176|139390976
InDesignServer|279392256|41040|390644|279392256|633208832|138293248
DONE in 0 seconds
only entry 1:
Executing command wmic -U '.\user'%'*****' //192.168.68.25 --namespace='root\cimv2' "select
PageFileBytes,PoolNonpagedBytes,PoolPagedBytes,PrivateBytes,VirtualBytes,WorkingSet
from win32_PerfFormattedData_PerfProc_Process where name LIKE '%indesign%' ENTRY 1" against QA Indesign server
CLASS: Win32_PerfFormattedData_PerfProc_Process
Name|PageFileBytes|PoolNonpagedBytes|PoolPagedBytes|PrivateBytes|VirtualBytes|WorkingSet
InDesignServer|279666688|41016|390540|279666688|628465664|138317824
DONE in 0 seconds
only entry 3:
Executing command wmic -U '.\thomascook'%'*****' //192.168.68.25 --namespace='root\cimv2' "select PageFileBytes,PoolNonpagedBytes,PoolPagedBytes,PrivateBytes,VirtualBytes,WorkingSet from win32_PerfFormattedData_PerfProc_Process where name LIKE '%indesign%' ENTRY 3" against QA Indesign server
CLASS: Win32_PerfFormattedData_PerfProc_Process
Name|PageFileBytes|PoolNonpagedBytes|PoolPagedBytes|PrivateBytes|VirtualBytes|WorkingSet
InDesignServer|279392256|41040|390644|279392256|633208832|138293248
DONE in 0 seconds
"nharikrishna" wrote:
To see the new graphs, try restarting zenoss. I had to do when i added new data points
$results =`\$ZENHOME/bin/wmic -U '@ARGV[1]'%'@ARGV[2]' //@ARGV[0] "SELECT ProcessorQueueLength FROM Win32_PerfFormattedData_PerfOS_System"`;
if ( $results ) {
@results = split (/\n/,$results); # split the multi-line output at new lines
$line = @results; # $line is the number of lines of output
if ( @results[$line - 2] eq "ProcessorQueueLength" ) { # The string to match against here is the list of WMI variable names
@out = split (/\|/,@results[$line - 1]); # Here we ASSUMING only one line of data to split into an array named "out"
print "OK|ProcessorQueueLength=@out[0] \n"; # And here you make the real output, space delimited, VarName=Value VarName=Value VarName=Value etc etc
} else {
print "Unknown|$results\n";
}
} else {
print "Unknown|No_response\n";
}
Status Message | Name=Value Name=Value Name=Value
"jhelgesen" wrote:
Greetings...
First of all, congrats on getting this far.
"jhelgesen" wrote:
When I have made some of these custom command datasources for WMIC query outputs, I ended up making the "final" output look as much like a Nagios command output as possible, since Zenoss worked hard at being compatible with that format. "That format", in general, would be(..)
You'll have to bear with me, as I did stuff in Perl, but the basic code to convert from WMI Query output to Nagios output will look something like this:# #output header: # head -n 2 <<< "$output" # #output n'th actual record # sed -n "$((entry+2)) p" <<< "$output" nagiosline="`head -n 1 <<< "$output"` |" index=0 for key in `echo "$output" | sed -n '2p' | tr '|' ' '` do index=$((index+1)) nagiosline="$nagiosline $key=`echo "$output" | sed -n '3p' | cut -d '|' -f $index`" done echo $nagiosline
Once the output is set up, you should see the graphs populate with actual numbers.
I imagine the next step would be to deal with the ProcessID numbers of your process instances, but that's another day's topic.
Hope this helps...
--Jay
Status Message | Name=Value Name=Value Name=Value
PageFileBytes,PoolNonpagedBytes,PoolPagedBytes,PrivateBytes,VirtualBytes,WorkingSet
from win32_PerfFormattedData_PerfProc_Process where name LIKE '%indesign%' ENTRY 1" against QA Indesign server
CLASS: Win32_PerfFormattedData_PerfProc_Process | Name=InDesignServer PageFileBytes=290140160 PoolNonpagedBytes=41080 PoolPagedBytes=390708 PrivateBytes=290140160 VirtualBytes=633630720 WorkingSet=148090880
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||