all checks: assume alerts_wrapper (ie. monitoringctl) is present, which simplifies NRPE checks definition
Some checks failed
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |0|0|0|0|:clap:
gitea/ansible-roles/pipeline/head There was a failure building this commit

This commit is contained in:
Will 2024-11-19 11:19:45 +01:00
parent 0bd59b35de
commit 5299f29fde
18 changed files with 93 additions and 165 deletions

View file

@ -19,6 +19,7 @@ The **patch** part is incremented if multiple releases happen the same month
### Changed
* all checks: assume alerts_wrapper (ie. monitoringctl) is present, which simplifies NRPE checks definition
* autosysadmin-agent: remove restart_nrpe (deployed separately) and add examples
* autosysadmin-agent: upstream release 24.11
* autosysadmin-agent: split tasks files to include install.yml from a playbook

View file

@ -13,5 +13,3 @@ fluentd_heartbeat_type:
apt_keyring_dir: "{{ ansible_distribution_major_version is version('12', '<') | ternary('/etc/apt/trusted.gpg.d', '/etc/apt/keyrings') }}"
monitoringctl_wrapper_path: /usr/local/lib/monitoringctl/alerts_wrapper
fluentd_monitoringctl_wrapper_cmd: ""

View file

@ -72,14 +72,8 @@
tags:
- fluentd
- name: Is alerts_wrapper present?
ansible.builtin.stat:
path: "{{ monitoringctl_wrapper_path }}"
register: alerts_wrapper
- set_fact:
fluentd_monitoringctl_wrapper_cmd: "{{ monitoringctl_wrapper_path }} --name fluentd -- "
when: alerts_wrapper.stat.exists
fluentd_monitoringctl_wrapper_cmd: "/usr/local/lib/monitoringctl/alerts_wrapper --name fluentd -- "
- name: NRPE check is configured
ansible.builtin.lineinfile:

View file

@ -5,5 +5,3 @@ keepalived_priority: "{% if keepalived_role == 'master' %}100{% else %}50{% endi
keepalived_ip: ""
keepalived_password: ""
monitoringctl_wrapper_path: /usr/local/lib/monitoringctl/alerts_wrapper
keepalived_monitoringctl_wrapper_cmd: ""

View file

@ -25,21 +25,13 @@
src: check_keepalived
dest: /usr/local/lib/nagios/plugins/check_keepalived
mode: "0755"
owner: root
group: root
force: true
tags:
- keepalived
- nrpe
- name: Is alerts_wrapper present?
ansible.builtin.stat:
path: "{{ monitoringctl_wrapper_path }}"
register: alerts_wrapper
- set_fact:
keepalived_monitoringctl_wrapper_cmd: "{{ monitoringctl_wrapper_path }} --name keepalived -- "
when: alerts_wrapper.stat.exists
keepalived_monitoringctl_wrapper_cmd: "/usr/local/lib/monitoringctl/alerts_wrapper --name keepalived -- "
- name: Use check_keepalived for NRPE
ansible.builtin.lineinfile:

View file

@ -14,6 +14,3 @@ phpmemcachedadmin_clusters:
]
}
monitoringctl_wrapper_path: /usr/local/lib/monitoringctl/alerts_wrapper
memcached_monitoringctl_wrapper_cmd: ""

View file

@ -27,17 +27,9 @@
dest: /usr/local/lib/nagios/plugins/check_memcached_instances
force: true
mode: "0755"
owner: root
group: root
- name: Is alerts_wrapper present?
ansible.builtin.stat:
path: "{{ monitoringctl_wrapper_path }}"
register: alerts_wrapper
- set_fact:
memcached_monitoringctl_wrapper_cmd: "{{ monitoringctl_wrapper_path }} --name memcached -- "
when: alerts_wrapper.stat.exists
memcached_monitoringctl_wrapper_cmd: "/usr/local/lib/monitoringctl/alerts_wrapper --name memcached -- "
- name: Add NRPE check (single instance)
ansible.builtin.lineinfile:

View file

@ -78,5 +78,3 @@ evomaintenance_hosts: []
nagios_plugins_directory: "/usr/local/lib/nagios/plugins"
monitoringctl_wrapper_path: /usr/local/lib/monitoringctl/alerts_wrapper
minifirewall_monitoringctl_wrapper_cmd: ""

View file

@ -42,14 +42,8 @@
path: /etc/nagios/nrpe.d/evolix.cfg
register: nrpe_evolix_cfg
- name: Is alerts_wrapper present?
ansible.builtin.stat:
path: "{{ monitoringctl_wrapper_path }}"
register: alerts_wrapper
- set_fact:
minifirewall_monitoringctl_wrapper_cmd: "{{ monitoringctl_wrapper_path }} --name minifirewall -- "
when: alerts_wrapper.stat.exists
minifirewall_monitoringctl_wrapper_cmd: "/usr/local/lib/monitoringctl/alerts_wrapper --name minifirewall -- "
- name: check_minifirewall is available for NRPE
ansible.builtin.lineinfile:
@ -57,8 +51,6 @@
regexp: 'command\[check_minifirewall\]'
line: 'command[check_minifirewall]={{ minifirewall_monitoringctl_wrapper_cmd }}sudo {{ nagios_plugins_directory }}/check_minifirewall'
notify: restart nagios-nrpe-server
when:
- alerts_wrapper.stat.exists
- name: Is evolinux sudoers installed?
ansible.builtin.stat:

View file

@ -9,102 +9,102 @@ allowed_hosts={{ nagios_nrpe_allowed_hosts | join(',') }}
# Default activated checks
## System checks
command[check_disk1]=/usr/local/lib/monitoringctl/alerts_wrapper --name disk1 -- /usr/lib/nagios/plugins/check_disk -e -w 10% -c 3% -W 10% -K 3% -C -w 5% -c 2% -W 5% -K 2% -p /home -x /lib/init/rw -x /dev -x /dev/shm -x /run -I '^/run/' -I '^/sys/' -X overlay
command[check_load]=/usr/local/lib/monitoringctl/alerts_wrapper --name load -- /usr/lib/nagios/plugins/check_load --percpu --warning=0.7,0.6,0.5 --critical=0.9,0.8,0.7
command[check_mem]=/usr/local/lib/monitoringctl/alerts_wrapper --name mem -- {{ nagios_plugins_directory }}/check_mem -f -C -w 20 -c 10
command[check_memory]=/usr/local/lib/monitoringctl/alerts_wrapper --name memory -- /usr/lib/nagios/plugins/check_memory --available --warning 20%: --critical 10%:
command[check_pressure_cpu]=/usr/local/lib/monitoringctl/alerts_wrapper --name pressure_cpu -- /usr/lib/nagios/plugins/check_pressure --cpu -w 100000 -c 500000
command[check_pressure_mem]=/usr/local/lib/monitoringctl/alerts_wrapper --name pressure_mem -- /usr/lib/nagios/plugins/check_pressure --mem --full -w 100000 -c 500000
command[check_pressure_io]=/usr/local/lib/monitoringctl/alerts_wrapper --name pressure_io -- /usr/lib/nagios/plugins/check_pressure --io --full -w 100000 -c 500000
command[check_swap]=/usr/local/lib/monitoringctl/alerts_wrapper --name swap -- /usr/lib/nagios/plugins/check_swap -a -w 30% -c 20%
command[check_total_procs]=/usr/local/lib/monitoringctl/alerts_wrapper --name total_procs -- sudo /usr/lib/nagios/plugins/check_procs -w 400 -c 600
command[check_users]=/usr/local/lib/monitoringctl/alerts_wrapper --name users -- /usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_zombie_procs]=/usr/local/lib/monitoringctl/alerts_wrapper --name zombie_procs -- sudo /usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
command[check_disk1]={{ monitoringctl_wrapper_path }} --name disk1 -- /usr/lib/nagios/plugins/check_disk -e -w 10% -c 3% -W 10% -K 3% -C -w 5% -c 2% -W 5% -K 2% -p /home -x /lib/init/rw -x /dev -x /dev/shm -x /run -I '^/run/' -I '^/sys/' -X overlay
command[check_load]={{ monitoringctl_wrapper_path }} --name load -- /usr/lib/nagios/plugins/check_load --percpu --warning=0.7,0.6,0.5 --critical=0.9,0.8,0.7
command[check_mem]={{ monitoringctl_wrapper_path }} --name mem -- {{ nagios_plugins_directory }}/check_mem -f -C -w 20 -c 10
command[check_memory]={{ monitoringctl_wrapper_path }} --name memory -- /usr/lib/nagios/plugins/check_memory --available --warning 20%: --critical 10%:
command[check_pressure_cpu]={{ monitoringctl_wrapper_path }} --name pressure_cpu -- /usr/lib/nagios/plugins/check_pressure --cpu -w 100000 -c 500000
command[check_pressure_mem]={{ monitoringctl_wrapper_path }} --name pressure_mem -- /usr/lib/nagios/plugins/check_pressure --mem --full -w 100000 -c 500000
command[check_pressure_io]={{ monitoringctl_wrapper_path }} --name pressure_io -- /usr/lib/nagios/plugins/check_pressure --io --full -w 100000 -c 500000
command[check_swap]={{ monitoringctl_wrapper_path }} --name swap -- /usr/lib/nagios/plugins/check_swap -a -w 30% -c 20%
command[check_total_procs]={{ monitoringctl_wrapper_path }} --name total_procs -- sudo /usr/lib/nagios/plugins/check_procs -w 400 -c 600
command[check_users]={{ monitoringctl_wrapper_path }} --name users -- /usr/lib/nagios/plugins/check_users -w 5 -c 10
command[check_zombie_procs]={{ monitoringctl_wrapper_path }} --name zombie_procs -- sudo /usr/lib/nagios/plugins/check_procs -w 5 -c 10 -s Z
## Generic services checks
command[check_dns]=/usr/local/lib/monitoringctl/alerts_wrapper --name dns -- /usr/lib/nagios/plugins/check_dns -H evolix.net
command[check_mailq]=/usr/local/lib/monitoringctl/alerts_wrapper --name mailq -- /usr/lib/nagios/plugins/check_mailq -M postfix -w 10 -c 20
command[check_ntp]=/usr/local/lib/monitoringctl/alerts_wrapper --name ntp -- /usr/lib/nagios/plugins/check_ntp -H {{ nagios_nrpe_ntp_server or nagios_nrpe_default_ntp_server | mandatory }}
command[check_process]=/usr/local/lib/monitoringctl/alerts_wrapper --name process -- {{ nagios_plugins_directory }}/check_process {{ nagios_nrpe_processes | join(' ') }}
command[check_smtp]=/usr/local/lib/monitoringctl/alerts_wrapper --name smtp -- /usr/lib/nagios/plugins/check_smtp -H localhost
command[check_ssh]=/usr/local/lib/monitoringctl/alerts_wrapper --name ssh -- /usr/lib/nagios/plugins/check_ssh localhost
command[check_dns]={{ monitoringctl_wrapper_path }} --name dns -- /usr/lib/nagios/plugins/check_dns -H evolix.net
command[check_mailq]={{ monitoringctl_wrapper_path }} --name mailq -- /usr/lib/nagios/plugins/check_mailq -M postfix -w 10 -c 20
command[check_ntp]={{ monitoringctl_wrapper_path }} --name ntp -- /usr/lib/nagios/plugins/check_ntp -H {{ nagios_nrpe_ntp_server or nagios_nrpe_default_ntp_server | mandatory }}
command[check_process]={{ monitoringctl_wrapper_path }} --name process -- {{ nagios_plugins_directory }}/check_process {{ nagios_nrpe_processes | join(' ') }}
command[check_smtp]={{ monitoringctl_wrapper_path }} --name smtp -- /usr/lib/nagios/plugins/check_smtp -H localhost
command[check_ssh]={{ monitoringctl_wrapper_path }} --name ssh -- /usr/lib/nagios/plugins/check_ssh localhost
## Local checks (not packaged)
command[check_minifirewall]=/usr/local/lib/monitoringctl/alerts_wrapper --name minifirewall -- sudo {{ nagios_plugins_directory }}/check_minifirewall
command[check_minifirewall]={{ monitoringctl_wrapper_path }} --name minifirewall -- sudo {{ nagios_plugins_directory }}/check_minifirewall
# Optionnal checks
## Specific services checks
#command[check_pgsql]=/usr/local/lib/monitoringctl/alerts_wrapper --name pgsql -- /usr/lib/nagios/plugins/check_pgsql -H localhost -l nrpe -p '{{ nagios_nrpe_pgsql_passwd }}'
#command[check_mysql]=/usr/local/lib/monitoringctl/alerts_wrapper --name mysql -- /usr/lib/nagios/plugins/check_mysql -H localhost -f ~nagios/.my.cnf
#command[check_mysql_slave]=/usr/local/lib/monitoringctl/alerts_wrapper --name mysql_slave -- /usr/lib/nagios/plugins/check_mysql --check-slave -H localhost -f ~nagios/.my.cnf -w 1800 -c 3600
#command[check_ldap]=/usr/local/lib/monitoringctl/alerts_wrapper --name ldap -- /usr/lib/nagios/plugins/check_ldap -3 --extra-opts=@/etc/nagios/monitoring-plugins.ini
#command[check_ldaps]=/usr/local/lib/monitoringctl/alerts_wrapper --name ldaps -- /usr/lib/nagios/plugins/check_ldap -3 -T --extra-opts=@/etc/nagios/monitoring-plugins.ini
#command[check_imap]=/usr/local/lib/monitoringctl/alerts_wrapper --name imap -- /usr/lib/nagios/plugins/check_imap -H localhost
#command[check_imaps]=/usr/local/lib/monitoringctl/alerts_wrapper --name imaps -- /usr/lib/nagios/plugins/check_imap -S -H localhost -p 993
#command[check_imapproxy]=/usr/local/lib/monitoringctl/alerts_wrapper --name imapproxy -- /usr/lib/nagios/plugins/check_imap -H localhost -p 1143
#command[check_pop]=/usr/local/lib/monitoringctl/alerts_wrapper --name pop -- /usr/lib/nagios/plugins/check_pop -H localhost
#command[check_pops]=/usr/local/lib/monitoringctl/alerts_wrapper --name pops -- /usr/lib/nagios/plugins/check_pop -S -H localhost -p 995
#command[check_ftp]=/usr/local/lib/monitoringctl/alerts_wrapper --name ftp -- /usr/lib/nagios/plugins/check_ftp -H localhost
#command[check_ftp_users]=/usr/local/lib/monitoringctl/alerts_wrapper --name ftp_users -- /usr/local/lib/nagios/plugins/check_ftp_users -w 20 -c 40
#command[check_http]=/usr/local/lib/monitoringctl/alerts_wrapper --name http -- /usr/lib/nagios/plugins/check_http -e 301 -I 127.0.0.1 -H localhost
#command[check_https]=/usr/local/lib/monitoringctl/alerts_wrapper --name https -- /usr/lib/nagios/plugins/check_http -e 401,403 -I 127.0.0.1 -S -p 443 --sni -H ssl.evolix.net
#command[check_bind]=/usr/local/lib/monitoringctl/alerts_wrapper --name bind -- /usr/lib/nagios/plugins/check_dig -l evolix.net -H localhost
#command[check_unbound]=/usr/local/lib/monitoringctl/alerts_wrapper --name unbound -- /usr/lib/nagios/plugins/check_dig -l evolix.net -H localhost
#command[check_smb]=/usr/local/lib/monitoringctl/alerts_wrapper --name smb -- /usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p 445
#command[check_tse]=/usr/local/lib/monitoringctl/alerts_wrapper --name tse -- /usr/lib/nagios/plugins/check_tcp -H TSEADDR -p 3389
#command[check_jboss-http]=/usr/local/lib/monitoringctl/alerts_wrapper --name jboss-http -- /usr/lib/nagios/plugins/check_tcp -p 8080
#command[check_jboss-ajp13]=/usr/local/lib/monitoringctl/alerts_wrapper --name jboss-ajp13 -- /usr/lib/nagios/plugins/check_tcp -p 8009
#command[check_tomcat-http]=/usr/local/lib/monitoringctl/alerts_wrapper --name tomcat-http -- /usr/lib/nagios/plugins/check_tcp -p 8080
#command[check_tomcat-ajp13]=/usr/local/lib/monitoringctl/alerts_wrapper --name tomcat-ajp13 -- /usr/lib/nagios/plugins/check_tcp -p 8009
#command[check_proxy]=/usr/local/lib/monitoringctl/alerts_wrapper --name proxy -- /usr/lib/nagios/plugins/check_http -H {{ nagios_nrpe_check_proxy_host }}
#command[check_redis]=/usr/local/lib/monitoringctl/alerts_wrapper --name redis -- /usr/lib/nagios/plugins/check_tcp -p 6379
#command[check_clamd]=/usr/local/lib/monitoringctl/alerts_wrapper --name clamd -- /usr/lib/nagios/plugins/check_clamd -H /var/run/clamav/clamd.ctl -v
#command[check_clamav_db]=/usr/local/lib/monitoringctl/alerts_wrapper --name clamav_db -- /usr/lib/nagios/plugins/check_file_age -w 86400 -c 172800 -f /var/lib/clamav/daily.cld
#command[check_ssl]=/usr/local/lib/monitoringctl/alerts_wrapper --name 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_elasticsearch]=/usr/local/lib/monitoringctl/alerts_wrapper --name elasticsearch -- /usr/lib/nagios/plugins/check_http -I 127.0.0.1 -u /_cat/health?h=st -p 9200 -r 'red' --invert-regex
#command[check_memcached]=/usr/local/lib/monitoringctl/alerts_wrapper --name memcached -- /usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p 11211
#command[check_opendkim]=/usr/local/lib/monitoringctl/alerts_wrapper --name opendkim -- /usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p 8891
#command[check_bkctld_setup]=/usr/local/lib/monitoringctl/alerts_wrapper --name bkctld_setup -- sudo /usr/sbin/bkctld check-setup
#command[check_bkctld_jails]=/usr/local/lib/monitoringctl/alerts_wrapper --name bkctld_jails -- sudo /usr/sbin/bkctld check-jails
#command[check_pgsql]={{ monitoringctl_wrapper_path }} --name pgsql -- /usr/lib/nagios/plugins/check_pgsql -H localhost -l nrpe -p '{{ nagios_nrpe_pgsql_passwd }}'
#command[check_mysql]={{ monitoringctl_wrapper_path }} --name mysql -- /usr/lib/nagios/plugins/check_mysql -H localhost -f ~nagios/.my.cnf
#command[check_mysql_slave]={{ monitoringctl_wrapper_path }} --name mysql_slave -- /usr/lib/nagios/plugins/check_mysql --check-slave -H localhost -f ~nagios/.my.cnf -w 1800 -c 3600
#command[check_ldap]={{ monitoringctl_wrapper_path }} --name ldap -- /usr/lib/nagios/plugins/check_ldap -3 --extra-opts=@/etc/nagios/monitoring-plugins.ini
#command[check_ldaps]={{ monitoringctl_wrapper_path }} --name ldaps -- /usr/lib/nagios/plugins/check_ldap -3 -T --extra-opts=@/etc/nagios/monitoring-plugins.ini
#command[check_imap]={{ monitoringctl_wrapper_path }} --name imap -- /usr/lib/nagios/plugins/check_imap -H localhost
#command[check_imaps]={{ monitoringctl_wrapper_path }} --name imaps -- /usr/lib/nagios/plugins/check_imap -S -H localhost -p 993
#command[check_imapproxy]={{ monitoringctl_wrapper_path }} --name imapproxy -- /usr/lib/nagios/plugins/check_imap -H localhost -p 1143
#command[check_pop]={{ monitoringctl_wrapper_path }} --name pop -- /usr/lib/nagios/plugins/check_pop -H localhost
#command[check_pops]={{ monitoringctl_wrapper_path }} --name pops -- /usr/lib/nagios/plugins/check_pop -S -H localhost -p 995
#command[check_ftp]={{ monitoringctl_wrapper_path }} --name ftp -- /usr/lib/nagios/plugins/check_ftp -H localhost
#command[check_ftp_users]={{ monitoringctl_wrapper_path }} --name ftp_users -- /usr/local/lib/nagios/plugins/check_ftp_users -w 20 -c 40
#command[check_http]={{ monitoringctl_wrapper_path }} --name http -- /usr/lib/nagios/plugins/check_http -e 301 -I 127.0.0.1 -H localhost
#command[check_https]={{ monitoringctl_wrapper_path }} --name https -- /usr/lib/nagios/plugins/check_http -e 401,403 -I 127.0.0.1 -S -p 443 --sni -H ssl.evolix.net
#command[check_bind]={{ monitoringctl_wrapper_path }} --name bind -- /usr/lib/nagios/plugins/check_dig -l evolix.net -H localhost
#command[check_unbound]={{ monitoringctl_wrapper_path }} --name unbound -- /usr/lib/nagios/plugins/check_dig -l evolix.net -H localhost
#command[check_smb]={{ monitoringctl_wrapper_path }} --name smb -- /usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p 445
#command[check_tse]={{ monitoringctl_wrapper_path }} --name tse -- /usr/lib/nagios/plugins/check_tcp -H TSEADDR -p 3389
#command[check_jboss-http]={{ monitoringctl_wrapper_path }} --name jboss-http -- /usr/lib/nagios/plugins/check_tcp -p 8080
#command[check_jboss-ajp13]={{ monitoringctl_wrapper_path }} --name jboss-ajp13 -- /usr/lib/nagios/plugins/check_tcp -p 8009
#command[check_tomcat-http]={{ monitoringctl_wrapper_path }} --name tomcat-http -- /usr/lib/nagios/plugins/check_tcp -p 8080
#command[check_tomcat-ajp13]={{ monitoringctl_wrapper_path }} --name tomcat-ajp13 -- /usr/lib/nagios/plugins/check_tcp -p 8009
#command[check_proxy]={{ monitoringctl_wrapper_path }} --name proxy -- /usr/lib/nagios/plugins/check_http -H {{ nagios_nrpe_check_proxy_host }}
#command[check_redis]={{ monitoringctl_wrapper_path }} --name redis -- /usr/lib/nagios/plugins/check_tcp -p 6379
#command[check_clamd]={{ monitoringctl_wrapper_path }} --name clamd -- /usr/lib/nagios/plugins/check_clamd -H /var/run/clamav/clamd.ctl -v
#command[check_clamav_db]={{ monitoringctl_wrapper_path }} --name clamav_db -- /usr/lib/nagios/plugins/check_file_age -w 86400 -c 172800 -f /var/lib/clamav/daily.cld
#command[check_ssl]={{ monitoringctl_wrapper_path }} --name 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_elasticsearch]={{ monitoringctl_wrapper_path }} --name elasticsearch -- /usr/lib/nagios/plugins/check_http -I 127.0.0.1 -u /_cat/health?h=st -p 9200 -r 'red' --invert-regex
#command[check_memcached]={{ monitoringctl_wrapper_path }} --name memcached -- /usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p 11211
#command[check_opendkim]={{ monitoringctl_wrapper_path }} --name opendkim -- /usr/lib/nagios/plugins/check_tcp -H 127.0.0.1 -p 8891
#command[check_bkctld_setup]={{ monitoringctl_wrapper_path }} --name bkctld_setup -- sudo /usr/sbin/bkctld check-setup
#command[check_bkctld_jails]={{ monitoringctl_wrapper_path }} --name bkctld_jails -- sudo /usr/sbin/bkctld check-jails
## "check_bkctld" is here as backward compatibility, but is replaced by "check_bkctld_jails"
#command[check_bkctld]=/usr/local/lib/monitoringctl/alerts_wrapper --name bkctld -- sudo /usr/sbin/bkctld check
#command[check_postgrey]=/usr/local/lib/monitoringctl/alerts_wrapper --name postgrey -- /usr/lib/nagios/plugins/check_tcp -p10023
#command[check_influxdb]=/usr/local/lib/monitoringctl/alerts_wrapper --name influxdb -- /usr/lib/nagios/plugins/check_http -I 127.0.0.1 -u /health -p 8086 -r '"status":"pass"'
#command[check_dhcpd]=/usr/local/lib/monitoringctl/alerts_wrapper --name dhcpd -- /usr/lib/nagios/plugins/check_procs -c1:1 -C dhcpd -t 60
#command[check_ipmi_sensors]=/usr/local/lib/monitoringctl/alerts_wrapper --name ipmi_sensors -- sudo /usr/lib/nagios/plugins/check_ipmi_sensor
#command[check_raid_status]=/usr/local/lib/monitoringctl/alerts_wrapper --name raid_status -- /usr/lib/nagios/plugins/check_raid
#command[check_dockerd]=/usr/local/lib/monitoringctl/alerts_wrapper --name dockerd -- /usr/lib/nagios/plugins/check_tcp -H /var/run/docker.sock --escape -s "GET /_ping HTTP/1.1\nHost: http\n\n" -e OK
#command[check_bkctld]={{ monitoringctl_wrapper_path }} --name bkctld -- sudo /usr/sbin/bkctld check
#command[check_postgrey]={{ monitoringctl_wrapper_path }} --name postgrey -- /usr/lib/nagios/plugins/check_tcp -p10023
#command[check_influxdb]={{ monitoringctl_wrapper_path }} --name influxdb -- /usr/lib/nagios/plugins/check_http -I 127.0.0.1 -u /health -p 8086 -r '"status":"pass"'
#command[check_dhcpd]={{ monitoringctl_wrapper_path }} --name dhcpd -- /usr/lib/nagios/plugins/check_procs -c1:1 -C dhcpd -t 60
#command[check_ipmi_sensors]={{ monitoringctl_wrapper_path }} --name ipmi_sensors -- sudo /usr/lib/nagios/plugins/check_ipmi_sensor
#command[check_raid_status]={{ monitoringctl_wrapper_path }} --name raid_status -- /usr/lib/nagios/plugins/check_raid
#command[check_dockerd]={{ monitoringctl_wrapper_path }} --name dockerd -- /usr/lib/nagios/plugins/check_tcp -H /var/run/docker.sock --escape -s "GET /_ping HTTP/1.1\nHost: http\n\n" -e OK
## Local checks (not packaged)
#command[check_amavis]=/usr/local/lib/monitoringctl/alerts_wrapper --name amavis -- {{ nagios_plugins_directory }}/check_amavis --server 127.0.0.1 --from {{ nagios_nrpe_amavis_from }} --to postmaster@localhost --port 10024
#command[check_spamd]=/usr/local/lib/monitoringctl/alerts_wrapper --name spamd -- {{ nagios_plugins_directory }}/check_spamd -H 127.0.0.1
#command[check_nfsclient]=/usr/local/lib/monitoringctl/alerts_wrapper --name nfsclient -- sudo -u www-data {{ nagios_plugins_directory }}/check_nfsclient
#command[check_evobackup]=/usr/local/lib/monitoringctl/alerts_wrapper --name evobackup -- {{ nagios_plugins_directory }}/check_evobackup
#command[check_drbd]=/usr/local/lib/monitoringctl/alerts_wrapper --name drbd -- {{ nagios_plugins_directory }}/check_drbd -d All -c StandAlone
#command[check_mongodb_connect]=/usr/local/lib/monitoringctl/alerts_wrapper --name mongodb_connect -- {{ nagios_plugins_directory }}/check_mongodb -H localhost -P27017 -A connect
#command[check_glusterfs]=/usr/local/lib/monitoringctl/alerts_wrapper --name glusterfs -- {{ nagios_plugins_directory }}/check_glusterfs -v all -n 0
#command[check_supervisord_status]=/usr/local/lib/monitoringctl/alerts_wrapper --name supervisord_status -- sudo {{ nagios_plugins_directory }}/check_supervisord
#command[check_varnish]=/usr/local/lib/monitoringctl/alerts_wrapper --name varnish -- {{ nagios_plugins_directory }}/check_varnish_health -i 127.0.0.1 -p 6082 -s /etc/varnish/secret -w 2 -c 4
#command[check_haproxy]=/usr/local/lib/monitoringctl/alerts_wrapper --name haproxy -- sudo {{ nagios_plugins_directory }}/check_haproxy_stats -s /run/haproxy/admin.sock -w 80 -c 90 --ignore-maint --ignore-nolb --ignore-drain
#command[check_redis_instances]=/usr/local/lib/monitoringctl/alerts_wrapper --name redis_instances -- {{ nagios_plugins_directory }}/check_redis_instances
#command[check_sentinel]=/usr/local/lib/monitoringctl/alerts_wrapper --name sentinel -- sudo {{ nagios_plugins_directory }}/check_sentinel -c /etc/redis/sentinel.conf
#command[check_hpraid]=/usr/local/lib/monitoringctl/alerts_wrapper --name hpraid -- {{ nagios_plugins_directory }}/check_hpraid
#command[check_php-fpm]=/usr/local/lib/monitoringctl/alerts_wrapper --name php-fpm -- {{ nagios_plugins_directory }}/check_phpfpm_multi
#command[check_php-fpm56]=/usr/local/lib/monitoringctl/alerts_wrapper --name php-fpm56 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php56/rootfs/etc/php5/fpm/pool.d/
#command[check_php-fpm70]=/usr/local/lib/monitoringctl/alerts_wrapper --name php-fpm70 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php70/rootfs/etc/php/7.0/fpm/pool.d/
#command[check_php-fpm73]=/usr/local/lib/monitoringctl/alerts_wrapper --name php-fpm73 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php73/rootfs/etc/php/7.3/fpm/pool.d/
#command[check_php-fpm74]=/usr/local/lib/monitoringctl/alerts_wrapper --name php-fpm74 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php74/rootfs/etc/php/7.4/fpm/pool.d/
#command[check_php-fpm80]=/usr/local/lib/monitoringctl/alerts_wrapper --name php-fpm80 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php80/rootfs/etc/php/8.0/fpm/pool.d/
#command[check_php-fpm81]=/usr/local/lib/monitoringctl/alerts_wrapper --name php-fpm81 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php81/rootfs/etc/php/8.1/fpm/pool.d/
#command[check_php-fpm82]=/usr/local/lib/monitoringctl/alerts_wrapper --name php-fpm82 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php82/rootfs/etc/php/8.2/fpm/pool.d/
#command[check_php-fpm83]=/usr/local/lib/monitoringctl/alerts_wrapper --name php-fpm83 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php83/rootfs/etc/php/8.3/fpm/pool.d/
#command[check_php-fpm84]=/usr/local/lib/monitoringctl/alerts_wrapper --name php-fpm84 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php84/rootfs/etc/php/8.4/fpm/pool.d/
#command[check_dhcp_pool]=/usr/local/lib/monitoringctl/alerts_wrapper --name dhcp_pool -- {{ nagios_plugins_directory }}/check_dhcp_pool
#command[check_ssl_local]=/usr/local/lib/monitoringctl/alerts_wrapper --name ssl_local -- {{ nagios_plugins_directory }}/check_ssl_local
#command[check_amavis]={{ monitoringctl_wrapper_path }} --name amavis -- {{ nagios_plugins_directory }}/check_amavis --server 127.0.0.1 --from {{ nagios_nrpe_amavis_from }} --to postmaster@localhost --port 10024
#command[check_spamd]={{ monitoringctl_wrapper_path }} --name spamd -- {{ nagios_plugins_directory }}/check_spamd -H 127.0.0.1
#command[check_nfsclient]={{ monitoringctl_wrapper_path }} --name nfsclient -- sudo -u www-data {{ nagios_plugins_directory }}/check_nfsclient
#command[check_evobackup]={{ monitoringctl_wrapper_path }} --name evobackup -- {{ nagios_plugins_directory }}/check_evobackup
#command[check_drbd]={{ monitoringctl_wrapper_path }} --name drbd -- {{ nagios_plugins_directory }}/check_drbd -d All -c StandAlone
#command[check_mongodb_connect]={{ monitoringctl_wrapper_path }} --name mongodb_connect -- {{ nagios_plugins_directory }}/check_mongodb -H localhost -P27017 -A connect
#command[check_glusterfs]={{ monitoringctl_wrapper_path }} --name glusterfs -- {{ nagios_plugins_directory }}/check_glusterfs -v all -n 0
#command[check_supervisord_status]={{ monitoringctl_wrapper_path }} --name supervisord_status -- sudo {{ nagios_plugins_directory }}/check_supervisord
#command[check_varnish]={{ monitoringctl_wrapper_path }} --name varnish -- {{ nagios_plugins_directory }}/check_varnish_health -i 127.0.0.1 -p 6082 -s /etc/varnish/secret -w 2 -c 4
#command[check_haproxy]={{ monitoringctl_wrapper_path }} --name haproxy -- sudo {{ nagios_plugins_directory }}/check_haproxy_stats -s /run/haproxy/admin.sock -w 80 -c 90 --ignore-maint --ignore-nolb --ignore-drain
#command[check_redis_instances]={{ monitoringctl_wrapper_path }} --name redis_instances -- {{ nagios_plugins_directory }}/check_redis_instances
#command[check_sentinel]={{ monitoringctl_wrapper_path }} --name sentinel -- sudo {{ nagios_plugins_directory }}/check_sentinel -c /etc/redis/sentinel.conf
#command[check_hpraid]={{ monitoringctl_wrapper_path }} --name hpraid -- {{ nagios_plugins_directory }}/check_hpraid
#command[check_php-fpm]={{ monitoringctl_wrapper_path }} --name php-fpm -- {{ nagios_plugins_directory }}/check_phpfpm_multi
#command[check_php-fpm56]={{ monitoringctl_wrapper_path }} --name php-fpm56 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php56/rootfs/etc/php5/fpm/pool.d/
#command[check_php-fpm70]={{ monitoringctl_wrapper_path }} --name php-fpm70 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php70/rootfs/etc/php/7.0/fpm/pool.d/
#command[check_php-fpm73]={{ monitoringctl_wrapper_path }} --name php-fpm73 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php73/rootfs/etc/php/7.3/fpm/pool.d/
#command[check_php-fpm74]={{ monitoringctl_wrapper_path }} --name php-fpm74 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php74/rootfs/etc/php/7.4/fpm/pool.d/
#command[check_php-fpm80]={{ monitoringctl_wrapper_path }} --name php-fpm80 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php80/rootfs/etc/php/8.0/fpm/pool.d/
#command[check_php-fpm81]={{ monitoringctl_wrapper_path }} --name php-fpm81 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php81/rootfs/etc/php/8.1/fpm/pool.d/
#command[check_php-fpm82]={{ monitoringctl_wrapper_path }} --name php-fpm82 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php82/rootfs/etc/php/8.2/fpm/pool.d/
#command[check_php-fpm83]={{ monitoringctl_wrapper_path }} --name php-fpm83 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php83/rootfs/etc/php/8.3/fpm/pool.d/
#command[check_php-fpm84]={{ monitoringctl_wrapper_path }} --name php-fpm84 -- sudo {{ nagios_plugins_directory }}/check_phpfpm_multi /var/lib/lxc/php84/rootfs/etc/php/8.4/fpm/pool.d/
#command[check_dhcp_pool]={{ monitoringctl_wrapper_path }} --name dhcp_pool -- {{ nagios_plugins_directory }}/check_dhcp_pool
#command[check_ssl_local]={{ monitoringctl_wrapper_path }} --name ssl_local -- {{ nagios_plugins_directory }}/check_ssl_local
# Check HTTP "many". Use this to check many websites (http, https, ports, sockets and SSL certificates).
# Beware! All checks must not take more than 10s!
#command[check_https]=/usr/local/lib/monitoringctl/alerts_wrapper --name https -- {{ nagios_plugins_directory }}/check_http_many
#command[check_https]={{ monitoringctl_wrapper_path }} --name https -- {{ nagios_plugins_directory }}/check_http_many

View file

@ -4,6 +4,3 @@
openvpn_lan: "10.{{ ansible_default_ipv4.address | regex_search('([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})', '\\3', '\\4') | join('.') }}.0"
openvpn_netmask: "255.255.255.0"
openvpn_netmask_cidr: "{{ (openvpn_lan + '/' + openvpn_netmask) | ipaddr('prefix') }}"
monitoringctl_wrapper_path: /usr/local/lib/monitoringctl/alerts_wrapper
openvpn_monitoringctl_wrapper_cmd: ""

View file

@ -197,14 +197,8 @@
group: nagios
when: nrpe_evolix_config.stat.exists
- name: Is alerts_wrapper present?
ansible.builtin.stat:
path: "{{ monitoringctl_wrapper_path }}"
register: alerts_wrapper
- set_fact:
openvpn_monitoringctl_wrapper_cmd: "{{ monitoringctl_wrapper_path }} --name openvpn -- "
when: alerts_wrapper.stat.exists
openvpn_monitoringctl_wrapper_cmd: "/usr/local/lib/monitoringctl/alerts_wrapper --name openvpn -- "
- name: Configure NRPE OpenVPN check
ansible.builtin.lineinfile:
@ -240,7 +234,7 @@
when: nrpe_evolix_config.stat.exists
- set_fact:
openvpn_monitoringctl_wrapper_cmd: "{{ monitoringctl_wrapper_path }} --name openvpn_certificates -- "
openvpn_monitoringctl_wrapper_cmd: "/usr/local/lib/monitoringctl/alerts_wrapper --name openvpn_certificates -- "
when: alerts_wrapper.stat.exists
- name: Configure NRPE certificates check

View file

@ -23,6 +23,3 @@ locales_default: fr_FR.UTF-8
postgresql_install_postgis: False
apt_keyring_dir: "{{ ansible_distribution_major_version is version('12', '<') | ternary('/etc/apt/trusted.gpg.d', '/etc/apt/keyrings') }}"
monitoringctl_wrapper_path: /usr/local/lib/monitoringctl/alerts_wrapper
postgresql_monitoringctl_wrapper_cmd: ""

View file

@ -39,14 +39,8 @@
register: postgresql_create_nrpe_user
when: nrpe_evolix_config.stat.exists
- name: Is alerts_wrapper present?
ansible.builtin.stat:
path: "{{ monitoringctl_wrapper_path }}"
register: alerts_wrapper
- set_fact:
postgresql_monitoringctl_wrapper_cmd: "{{ monitoringctl_wrapper_path }} --name postgresql -- "
when: alerts_wrapper.stat.exists
postgresql_monitoringctl_wrapper_cmd: "/usr/local/lib/monitoringctl/alerts_wrapper --name postgresql -- "
- name: Add NRPE check
ansible.builtin.lineinfile:

View file

@ -3,5 +3,3 @@
rabbitmq_connections_critical: 200
rabbitmq_connections_warning: 150
monitoringctl_wrapper_path: /usr/local/lib/monitoringctl/alerts_wrapper
rabbitmq_monitoringctl_wrapper_cmd: ""

View file

@ -36,14 +36,8 @@
force: true
when: ansible_distribution_major_version is version('11', '>=')
- name: Is alerts_wrapper present?
ansible.builtin.stat:
path: "{{ monitoringctl_wrapper_path }}"
register: alerts_wrapper
- set_fact:
rabbitmq_monitoringctl_wrapper_cmd: "{{ monitoringctl_wrapper_path }} --name rab_connection_count -- "
when: alerts_wrapper.stat.exists
rabbitmq_monitoringctl_wrapper_cmd: "/usr/local/lib/monitoringctl/alerts_wrapper --name rab_connection_count -- "
- name: check_rabbitmq is available for NRPE
ansible.builtin.lineinfile:

View file

@ -71,5 +71,3 @@ redis_sysctl_transparent_hugepage_enabled: Null
general_alert_email: "root@localhost"
log2mail_alert_email: Null
monitoringctl_wrapper_path: /usr/local/lib/monitoringctl/alerts_wrapper
redis_monitoringctl_wrapper_cmd: ""

View file

@ -56,14 +56,8 @@
- redis
- nrpe
- name: Is alerts_wrapper present?
ansible.builtin.stat:
path: "{{ monitoringctl_wrapper_path }}"
register: alerts_wrapper
- set_fact:
redis_monitoringctl_wrapper_cmd: "{{ monitoringctl_wrapper_path }} --name redis -- "
when: alerts_wrapper.stat.exists
redis_monitoringctl_wrapper_cmd: "/usr/local/lib/monitoringctl/alerts_wrapper --name redis -- "
- name: Use check_redis for NRPE
ansible.builtin.replace: