how to exclude the Linux cached memory from the monitoring a

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
vivma1989
Posts: 6
Joined: Mon Jun 10, 2019 5:02 am

Re: how to exclude the Linux cached memory from the monitori

Post by vivma1989 »

is this correct?

total - free = 8193052 - 6360556 = 1832496 # with "-m"
total - free - cached = 8193052 - 6360556 - 856036 = 976460 # without "-m"

if we are calculating (total)-(free)-(cache), then it should be equal to the "used" memory shown by the free command?

please correct me if i am wrong here
User avatar
lmiltchev
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: how to exclude the Linux cached memory from the monitori

Post by lmiltchev »

The output of the second command would never match the output of the free command... In the free command both, the cached memory AND the buffers are subtracted... On the other hand, the plugin subtracts ONLY the cached memory, but NOT the buffers...
-/+ buffers/cache: 791108 7401944
Other words, instead of this:
total - free - cached = 8193052 - 6360556 - 856036 = 976460 # without "-m"
you would have this:
total - free - cached - buffers = 8193052 - 6360556 - 856036 - 185352 = 791108 # without "-m"
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked