License
MIT License
forked from sensu-plugins/sensu-plugins-memory-checks
v4.1.1-jef.1 · public · Published almost 5 years ago
This plugin provides native memory instrumentation for monitoring and metrics collection, including memory usage via free
and vmstat
, including metrics. NOTE: This plugin may have cross-platform issues.
check-memory
Evaluate free system memory for Linux-based systems.
check-memory-percent
Evaluate the percentage of free system memory for Linux-based systems.
check-ram
Check the percentage of free RAM.
check-swap-percent
Checks swap usage as a percentage of the total swap.
check-swap
Evaluate swap memory usage for Linux-based systems.
metrics-memory-percent
Read memory statistics as a percentage and put them in a form usable by Graphite. Metrics borrowed from HoardD.
metrics-memory-vmstat
Read memory statistics and put them in a form usable by vmstat
.
metrics-memory
Read memory statistics and put them in a form usable by Graphite. Metrics borrowed from HoardD.
check-ram.rb
Usage: /opt/sensu/embedded/bin/check-ram.rb (options)
-c CRIT
-f, --free checks free threshold, defaults to true
-m, --megabytes Unless --megabytes is specified the thresholds are in percentage of memory used as opposed to MB of ram left
-u, --used checks used threshold, defaults to false
-w WARN
metrics-memory-percent.rb
Usage: /opt/sensu/embedded/bin/metrics-memory-percent.rb (options)
-s, --scheme SCHEME Metric naming scheme, text to prepend to metric
Assets are the best way to make use of this plugin. If you're not using an asset, please consider doing so! If you're using sensuctl 5.13 or later, you can use the following command to add the asset:
sensuctl asset add sensu-plugins/sensu-plugins-memory-checks
If you're using an earlier version of sensuctl, you can download the asset definition from this project's Bonsai Asset Index page.
---
type: Asset
api_version: core/v2
metadata:
name: sensu-plugins-memory-checks
spec:
url: https://assets.bonsai.sensu.io/c5391d4ae186484226732344b35cf95c0b07b8ec/sensu-plugins-memory-checks_4.0.0_centos_linux_amd64.tar.gz
sha512: ea297a85aa3612da7f78d948f9784443fffac511040c5130a2dcde7191a0004044c2ef881e665520cbc64431955ab19920d84de6b5fed85c63da7091c4b93bf0
---
type: CheckConfig
spec:
command: "check-memory.rb"
handlers: []
high_flap_threshold: 0
interval: 10
low_flap_threshold: 0
publish: true
runtime_assets:
- sensu-plugins/sensu-plugins-memory-checks
- sensu/sensu-ruby-runtime
subscriptions:
- linux
{
"checks": {
"metrics-disk-usage": {
"command": "metric-disk-usage.rb",
"subscribers": ["linux"],
"interval": 10,
"refresh": 10,
"handlers": ["influxdb"]
}
}
}
See the instructions above for asset registration
Install and setup plugins on Sensu Core
bin/check-ram.rb
Ruby does not have a good native way to grab information on memory usage (without using C extensions or running shell commands and parsing out). For this reason, check-ram.rb
uses a gem called vmstat
that has a dependency on a GCC to compile the C extensions.
To avoid errors that occur when trying to compile the C extensions without GCC present, we do not install the vmstat
gem by default.
Users who need to use check-ram.rb
must install build tools, including GCC. This usually requires two steps but can vary based on your distribution and Ruby setup:
gcc
. If you are on a Debian system, GCC is located in the build-essential
package. On RHEL systems, yum groupinstall "Development tools"
will provide the required packages.vmstat
gem into the path from which Sensu gems are expected to run, sudo /opt/sensu/embedded/bin/gem install vmstat --no-rdoc --no-ri
, or the equivalent for installing Sensu gems in your configuration management system.If you are verifying certificates in the gem install you will need the certificate for the sys-filesystem
gem loaded in the gem certificate store.
See CONTRIBUTING.md for information about contributing to this plugin.
Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.
×