Page 1 of 1
NRPE Memory Usage Metrics
Posted: Tue Apr 04, 2017 12:35 pm
by gmackey
Hello,
I just converted all my Windows memory monitors from check_nt to check_nrpe in order to get accurate checks. The checks and alerts are working perfectly but I noticed that the Memory Usage metric no longer lists any of these hosts since converting them to nrpe. Is there something I can do to make sure this data is included in the Memory Usage metric?
define service {
service_description Memory Usage
check_command check_nrpe!checkmem!-a MaxWarn=80% MaxCrit=90% ShowAll type=physical!!!!!!
}
Thanks,
Greg
Re: NRPE Memory Usage Metrics
Posted: Tue Apr 04, 2017 2:27 pm
by gmackey
I checked out the utils-metrics.inc.php file and I think I may have identified a bug. It tries to match on "check_mem" for NRPE which is incorrect (at least for NSClient++). The correct match would be "checkmem". Can someone take a look at the PHP code and see if this is a bug? I'm going to try making a quick edit, removing that underscore, to see what results.
Code: Select all
} else if (preg_match("/check_nrpe/", $command) > 0) { //NRPE
if (preg_match("/check_mem/", $command) > 0) {
return true;
}
Update: That didn't seem to help. Still no memory usage metrics for the NRPE monitors...
Update 2: Okay, it seems the PHP code for this page hasn't been written for this type of monitor. I've forced $display to 1 and verified it is showing data now so I'm going to write the rest of the code to parse the data. I wonder what kind of NRPE command this code is trying to parse? I can't find a single example, at least for Windows, that matches up with check_mem and uses -c and -w.
Re: NRPE Memory Usage Metrics
Posted: Tue Apr 04, 2017 4:41 pm
by mcapra
The short end of this is that the metrics component is getting a huge re-work to account for any and all performance data a bit more elegantly. Right now, it's hard-coded to target specific data sets which isn't very ideal.
I do apologize for the inconvenience. It is something the developers are aware of and are working on a solution for.
Re: NRPE Memory Usage Metrics
Posted: Tue Apr 04, 2017 6:19 pm
by gmackey
Thank you for the response. I got the PHP code written and have good metrics for NRPE memory usage now. I'll look forward to the future update to the metrics component.
-Greg
Re: NRPE Memory Usage Metrics
Posted: Wed Apr 05, 2017 9:00 am
by cdienger
Hi Greg,
Glad you were able to find a work around. Are we okay to lock the thread at this point?
Re: NRPE Memory Usage Metrics
Posted: Wed Apr 05, 2017 9:51 am
by gmackey
Yes, please do. Thanks.