ansible/playbooks/nrpe.yml

40 lines
1.2 KiB
YAML
Raw Normal View History

2021-08-15 14:24:35 -05:00
#!/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:
2021-08-15 15:18:52 -05:00
- 127.0.0.0/24 # Local machines
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
2021-08-15 14:24:35 -05:00
- 45.79.24.6/32 # web3.desu.ltd
nrpe_plugin_packages:
- monitoring-plugins
- nagios-plugins-contrib
nrpe_command:
check_disk_all:
script: check_disk
2021-08-15 15:18:52 -05:00
option: -M -u GB -X nfs -X tracefs -X cgroup -X tmpfs -X overlay -X shm -w 20% -c 10% -W 20% -K 10% -A -I '^/run/' -I '^udev$' -I '^/var/lib/kubelet/'
2021-08-15 14:24:35 -05:00
check_load:
script: check_load
2021-08-15 15:18:52 -05:00
option: -r -w 0.8,0.8,0.8 -c 1.0,0.9,0.9
2021-08-15 14:24:35 -05:00
check_swap:
script: check_swap
option: -w 20% -c 10%
2021-08-15 14:24:35 -05:00
check_users:
script: check_users
2021-08-15 15:21:46 -05:00
option: -w 3 -c 5
2021-08-15 14:24:35 -05:00
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 ]