shinken-monitoring / pack-linux-snmp

Configuration pack for Linux hosts
4 stars 16 forks source link

Replace check_memory script to be more accurate #7

Closed dmsimard closed 10 years ago

dmsimard commented 10 years ago

The current check_memory script only checks free/used RAM. It does not account for cached and buffered memory. This would result in, for instance, database servers with a large amount of cached memory but little free RAM to generate warning/critical alerts while there would be literally nothing to worry about.

This script takes into account cached and buffered RAM and also provides better perfdata. Before: ./check_snmp_mem.pl -H 127.0.0.1 -C shinken -f -w 95,50 -c 99,60

Ram : 95%, Swap : 0% : > 95, 50 ; WARNING | ram_used=3856652;3856814;4019206;0;4059804 swap_used=4736;1999868;2399842;0;3999736

After: ./check_snmp_mem.pl -w 95 -c 99 -- -v 2c -c shinken 127.0.0.0.1

MEMORY OK: 56.63 % used; Free => 98212 Kb, Total => 4059804 Kb, Cached => 105092 Kb, Buffered => 1557240 Kb |ram_free=98212 ram_total=4059804 ram_cached=105092 ram_buffered=1557240

Seb-Solon commented 10 years ago

Seems legit!