joshbenner.sensu
Sensu
This role installs and sets up the Sensu core (community version).
Role Variables
Here are the variables you can use. For default values, check defaults/main.yml
.
Variable | Description |
---|---|
sensu_install_repo |
If you want to install a custom Debian repository. |
sensu_debian_repo_key_url |
URL for the Debian repository GPG key. |
sensu_debian_repo_url |
URL of the Debian repository to use. |
sensu_redhat_repo_url |
URL of the RedHat repository to use. |
sensu_state |
Whether Sensu should be installed (present) or not (absent). |
sensu_version |
Specify the version of Sensu to install. |
sensu_user |
The user for Sensu. |
sensu_group |
The group for Sensu. |
sensu_config_file |
Path to the main Sensu configuration file. |
sensu_config_dir |
Path to the directory with additional Sensu configurations. |
sensu_enable_server |
If the server should be running. |
sensu_enable_api |
If the API should be running. |
sensu_enable_client |
If the client should be running. |
sensu_config |
Main configuration settings. Override specific options here. |
sensu_transport_name |
The transport Sensu should use (rabbitmq or redis ). |
sensu_rabbitmq_config |
Configuration settings for RabbitMQ. |
sensu_redis_config |
Configuration settings for Redis. |
sensu_api_config |
Configuration settings for the API. |
sensu_client_config |
Configuration settings for the client. |
sensu_pin_version |
If you want to lock a specific version (depends on sensu_version ). |
sensu_install_yum_versionlock |
If to install the YUM versionlock plugin. Necessary when pinning. |
Merged Configurations
This role combines variables with certain endings to create configurations for checks from multiple places without needing Ansible to merge them.
For example, if you have variables in group_vars/all
:
base_sensu_checks:
check_memory:
command: check-memory-percent.rb -w 70 -c 80
interval: 60
standalone: true
check_swap:
command: check-swap-percent.rb -w 50 -c 80
interval: 60
standalone: true
And in group_vars/rabbit-servers
:
rabbitmq_sensu_checks:
check_rabbitmq_alive:
command: check-rabbitmq-amqp-alive.rb
interval: 60
standalone: true
Then on a server in the rabbit-servers
group, the checks will be combined to look like this:
sensu_checks:
check_memory:
command: check-memory-percent.rb -w 70 -c 80
interval: 60
standalone: true
check_swap:
command: check-swap-percent.rb -w 50 -c 80
interval: 60
standalone: true
check_rabbitmq_alive:
command: check-rabbitmq-amqp-alive.rb
interval: 60
standalone: true
The following endings are merged for Sensu configurations:
_sensu_checks
- Definitions for Sensu checks_sensu_handlers
- Definitions for Sensu handlers_sensu_filters
- Definitions for Sensu filters_sensu_mutators
- Definitions for Sensu mutators_sensu_plugins
- Sensu plugins to install, listed by name or detailed object:some_prefix__sensu_plugins: - name: pagerduty version: 3.0.1
_sensu_plugin_dependencies
_sensu_extensions
- Extensions and their versions to install:some_prefix__sensu_extensions: some-extension: 1.2.3 other-extension: absent
Example Playbook
- hosts: all
become: yes
roles:
- role: joshbenner.rabbitmq
- role: DavidWittman.redis
- role: joshbenner.sensu
sensu_enable_server: yes
sensu_enable_api: yes
my_sensu_plugins:
- cpu-checks
- memory-checks
- network-checks
- rabbitmq
- redis
my_sensu_checks:
check_cpu:
command: check-cpu.rb -w 80 -c 95
interval: 60
standalone: true
check_memory:
command: check-memory-percent.rb -w 70 -c 80
interval: 60
standalone: true
check_swap:
command: check-swap-percent.rb -w 50 -c 80
interval: 60
standalone: true
check_route:
command: check-ping.rb -h {{ ansible_default_ipv4.gateway }} -W 90 -C 50
interval: 60
standalone: true
check_rabbitmq_alive:
command: check-rabbitmq-amqp-alive.rb
interval: 60
standalone: true
check_redis_alive:
command: check-redis-ping.rb
interval: 60
standalone: true
License
BSD
ansible-galaxy install joshbenner.sensu