License
MIT License
v0.1.0 · public · Published about 1 month ago
This plugin provides native entropy instrumentation for monitoring and metrics collection of available system entropy on Linux systems.
The plugin includes:
Both commands read the available entropy from /proc/sys/kernel/random/entropy_avail.
Download the latest release from the releases page.
go install github.com/nmollerup/sensu-check-entropy/cmd/check-entropy@latest
go install github.com/nmollerup/sensu-check-entropy/cmd/metrics-entropy@latest
Assets are the recommended way to install plugins in Sensu. The asset can be configured using sensuctl:
sensuctl asset add nmollerup/sensu-check-entropy
Example check definition:
---
type: CheckConfig
api_version: core/v2
metadata:
name: check-entropy
spec:
command: check-entropy --warning 60 --critical 30
subscriptions:
- linux
runtime_assets:
- nmollerup/sensu-check-entropy
interval: 60
publish: true
Sensu check to monitor available system entropy
Usage:
check-entropy [flags]
Flags:
-c, --critical int Critical threshold for available entropy (default 30)
-h, --help help for check-entropy
-m, --metrics Output entropy as metrics in Graphite format
-s, --metric-scheme Metric naming scheme when using --metrics (default: hostname.entropy)
-w, --warning int Warning threshold for available entropy (default 60)
Check with default thresholds (warning: 60, critical: 30):
check-entropy
Check with custom thresholds:
check-entropy --warning 100 --critical 50
Check using environment variables:
CHECK_ENTROPY_WARNING=100 CHECK_ENTROPY_CRITICAL=50 check-entropy
Output metrics in Graphite format:
check-entropy --metrics
# Output: hostname.entropy 256 1738147200
Output metrics with custom scheme:
check-entropy --metrics --metric-scheme myserver.system.entropy
# Output: myserver.system.entropy 256 1738147200
The check will output one of the following states:
Example outputs:
CheckEntropy OK: entropy is 256
CheckEntropy WARNING: entropy is 55
CheckEntropy CRITICAL: entropy is 25
Sensu metric plugin to collect system entropy metrics
Usage:
metrics-entropy [flags]
Flags:
-h, --help help for metrics-entropy
-s, --scheme string Metric naming scheme, text to prepend to metric (default: hostname.entropy)
Collect entropy metrics with default scheme:
metrics-entropy
# Output: hostname.entropy 256 1738147200
Collect entropy metrics with custom scheme:
metrics-entropy --scheme production.server01.entropy
# Output: production.server01.entropy 256 1738147200
Example metric check definition:
---
type: CheckConfig
api_version: core/v2
metadata:
name: metrics-entropy
spec:
command: metrics-entropy
subscriptions:
- linux
runtime_assets:
- nmollerup/sensu-check-entropy
interval: 60
publish: true
output_metric_format: graphite_plaintext
output_metric_handlers:
- influxdb
This plugin is designed for Linux systems only, as it reads from /proc/sys/kernel/random/entropy_avail.
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details.
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.
×