nagios-nrpe: add heck_domains
This commit is contained in:
parent
d165a104f2
commit
f74b6f394b
|
@ -12,3 +12,9 @@ Everything is in the `tasks/main.yml` file.
|
|||
* `nagios_nrpe_force_update_allowed_hosts` : force update list of allowed hosts (default: `False`)
|
||||
|
||||
The full list of variables (with default values) can be found in `defaults/main.yml`.
|
||||
|
||||
## Available tags
|
||||
|
||||
* `nagios-nrpe` : install Nagios and plugins (idempotent)
|
||||
* `nagios-plugins` : install only plugins (idempotent)
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/bash
|
||||
#
|
||||
# Check domains using script inspect-domains.
|
||||
#
|
||||
# Written by Will
|
||||
#
|
||||
|
||||
if ! command -v inspect-domains >/dev/null; then
|
||||
echo 'UNKNOWN - Missing dependency inspect-domains.'
|
||||
exit 3
|
||||
fi
|
||||
|
||||
inspect-domains -o nrpe -a check-dns
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
- name: Install check_domains dependency
|
||||
include_role:
|
||||
name: inspect-domains
|
||||
|
||||
- name: Configure check_domains in /etc/nagios/nrpe.d/evolix.cfg
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/nagios/nrpe.d/evolix.cfg
|
||||
regexp: '^command\[check_domains\]='
|
||||
line: command[check_domains]=sudo {{ nagios_plugins_directory }}/check_domains
|
||||
notify: restart nagios-nrpe-server
|
||||
|
||||
- name: Is evolinux sudoers installed?
|
||||
ansible.builtin.stat:
|
||||
path: /etc/sudoers.d/evolinux
|
||||
register: sudoers_evolinux
|
||||
|
||||
- name: Allow nagios user to execute check_domains without sudo password
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/sudoers.d/evolinux
|
||||
regexp: 'check_domains'
|
||||
line: 'nagios ALL = NOPASSWD: {{ nagios_plugins_directory }}/check_domains'
|
||||
insertafter: '^nagios'
|
||||
validate: "visudo -cf %s"
|
||||
when: sudoers_evolinux.stat.exists
|
||||
|
|
@ -22,6 +22,7 @@
|
|||
- ansible_distribution == "Debian"
|
||||
- ansible_distribution_major_version is version('10', '>=')
|
||||
tags:
|
||||
- nagios-nrpe
|
||||
- nagios-plugins
|
||||
|
||||
- name: custom configuration is present
|
||||
|
|
|
@ -47,6 +47,7 @@ command[check_proxy]=/usr/lib/nagios/plugins/check_http -H {{ nagios_nrpe_check_
|
|||
command[check_redis]=/usr/lib/nagios/plugins/check_tcp -p 6379
|
||||
command[check_clamd]=/usr/lib/nagios/plugins/check_clamd -H /var/run/clamav/clamd.ctl -v
|
||||
command[check_clamav_db]=/usr/lib/nagios/plugins/check_file_age -w 86400 -c 172800 -f /var/lib/clamav/evolix.ndb
|
||||
command[check_domains]=sudo {{ nagios_plugins_directory }}/check_domains
|
||||
command[check_ssl]=/usr/lib/nagios/plugins/check_http -f follow -I 127.0.0.1 -S -p 443 -H ssl.evolix.net -C 15,5
|
||||
command[check_ssl_local]={{ nagios_plugins_directory }}/check_ssl_local
|
||||
command[check_elasticsearch]=/usr/lib/nagios/plugins/check_http -I 127.0.0.1 -u /_cat/health?h=st -p 9200 -r 'red' --invert-regex
|
||||
|
|
Loading…
Reference in New Issue