Change a variable that was specific to our environment, and set a default.

This commit is contained in:
Andrea Dell'Amico 2019-02-17 13:49:13 +01:00
parent 7fbcd92023
commit 6303c7c270
9 changed files with 19 additions and 18 deletions

View File

@ -4,10 +4,11 @@ monitoring_group_name: 'change_this_on_your_playbook'
nagios_plugdir: /usr/lib/nagios/plugins nagios_plugdir: /usr/lib/nagios/plugins
nagios_plugins_dir: '{{ nagios_plugdir }}' nagios_plugins_dir: '{{ nagios_plugdir }}'
nagios_local_plugdir: '{{ nagios_plugins_dir }}/local'
nagios_centos_plugins_dir: /usr/lib64/nagios/plugins nagios_centos_plugins_dir: /usr/lib64/nagios/plugins
nagios_common_lib: check_library.sh nagios_common_lib: check_library.sh
# Needed inside nrpe.cfg # Needed inside nrpe.cfg
# It is already defined in isti-global.yml #
#nagios_monitoring_server_ip: #nagios_monitoring_server_ip:
nagios_hw: False nagios_hw: False
nagios_check_disk_w: 10 nagios_check_disk_w: 10

View File

@ -83,7 +83,7 @@
tags: [ 'dell', 'nagios' ] tags: [ 'dell', 'nagios' ]
- name: Install some standalone plugins - name: Install some standalone plugins
copy: src={{ item }} dest={{ nagios_isti_plugdir }}/{{ item }} owner=root group=nagios mode=0750 copy: src={{ item }} dest={{ nagios_local_plugdir }}/{{ item }} owner=root group=nagios mode=0750
with_items: '{{ nagios_dell_standalone_checks }}' with_items: '{{ nagios_dell_standalone_checks }}'
tags: [ 'dell', 'nagios' ] tags: [ 'dell', 'nagios' ]

View File

@ -1,7 +1,7 @@
--- ---
# We do not use the check_linux_raid plugin anymore. Now the check_raid one is much better. # We do not use the check_linux_raid plugin anymore. Now the check_raid one is much better.
- name: Install some plugins that check hardware parts - name: Install some plugins that check hardware parts
copy: src={{ item }} dest={{ nagios_isti_plugdir }}/{{ item }} owner=root group=nagios mode=0750 copy: src={{ item }} dest={{ nagios_local_plugdir }}/{{ item }} owner=root group=nagios mode=0750
with_items: with_items:
- check_smart - check_smart
tags: tags:

View File

@ -10,15 +10,15 @@
tags: [ 'nagios', 'nagios_plug_contrib' ] tags: [ 'nagios', 'nagios_plug_contrib' ]
- name: Create the directory where our local plugins are installed - name: Create the directory where our local plugins are installed
file: path={{ nagios_isti_plugdir }} state=directory file: path={{ nagios_local_plugdir }} state=directory
tags: nagios tags: nagios
- name: Install the generic shell library used by some custom checks - name: Install the generic shell library used by some custom checks
template: src=check_library.sh.j2 dest={{ nagios_isti_plugdir }}/check_library.sh owner=root group=root mode=0644 template: src=check_library.sh.j2 dest={{ nagios_local_plugdir }}/check_library.sh owner=root group=root mode=0644
tags: nagios tags: nagios
- name: Install plugins that can be useful on all the installed servers - name: Install plugins that can be useful on all the installed servers
copy: src={{ item }} dest={{ nagios_isti_plugdir }}/{{ item }} owner=root group=nagios mode=0755 copy: src={{ item }} dest={{ nagios_local_plugdir }}/{{ item }} owner=root group=nagios mode=0755
with_items: with_items:
- check_system_pp - check_system_pp
- show_users - show_users

View File

@ -1,12 +1,12 @@
--- ---
- name: Ensure that the isti local nagios plugins directory exists - name: Ensure that the isti local nagios plugins directory exists
file: dest={{ nagios_isti_plugdir }} owner=root group=root state=directory file: dest={{ nagios_local_plugdir }} owner=root group=root state=directory
tags: tags:
- nrpe - nrpe
- nagios - nagios
- name: Install the postgresql backup nagios check - name: Install the postgresql backup nagios check
copy: src=check_postgresql_backup dest={{ nagios_isti_plugdir }}/check_postgresql_backup owner=root group=root mode=0555 copy: src=check_postgresql_backup dest={{ nagios_local_plugdir }}/check_postgresql_backup owner=root group=root mode=0555
tags: tags:
- nrpe - nrpe
- nagios - nagios

View File

@ -4,7 +4,7 @@ export NAGIOS_WARNING=1
export NAGIOS_CRITICAL=2 export NAGIOS_CRITICAL=2
export NAGIOS_UNKNOWN=3 export NAGIOS_UNKNOWN=3
ISTI_PLUGDIR={{ nagios_isti_plugdir }} ISTI_PLUGDIR={{ nagios_local_plugdir }}
COMMON_LIB={{ nagios_common_lib }} COMMON_LIB={{ nagios_common_lib }}
if [ -d {{ nagios_plugins_dir }} ] ; then if [ -d {{ nagios_plugins_dir }} ] ; then

View File

@ -21,16 +21,16 @@ command[global_check_munin]={{ nagios_plugins_dir }}/check_procs -w 1:1 -c 1:1 -
# Show number and username of the logged users # Show number and username of the logged users
{% if nagios_multiple_allowed_users %} {% if nagios_multiple_allowed_users %}
command[global_show_users]={{ nagios_isti_plugdir }}/show_users -a {% if nagios_multiple_users_allow_root %}root,{% endif %}{% for u in users_system_users %}{{ u.login }}{% if not loop.last %},{% endif %}{% endfor %} command[global_show_users]={{ nagios_local_plugdir }}/show_users -a {% if nagios_multiple_users_allow_root %}root,{% endif %}{% for u in users_system_users %}{{ u.login }}{% if not loop.last %},{% endif %}{% endfor %}
{% else %} {% else %}
command[global_show_users]={{ nagios_isti_plugdir }}/show_users -a {{ nagios_allowed_users }} command[global_show_users]={{ nagios_local_plugdir }}/show_users -a {{ nagios_allowed_users }}
{% endif %} {% endif %}
# Generic script that monitors the existance of a given processes list # Generic script that monitors the existance of a given processes list
command[global_check_system_pp]={{ nagios_isti_plugdir }}/check_system_pp command[global_check_system_pp]={{ nagios_local_plugdir }}/check_system_pp
# Linux RAID check # Linux RAID check
#command[global_check_linux_raid]={{ nagios_isti_plugdir }}/check_linux_raid #command[global_check_linux_raid]={{ nagios_local_plugdir }}/check_linux_raid
{% if nagios_soft_raid_mdstat is defined and nagios_soft_raid_mdstat %} {% if nagios_soft_raid_mdstat is defined and nagios_soft_raid_mdstat %}
command[global_check_linux_raid]={{ nagios_plugins_dir }}/check_raid -p mdstat command[global_check_linux_raid]={{ nagios_plugins_dir }}/check_raid -p mdstat
{% else %} {% else %}
@ -38,11 +38,11 @@ command[global_check_linux_raid]={{ nagios_plugins_dir }}/check_raid
{% endif %} {% endif %}
# Disks S.M.A.R.T. check # Disks S.M.A.R.T. check
command[global_check_smart]={{ nagios_isti_plugdir }}/check_smart -d $ARG1$ -i $ARG2$ command[global_check_smart]={{ nagios_local_plugdir }}/check_smart -d $ARG1$ -i $ARG2$
# Network interfaces # Network interfaces
#command[global_net_interfaces]={{ nagios_isti_plugdir }}/check_netint.pl -K -f -e #command[global_net_interfaces]={{ nagios_local_plugdir }}/check_netint.pl -K -f -e
command[global_net_interfaces]={{ nagios_isti_plugdir }}/check_netint.pl -K -f -e -D -S -n \(l\|eth\|p\|bond\) command[global_net_interfaces]={{ nagios_local_plugdir }}/check_netint.pl -K -f -e -D -S -n \(l\|eth\|p\|bond\)
# Restart ntp (via handler) # Restart ntp (via handler)
command[global_restart_ntp]=/usr/bin/sudo /etc/init.d/ntp start command[global_restart_ntp]=/usr/bin/sudo /etc/init.d/ntp start

View File

@ -1 +1 @@
nagios ALL=(ALL) NOPASSWD: {{ nagios_plugins_dir }}/, {{ nagios_isti_plugdir }}/, {{ nagios_centos_plugins_dir }}/, /etc/init.d/, /usr/sbin/service, /sbin/service nagios ALL=(ALL) NOPASSWD: {{ nagios_plugins_dir }}/, {{ nagios_local_plugdir }}/, {{ nagios_centos_plugins_dir }}/, /etc/init.d/, /usr/sbin/service, /sbin/service

View File

@ -1,5 +1,5 @@
# Check the status of the postgresql local dumps # Check the status of the postgresql local dumps
command[{{ monitoring_group_name }}_check_postgresql_backup]={{ nagios_isti_plugdir }}/check_postgresql_backup command[{{ monitoring_group_name }}_check_postgresql_backup]={{ nagios_local_plugdir }}/check_postgresql_backup
command[{{ monitoring_group_name }}_check_postgresql_connection]=/usr/bin/sudo -u postgres /usr/bin/check_postgres_connection -db template1 command[{{ monitoring_group_name }}_check_postgresql_connection]=/usr/bin/sudo -u postgres /usr/bin/check_postgres_connection -db template1