ansible/playbooks/nrpe.yml

37 lines
1.1 KiB
YAML
Executable File

#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- hosts: tags_nagios-nrpe
roles:
- role: nrpe
vars:
nrpe_server_bind_address: 0.0.0.0
nrpe_server_allowed_hosts:
- 172.23.0.0/16 # Entire Zerotier management network
- 45.79.24.6/32 # web3.desu.ltd
nrpe_plugin_packages:
- monitoring-plugins
- nagios-plugins-contrib
nrpe_command:
check_disk_all:
script: check_disk
option: -M -u GB -A -X tmpfs -X overlay -X shm -w 80% -c 90% -W 80% -K 90% -I '^/run/'
check_load:
script: check_load
option: -r -w 0.8,0.7,0.7 -c 1.0,0.9,0.9
check_swap:
script: check_swap
option: -n ok -w 70% -c 80%
check_users:
script: check_users
option: -w 3 -c 10
tags: [ nrpe ]
- hosts: all
tasks:
- name: disable nrped when not tagged
systemd: name={{ item }} state=stopped enabled=no
with_items:
- nagios-nrpe-server.service
when: "'tags_nagios-nrpe' not in group_names and item in services"
tags: [ zerotier ]