Re: How Does NRPE Calculate Memory
Posted: Wed May 29, 2019 6:31 am
Our Linux Admin did some digging and found this article...
https://support.nagios.com/kb/article.php?id=171
NRPE - Linux Cached Memory Not Added to Free Memory Article Number: 171 | Rating: Unrated | Last Updated by tlea on Tue, Feb 9, 2016 at 9:29 PM
-> EDIT ARTICLE <-
Problem Description
In older versions of the Linux NRPE Agent, the memory plugin custom_check_mem did not take into account cached memory as part of the free memory and may create false warning or critical alerts, even though you are NOT low on memory.
Resolving The Problem
In order to fix this, we have updated the custom_check_mem plugin, part of our Linux agent install script by adding an optional flag [-n|--nocache]. Basically, cached memory is added to the free memory when you use the "-n" flag.
Usage:
custom_check_mem [-w|--warning]<percent free> [-c|--critical]<percent free> [-n|--nocache]
If you are downloading a new copy of our Linux agent, the updated custom_check_mem plugin will be included. If you already installed the Linux agent, you can just download the updated custom_check_mem from here. Copy the new script over the old custom_check_mem.
Next we need adjust any services to include the -n argument.
Go to Core Config Manager > Monitoring > Services Find the Memory Usage service and click it On the Common Settings tab modify the $ARG2$ field by adding a -n flag
For example, if you had:
-a '-w 20 -c 10'
Change it to:
-a '-w 20 -c 10 -n'
Question - How can I add this "-n" to all of our Linux memory monitors? We are currently at v5.5.5.
https://support.nagios.com/kb/article.php?id=171
NRPE - Linux Cached Memory Not Added to Free Memory Article Number: 171 | Rating: Unrated | Last Updated by tlea on Tue, Feb 9, 2016 at 9:29 PM
-> EDIT ARTICLE <-
Problem Description
In older versions of the Linux NRPE Agent, the memory plugin custom_check_mem did not take into account cached memory as part of the free memory and may create false warning or critical alerts, even though you are NOT low on memory.
Resolving The Problem
In order to fix this, we have updated the custom_check_mem plugin, part of our Linux agent install script by adding an optional flag [-n|--nocache]. Basically, cached memory is added to the free memory when you use the "-n" flag.
Usage:
custom_check_mem [-w|--warning]<percent free> [-c|--critical]<percent free> [-n|--nocache]
If you are downloading a new copy of our Linux agent, the updated custom_check_mem plugin will be included. If you already installed the Linux agent, you can just download the updated custom_check_mem from here. Copy the new script over the old custom_check_mem.
Next we need adjust any services to include the -n argument.
Go to Core Config Manager > Monitoring > Services Find the Memory Usage service and click it On the Common Settings tab modify the $ARG2$ field by adding a -n flag
For example, if you had:
-a '-w 20 -c 10'
Change it to:
-a '-w 20 -c 10 -n'
Question - How can I add this "-n" to all of our Linux memory monitors? We are currently at v5.5.5.