Search code examples
sensuuchiwa

Sensu check-memory not working as per documentation


From the documentation https://github.com/sensu-plugins/sensu-plugins-memory-checks

/opt/sensu/embedded/bin/check-memory.rb -w 2500 -c 3000 - Values in Megabytes

My config.json has

"command": "check-memory.sh -w 50000000 -c 100000000"

top reports

KiB Mem:   1014632 total,   905872 used,   108760 free,    42176 buffers

uchiwa reports Mem Critical free system memory 475Mb

Questions

  1. I am just not able to get the check-memory to green. The current system is at benchmark memory usage. I need to set a -w just above, so I tried -w 500 and did not work. Thats why I kept increasing the 0's. But no help.
  2. uchiwa reports free memory, shouldn't it report used memory since the -w is set to the max used memory, confusing ?

Solution

  • The check says how much free memmory you have and the warning and critical is that you should have at least that much avalible memort left. It warns since you don't have 50000000 MB of free memory.

    You could have solved this question by just running the script in the shell and tested there, no need to involve sensu really. Or, as I find it nessecary quite often, read the actual source code of the plugin.