License
Unknown
v0.0.2 · public · Published about 5 years ago
This project is provides a filter library for evaluating the output of a Sensu check hook that gathers process table information.
Let's start with an example check. In this case, we're checking the CPU of a group of given systems. Of note is the check hook "get_top_processes"
Example Check
type: CheckConfig
api_version: core/v2
metadata:
name: check-cpu
namespace: default
spec:
command: sensu-go-cpu-check -w 70 -c 85
runtime_assets:
- sensu-go-cpu-check-linux
interval: 10
publish: true
output_metric_format: nagios_perfdata
output_metric_handlers: ["influxdb"]
check_hooks:
- warning:
- get_top_processes
- critical:
- get_top_processes
handlers:
- slack
subscriptions:
- system
Example Hook
Here is the example hook. It just runs a ps
command and does a bit of sorting by percent of CPU used.
type: HookConfig
api_version: core/v2
metadata:
annotations: null
labels: null
name: get_top_processes
namespace: default
spec:
command: |-
ps -eo user,pid,cmd:50,%cpu --sort=-%cpu | head -n 6
stdin: false
timeout: 60
Example Filter
---
type: EventFilter
api_version: core/v2
metadata:
name: hook_process_gremlin
namespace: default
spec:
action: allow
runtime_assets:
- sensu-go-hook-has-process-filter
expressions:
- has_hook_process(even)
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.
×