Page 1 of 1

Monitoring Average Memory Consumption

Posted: Wed May 18, 2016 11:00 am
by gilfalko
Hi,

Is there a plugin for RAM usage similar to nrpe's check_cpuload?
I have some SQL servers with high memory consumption for which I'd like to receive alerts once the average has been over 80% for a certain amount of time.
How can this be achieved?

Thanks

Re: Monitoring Average Memory Consumption

Posted: Wed May 18, 2016 4:42 pm
by tgriep
can you post the OS type and version of your SQL server?

Re: Monitoring Average Memory Consumption

Posted: Wed May 18, 2016 7:15 pm
by gilfalko
MSSQL
Windows Server 2012 R2.

I could do this with a PS script it'd have to be running in the background non-stop.
There must be another way...

Re: Monitoring Average Memory Consumption

Posted: Wed May 18, 2016 8:15 pm
by Box293
So I did some research on this, and there are some options.

You could create a wrapper script that stores the values for x amount of time and compare them everytime it runs.

However seeing as the service is most likely collecting the performance data and storing it in an RRD file, then you could create a second service that queries the RRD file and calculates if the average has been over 80%.

I found some plugins that sort of do this, but they all seem to need some work get what you want.

This one was the closest, but required rrd_poller and I wasn't sure how to get it working.
https://exchange.nagios.org/directory/P ... pl/details

These seemed to have potential:
https://exchange.nagios.org/directory/P ... es/details

This command can get the data:

Code: Select all

/usr/bin/rrdtool fetch "/usr/local/nagios/share/perfdata/localhost/Swap_Usage.rrd" AVERAGE -s -1d -e -10m
Then it's a simple matter of manipulating it in a script.

Re: Monitoring Average Memory Consumption

Posted: Thu May 19, 2016 1:39 am
by gilfalko
I appreciate the educated answer.

Using RRD is nice and all but as we say "less is more".
It gave me an idea though.
As all I need to is to store some numbers for a period of time,
I could script a FIFO mechanism using Powershell that just maintains a txt file with a list and disposes of the first line each time it gets full.
All that's left is to send out the average result and we're done :)

Re: Monitoring Average Memory Consumption

Posted: Thu May 19, 2016 1:00 pm
by tmcdonald
Well that's certainly one way to do it!

Feel free to post here if you need help with the Nagios side of things.