# Check Memory (check\_mem.pl) Wrong Values

**URL:** <https://community.icinga.com/t/check-memory-check-mem-pl-wrong-values/1395>\
**Category:** Service Monitoring\
**Created:** [June 5, 2019, 7:44am UTC](https://community.icinga.com/t/check-memory-check-mem-pl-wrong-values/1395 "2019-06-05T07:44:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xxandyxx](https://community.icinga.com/letter_avatar_proxy/v4/letter/x/a88e4f/32.png) [@xxandyxx](https://community.icinga.com/u/xxandyxx)\
**Post date:** [June 5, 2019, 7:44am UTC](https://community.icinga.com/t/check-memory-check-mem-pl-wrong-values/1395/1 "2019-06-05T07:44:06Z")

</div>

Hello everybody,

I have just been made aware that the implemented in Icinga2 script check\_mem.pl wrong values.

The script is implemented in the following file: /usr/share/icinga2/include/plugins-contrib.d/operating-system.conf

As an alternative, I once included the check\_linux\_memory script from [https://github.com/hugme/Nag\_checks](https://github.com/hugme/Nag_checks) and the values ​​match.

Does anyone happen to have the direct link to download the check\_mem.pl script.

We use the script check\_mem.pl by Dan Larson ([dl@tyfon.net](mailto:dl@tyfon.net)), Justin Ellison ([jhustin@techadvice.com](mailto:jhustin@techadvice.com))

Thank you for your help

---

<div class="post-metadata">

**Author:** ![dflach](https://community.icinga.com/user_avatar/community.icinga.com/dflach/32/120_2.png) [@dflach](https://community.icinga.com/u/dflach)\
**Post date:** [June 5, 2019, 7:47am UTC](https://community.icinga.com/t/check-memory-check-mem-pl-wrong-values/1395/2 "2019-06-05T07:47:10Z")

</div>

Should be that one: [https://github.com/justintime/nagios-plugins](https://github.com/justintime/nagios-plugins)

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [June 5, 2019, 8:00am UTC](https://community.icinga.com/t/check-memory-check-mem-pl-wrong-values/1395/3 "2019-06-05T08:00:08Z")

</div>

All plugin and CheckCommand definition patches and PRs require docs, including a URL to the original plugin. Yours is documented [here](https://icinga.com/docs/icinga2/latest/doc/10-icinga-template-library/#mem).

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![xxandyxx](https://community.icinga.com/letter_avatar_proxy/v4/letter/x/a88e4f/32.png) [@xxandyxx](https://community.icinga.com/u/xxandyxx)\
**Post date:** [June 6, 2019, 12:22pm UTC](https://community.icinga.com/t/check-memory-check-mem-pl-wrong-values/1395/4 "2019-06-06T12:22:20Z")

</div>

Hello everybody,

we have found something for the erroneous results.

By calling freem, I got the following result:

free -m  
totally used free shared buff / cache available  
Mem: 64266 1381 59489 1 3394 62260  
Swap: 4095 0 4095

For database systems like Oracle, the same call is set to 0 for the same call

If you comment out the lines 178 - 181 in the script (Buffers | Cached | SReclaimable) the results will be correct again

Or is there another solution …

---

<div class="post-metadata">

**Author:** ![gkoutsog](https://community.icinga.com/user_avatar/community.icinga.com/gkoutsog/32/250_2.png) [@gkoutsog](https://community.icinga.com/u/gkoutsog)\
**Post date:** [June 6, 2019, 2:02pm UTC](https://community.icinga.com/t/check-memory-check-mem-pl-wrong-values/1395/5 "2019-06-06T14:02:51Z")

</div>

How about an example with both “free -m” and plugin output and explain what you consider wrong, just so we are all on the same page.

Cheers
