nagios-nrpe: Make check_process configurable

This commit is contained in:
Brice Waegeneire 2023-09-05 17:52:31 +02:00
parent ac70793ad6
commit 682fac14b2
3 changed files with 9 additions and 2 deletions

View File

@ -6,6 +6,7 @@ nagios_nrpe_pgsql_passwd: PGSQL_PASSWD
nagios_nrpe_amavis_from: "foobar@{{ ansible_domain }}"
nagios_nrpe_default_ntp_server: "pool.ntp.org"
nagios_nrpe_ntp_server: Null
nagios_nrpe_process_processes: [ cron rsyslogd ntpd munin-node ]
nagios_nrpe_force_update_allowed_hosts: False

View File

@ -1,7 +1,13 @@
#!/bin/bash
rc=0
for proc in cron rsyslogd ntpd munin-node; do
if [ $# -gt 0 ]; then
procs=$@
else
# We keep this old list to be retro compatible
procs="cron rsyslogd ntpd munin-node"
fi
for proc in $procs ; do
sudo /usr/lib/nagios//plugins/check_procs -C $proc -c 1:
rc=$(($rc|$?))
done

View File

@ -66,7 +66,7 @@ command[check_amavis]={{ nagios_plugins_directory }}/check_amavis --server 127.0
command[check_spamd]={{ nagios_plugins_directory }}/check_spamd -H 127.0.0.1
command[check_nfsclient]=sudo -u www-data {{ nagios_plugins_directory }}/check_nfsclient
command[check_evobackup]={{ nagios_plugins_directory }}/check_evobackup
command[check_process]={{ nagios_plugins_directory }}/check_process
command[check_process]={{ nagios_plugins_directory }}/check_process {{ nagios_nrpe_process_processes | join(' ') }}
command[check_drbd]={{ nagios_plugins_directory }}/check_drbd -d All -c StandAlone
command[check_mongodb_connect]={{ nagios_plugins_directory }}/check_mongodb -H localhost -P27017 -A connect
command[check_glusterfs]={{ nagios_plugins_directory }}/check_glusterfs -v all -n 0