summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandro Locati <me@fale.io>2016-12-04 10:58:06 +0000
committerJohn R Barker <john@johnrbarker.com>2016-12-04 10:58:06 +0000
commit51f09503a7a624de6e28ab2e678192c19f808887 (patch)
treea38a52c3fb986ddb76227c2dd96739cded1ed05f
parent1f61381faeedeb9e705b3de94b4606364a06ab21 (diff)
downloadansible-modules-extras-51f09503a7a624de6e28ab2e678192c19f808887.tar.gz
Native YAML - monitoring/sensu_check (#3635)
-rw-r--r--monitoring/sensu_check.py23
1 files changed, 16 insertions, 7 deletions
diff --git a/monitoring/sensu_check.py b/monitoring/sensu_check.py
index dff8d196..6ded2aae 100644
--- a/monitoring/sensu_check.py
+++ b/monitoring/sensu_check.py
@@ -170,21 +170,30 @@ EXAMPLES = '''
# 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
- sensu_check: name=cpu_load
- command=/etc/sensu/plugins/system/cpu-mpstat-metrics.rb
- metric=yes handlers=relay subscribers=common interval=60
+ 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
- sensu_check: name=nginx_running
- command='/etc/sensu/plugins/processes/check-procs.rb -f /var/run/nginx.pid'
- handlers=default subscribers=nginx interval=60
+ 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
- sensu_check: name=check_disk_capacity state=absent
+ sensu_check:
+ name: check_disk_capacity
+ state: absent
'''
try: