# Automation of checks etc

**URL:** <https://discourse.sensu.io/t/automation-of-checks-etc/1743>\
**Category:** Sensu Go\
**Created:** [April 29, 2020, 11:05am UTC](https://discourse.sensu.io/t/automation-of-checks-etc/1743 "2020-04-29T11:05:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ichilton](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/ichilton/32/290_2.png) [@ichilton](https://discourse.sensu.io/u/ichilton)\
**Post date:** [April 29, 2020, 11:05am UTC](https://discourse.sensu.io/t/automation-of-checks-etc/1743/1 "2020-04-29T11:05:53Z")

</div>

Hi!

I setup sensu for some monitoring years ago and it’s been left to rot a little so i’m just starting to look at re-doing it.

Obviously sensu-go has come along in the meantime, which looks good, so i’ve got an install of that to tests with.

I wonder what people are doing with regards to automation and configuration management of sensu checks/config?

What I used to do with the old sensu is all my checks were added by ansible when provisioning hosts. As I provisioned a host, ansible would go to the sensu server and add the appropriate checks (like ping checks for the host, checks on the ports for the applicable services, website checks for web servers, resolving tests for nameservers etc. It did this by dropping the appropriate JSON files in to /etc/sensu/conf.d on the sensu box.

Looking at the new documentation for Sensu Go, the documentation all resolves around the sensuctl command - which is brilliant as a user interface, but not for automation.

I expected to see both interfaces documentation, but the docs don’t seem to give any JSON examples anymore.

Am I missing something? - how are people automating their checks, handlers etc with Sensu Go?

Thanks,

Ian

---

<div class="post-metadata">

**Author:** ![anton\_m](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/anton_m/32/466_2.png) [@anton\_m](https://discourse.sensu.io/u/anton_m)\
**Post date:** [April 29, 2020, 2:18pm UTC](https://discourse.sensu.io/t/automation-of-checks-etc/1743/2 "2020-04-29T14:18:36Z")

</div>

Hi, you should use sensu-go ansible collection for that: [https://github.com/sensu/sensu-go-ansible](https://github.com/sensu/sensu-go-ansible) and  
this are tasks an from ansible playbook which worked for me:  
first you install plugin assets on your backend, but run playbook against agent server, {{url}} is your backend hostname/address, $url is url for asset, you can find it in the asset definition, sorry i’m new to this forum and have limit for number of url’s in a post :

- name: ubuntu ruby-runtime  
asset:  
auth:  
user: admin  
password: P@ssw0rd!  
url: “{{ url }}”  
name: sensu-ruby-runtime-2.4.4-debian  
builds:  
- url: $url  
sha512: a28952fd93fc63db1f8988c7bc40b0ad815eb9f35ef7317d6caf5d77ecfbfd824a9db54184400aa0c81c29b34cb48c7e8c6e3f17891aaf84cafa3c134266a61a  
filters:  
- entity.system.os == ‘linux’  
- entity.system.arch == ‘amd64’  
- entity.system.platform\_family == ‘debian’
  - name: ubuntu ruby-runtime  
asset:  
auth:  
user: admin  
password: P@ssw0rd!  
url: “{{ url }}”  
name: sensu-plugins-disk-checks  
builds:
    - url: $url  
sha512: 3864761b6bff79407173db3b849ffb974dfd521c279f4f7ec251f533c85eb1e400d7f8794bf8d79ca247d8f0b4592225103dfea59b3bfa44d06ef67d0f871b09  
filters:
      - entity.system.os == ‘linux’
      - entity.system.arch == ‘amd64’
      - entity.system.platform\_family == ‘debian’

after you deploy the check itself to the agent server:

- name: Deploy disk usage checks  
check:  
name: check\_disk\_usage\_new\_rb2  
auth:  
user: admin  
password: P@ssw0rd!  
url: “{{ url }}”  
command: check-disk-usage.rb -c 90  
runtime\_assets:  
- sensu-plugins-disk-checks  
- sensu-ruby-runtime-2.4.4-debian  
subscriptions:  
- linux  
interval: 10  
publish: yes

---

<div class="post-metadata">

**Author:** ![ichilton](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/ichilton/32/290_2.png) [@ichilton](https://discourse.sensu.io/u/ichilton)\
**Post date:** [April 29, 2020, 2:43pm UTC](https://discourse.sensu.io/t/automation-of-checks-etc/1743/3 "2020-04-29T14:43:26Z")

</div>

Thanks!

I’m in the process of moving to saltstack now instead of ansible, but i’ll have to have a play.

Ian
