Can you make alerts based off of swap memory usage?

Hi All,

I know we can create alerts based off of percentage of hardware memory being used. Is it possible to create alerts based off of percentage of swap memory available over a period of time? I did see another thread mention that newrelic-infra agent does collect this information, but it’s only available in Insights.

This would be on our Ubuntu instances in Amazon AWS EC2. Any help, comments, or suggestions greatly appreciated in advance.


Hi, @dankao: In the Infrastructure UI, you can create a host metric alert condition based on bytes of swap memory used:

To create a condition based on percentage, you would have to use a NRQL alert condition, and calculate the percentage yourself:

SELECT (swapUsedBytes / swapTotalBytes) AS 'Swap percent' 
FROM SystemSample
1 Like

This works great! You will also need to use an aggregator function with that calculation in the alert (min, max, average, etc).

So something like this:

SELECT average(swapUsedBytes / swapTotalBytes) AS ‘Swap percent’ FROM SystemSample