Memory Checks

This plugin provides native memory instrumentation for monitoring and metrics collection, including: memory usage via `free` and `vmstat`, including metrics. Note that this plugin may have cross-platform issues.


Build Status Gem Version Code Climate Test Coverage Dependency Status



  • bin/check-memory.rb
  • bin/
  • bin/check-memory-percent.rb
  • bin/
  • bin/check-ram.rb
  • bin/check-swap-percent.rb
  • bin/
  • bin/check-swap.rb
  • bin/metrics-memory-percent.rb
  • bin/metrics-memory.rb


Use -h flag on any command to see available usages, -w to set warning threshold -c to set critical threshold and -p to print out performance data.

  • /opt/sensu/embedded/bin/check-memory.rb -w 2500 -c 3000 - Values in Megabytes
  • /opt/sensu/embedded/bin/check-memory-percent.rb -w 70 -c 80 - Values in Percentages
  • /opt/sensu/embedded/bin/check-swap.rb -w 2500 -c 3000 - Values in Megabytes
  • /opt/sensu/embedded/bin/check-swap-percent.rb -w 70 -c 80 - Values in Percentages
  • /opt/sensu/embedded/bin/metrics-memory.rb -s FooBar - So metrics are now prepended with foobar, default is machine hostname.


Installation and Setup


Ruby does not have a good native way without the use of C extensions to grab information on memory usage (outside of running shell commands and parsing out). Because of this check-ram.rb uses a gem called vmstat which has a somewhat annoying dependency on a gcc to compile the C extensions. In order to not force people to install gcc if they are not using check-ram.rb we do not install it by default, and is up to the user to make sure that they install it. This requires two steps and can vary based on your distribution and ruby set up:

  • Install gcc. If you are on a debian based system it is located in the build-essential package.
  • Install vmstat gem into the path that sensu gems are expected to run from:
    • sudo /opt/sensu/embedded/bin/gem install vmstat --no-rdoc --no-ri or the equivalent for installing sensu gems in your configuration management system


Get Integration


12 stars on GitHub
8 open issues on GitHub
45 open forks on GitHub

Sensu Integrations

Sensu integrations and extensions are available for dozens of modern applications and services.