community.general.sensu_check – Manage Sensu checks¶
This plugin is part of the community.general collection (version 1.3.6).
To install it use:
ansible-galaxy collection install community.general.
To use it in a playbook, specify:
Manage the checks that should be run on a machine by Sensu.
Most options do not have a default and will not be added to the check definition unless specified.
All defaults except path, state, backup and metric are not managed by this module,
they are simply specified for your convenience.
# Fetch metrics about the CPU load every 60 seconds, # the sensu server has a handler called 'relay' which forwards stats to graphite - name: Get cpu metrics community.general.sensu_check: name: cpu_load command: /etc/sensu/plugins/system/cpu-mpstat-metrics.rb metric: yes handlers: relay subscribers: common interval: 60 # Check whether nginx is running - name: Check nginx process community.general.sensu_check: name: nginx_running command: /etc/sensu/plugins/processes/check-procs.rb -f /var/run/nginx.pid handlers: default subscribers: nginx interval: 60 # Stop monitoring the disk capacity. # Note that the check will still show up in the sensu dashboard, # to remove it completely you need to issue a DELETE request to the sensu api. - name: Check disk community.general.sensu_check: name: check_disk_capacity state: absent