Page 1 of 1
plugin advice: cpu % idle and memory free
Posted: Mon Mar 28, 2011 7:27 pm
by lyle
This question is probably best asked on the nagiosplug-help list on Sourceforge, but someone here might have a bit of advice.
For political reasons, the most important data points on some of our servers are "cpu idle %" and "memory free %". "cpu load" isn't understood by some, and the idea that Oracle might sop up all available memory hasn't sunk in.
In any case, I'd like to monitor these metrics on Windows, Linux, and Solaris clients via nrpe or nsclient++
I've been looking through the options on Nagios Exchange, but wonder if someone here has a favorite client-side plugin or two.
Thanks...Lyle
Re: plugin advice: cpu % idle and memory free
Posted: Tue Mar 29, 2011 9:58 am
by tonyyarusso
The attached files will do what you need for Linux & Solaris, and the Windows config wizard includes the proper parameters for NSClient++. The Linux Agent/Wizard include these checks as well, although with a different memory plugin.
Re: plugin advice: cpu % idle and memory free
Posted: Tue Mar 29, 2011 5:26 pm
by lyle
Thanks for the plugin pointers, Tony. I've been poking around trying to see how this all would go together.
For the moment, I'm concentrating on getting these 2 service checks (cpu% used, and memory% used) working with a Windows Server 2008 R2, where I've got NSClient++ 0.3.8.76 installed.
If I understand you correctly, NSClient++ should be able to supply cpu% and memory% from it's internal checks, and not need any external plugins for these checks.
Testing interactively from our Core 3.0.3 installation, I get:
Code: Select all
root@asb-con-ngs-001:/usr/local/nagios/libexec #> ./check_nrpe -H 172.20.8.26 -c CheckMem -a MaxWarn=80% MaxCrit=90% type=physical ShowAll=long
OK: physical memory: Total: 4G - Used: 1.37G (34%) - Free: 2.63G (66%)|'physical memory %'=34%;80;90; 'physical memory'=1.36G;3.;3.;0;4;
root@asb-con-ngs-001:/usr/local/nagios/libexec #>
root@asb-con-ngs-001:/usr/local/nagios/libexec #> ./check_nrpe -H 172.20.8.26 -c CheckCPU -a warn=80% crit=90% ShowAll=long
OK CPU Load ok.
So I should be able to duplicate these under XI, using a manual configuration.
Only problem is, as you can see, the CheckCPU doesn't seem to be returning the actual values, like the CheckMem does. I'll take this up on the NSClient++ forum, but if you have any other ideas, or an external plugin I should investigate, I'd appreciate it.
Thanks...Lyle
Re: plugin advice: cpu % idle and memory free
Posted: Tue Mar 29, 2011 6:18 pm
by tonyyarusso
The easiest route would be to look at the Windows Server wizard code and see what arguments it uses.
Re: plugin advice: cpu % idle and memory free
Posted: Wed Mar 30, 2011 12:25 pm
by lyle
Thanks for the rapid reply, Tony.
Looks like XI is using the older NSClient (check_nt) transport. Here's what the XI config for the service check looks like:
Code: Select all
check_xi_service_nsclient!!CPULOAD!-l 5,85,95
check_xi_service_nsclient uses this command:
Code: Select all
$USER1$/check_nt -H $HOSTADDRESS$ -s "$ARG1$" -p 12489 -v $ARG2$ $ARG3$ $ARG4$
and "check_nt -h" says, in part:
Code: Select all
Valid variables are:
CPULOAD = Average CPU load on last x minutes.
Although I haven't yet configured the NSClient++ to use both NRPE and NSClient transports, I don't think the canned XI checks will get me "% cpu" used or idle, just "load".
The NSClient++ forum responded that CheckCPU not returning performance data looked like a bug, and asked that I file a bug report.
In the meantime, maybe a script/plugin, external to NSClient++, will be a temporary workaround. Perhaps there's a Windows equivalent to the "check_cpu_stats.sh" that you provided for Linux. Any advice is appreciated.
BTW, the NSClient++ documentation says, when talking about which transport to choose:
check_nt only has some basic checks and is intended for backwards compatibility. You are limited to a handful of checks and there is no way to exploit the power of NSClient++ from here.
and:
check_nrpe: this is what I would think of the "normal" or prefered way to use NSClient++
Thanks again....Lyle
Re: plugin advice: cpu % idle and memory free
Posted: Mon Apr 04, 2011 8:31 pm
by mguthrie
We're currently working on some documentation for setting up checks with NSClient++ and nrpe, We should probably look at updating the windows wizard to use NRPE instead...