From 1bbbd709bf9708390fbf5c8df3a13942b872b7bf Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Fri, 23 Aug 2013 21:50:25 +0000 Subject: [PATCH] Try and make our nagios setup 32/64 bit happy. Add a bunch of things to arm-releng playbook. --- playbooks/groups/arm-releng.yml | 13 +++++++++++-- roles/nagios_client/tasks/main.yml | 2 +- roles/nagios_client/templates/check_cron.cfg.j2 | 2 +- roles/nagios_client/templates/check_disk.cfg.j2 | 4 ++-- roles/nagios_client/templates/check_lock.cfg.j2 | 2 +- .../templates/check_mirrorlist_cache.cfg.j2 | 2 +- .../templates/check_postfix_queue.cfg.j2 | 2 +- roles/nagios_client/templates/check_raid.cfg.j2 | 2 +- roles/nagios_client/templates/check_swap.cfg.j2 | 2 +- roles/nagios_client/templates/nrpe.cfg.j2 | 10 +++++----- vars/global.yml | 1 + 11 files changed, 26 insertions(+), 16 deletions(-) diff --git a/playbooks/groups/arm-releng.yml b/playbooks/groups/arm-releng.yml index 53841dea22..33c9fe998b 100644 --- a/playbooks/groups/arm-releng.yml +++ b/playbooks/groups/arm-releng.yml @@ -6,15 +6,24 @@ tags: - arm-releng + vars: + libdir: /usr/lib + vars_files: - /srv/web/infra/ansible/vars/global.yml - ${private}/vars.yml roles: - /srv/web/infra/ansible/roles/fas_client + - /srv/web/infra/ansible/roles/rkhunter + - /srv/web/infra/ansible/roles/denyhosts + - /srv/web/infra/ansible/roles/nagios_client tasks: - # This task sets up /etc/hosts for us + # this is how you include other task lists - include: $tasks/hosts.yml - # This task includes our common scripts + - include: $tasks/base.yml + - include: $tasks/2fa_client.yml + - include: $tasks/motd.yml - include: $tasks/common_scripts.yml + - include: $tasks/koji/releng_config.yml diff --git a/roles/nagios_client/tasks/main.yml b/roles/nagios_client/tasks/main.yml index 45021626b7..f1fc8d0d38 100644 --- a/roles/nagios_client/tasks/main.yml +++ b/roles/nagios_client/tasks/main.yml @@ -18,7 +18,7 @@ - packages - name: install local nrpe check scripts that are not packaged - copy: src=scripts/$item dest=/usr/lib64/nagios/plugins/$item mode=0755 owner=nagios group=nagios + copy: src=scripts/$item dest={{ libdir }}/nagios/plugins/$item mode=0755 owner=nagios group=nagios with_items: - check_postfix_queue - check_raid.py diff --git a/roles/nagios_client/templates/check_cron.cfg.j2 b/roles/nagios_client/templates/check_cron.cfg.j2 index e01f40799e..6f5945f4ee 100644 --- a/roles/nagios_client/templates/check_cron.cfg.j2 +++ b/roles/nagios_client/templates/check_cron.cfg.j2 @@ -1 +1 @@ -command[check_cron]=/usr/lib64/nagios/plugins/check_procs -c 1:10 -C 'crond' -u root +command[check_cron]={{ libdir }}/nagios/plugins/check_procs -c 1:10 -C 'crond' -u root diff --git a/roles/nagios_client/templates/check_disk.cfg.j2 b/roles/nagios_client/templates/check_disk.cfg.j2 index d5d32903f2..c20da22c5d 100644 --- a/roles/nagios_client/templates/check_disk.cfg.j2 +++ b/roles/nagios_client/templates/check_disk.cfg.j2 @@ -1,2 +1,2 @@ -command[check_disk_/]=/usr/lib64/nagios/plugins/check_disk -w 15% -c 10% -p / -command[check_disk_/boot]=/usr/lib64/nagios/plugins/check_disk -w 15% -c 10% -p /boot +command[check_disk_/]={{ libdir }}/nagios/plugins/check_disk -w 15% -c 10% -p / +command[check_disk_/boot]={{ libdir }}/nagios/plugins/check_disk -w 15% -c 10% -p /boot diff --git a/roles/nagios_client/templates/check_lock.cfg.j2 b/roles/nagios_client/templates/check_lock.cfg.j2 index 9525f9f391..70015b7652 100644 --- a/roles/nagios_client/templates/check_lock.cfg.j2 +++ b/roles/nagios_client/templates/check_lock.cfg.j2 @@ -1 +1 @@ -command[check_lock]=/usr/lib64/nagios/plugins/check_lock +command[check_lock]={{ libdir }}/nagios/plugins/check_lock diff --git a/roles/nagios_client/templates/check_mirrorlist_cache.cfg.j2 b/roles/nagios_client/templates/check_mirrorlist_cache.cfg.j2 index bd4b171303..94c58be10f 100644 --- a/roles/nagios_client/templates/check_mirrorlist_cache.cfg.j2 +++ b/roles/nagios_client/templates/check_mirrorlist_cache.cfg.j2 @@ -1 +1 @@ -command[check_mirrorlist_cache]=/usr/lib64/nagios/plugins/check_file_age -w 14400 -c 129600 -f /var/lib/mirrormanager/mirrorlist_cache.pkl +command[check_mirrorlist_cache]={{ libdir }}/nagios/plugins/check_file_age -w 14400 -c 129600 -f /var/lib/mirrormanager/mirrorlist_cache.pkl diff --git a/roles/nagios_client/templates/check_postfix_queue.cfg.j2 b/roles/nagios_client/templates/check_postfix_queue.cfg.j2 index 5574698031..9edccc2b46 100644 --- a/roles/nagios_client/templates/check_postfix_queue.cfg.j2 +++ b/roles/nagios_client/templates/check_postfix_queue.cfg.j2 @@ -1 +1 @@ -command[check_postfix_queue]=/usr/lib64/nagios/plugins/check_postfix_queue -w 2 -c 5 +command[check_postfix_queue]={{ libdir }}/nagios/plugins/check_postfix_queue -w 2 -c 5 diff --git a/roles/nagios_client/templates/check_raid.cfg.j2 b/roles/nagios_client/templates/check_raid.cfg.j2 index 5c15d450ce..ef47d12297 100644 --- a/roles/nagios_client/templates/check_raid.cfg.j2 +++ b/roles/nagios_client/templates/check_raid.cfg.j2 @@ -1 +1 @@ -command[check_raid]=/usr/lib64/nagios/plugins/check_raid.py +command[check_raid]={{ libdir }}/nagios/plugins/check_raid.py diff --git a/roles/nagios_client/templates/check_swap.cfg.j2 b/roles/nagios_client/templates/check_swap.cfg.j2 index bc4f19d5d5..68695c9c57 100644 --- a/roles/nagios_client/templates/check_swap.cfg.j2 +++ b/roles/nagios_client/templates/check_swap.cfg.j2 @@ -1 +1 @@ -command[check_swap]=/usr/lib64/nagios/plugins/check_swap -w 15% -c 10% +command[check_swap]={{ libdir }}/nagios/plugins/check_swap -w 15% -c 10% diff --git a/roles/nagios_client/templates/nrpe.cfg.j2 b/roles/nagios_client/templates/nrpe.cfg.j2 index 6933f788b8..be01de1de7 100644 --- a/roles/nagios_client/templates/nrpe.cfg.j2 +++ b/roles/nagios_client/templates/nrpe.cfg.j2 @@ -198,11 +198,11 @@ include_dir=/etc/nrpe.d/ # The following examples use hardcoded command arguments... -command[check_users]=/usr/lib64/nagios/plugins/check_users -w 5 -c 10 -command[check_load]=/usr/lib64/nagios/plugins/check_load -w 15,10,5 -c 30,25,20 -command[check_hda1]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1 -command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z -command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w {{ nrpe_procs_warn }} -c {{ nrpe_procs_crit }} +command[check_users]={{ libdir }}/nagios/plugins/check_users -w 5 -c 10 +command[check_load]={{ libdir }}/nagios/plugins/check_load -w 15,10,5 -c 30,25,20 +command[check_hda1]={{ libdir }}/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1 +command[check_zombie_procs]={{ libdir }}/nagios/plugins/check_procs -w 5 -c 10 -s Z +command[check_total_procs]={{ libdir }}/nagios/plugins/check_procs -w {{ nrpe_procs_warn }} -c {{ nrpe_procs_crit }} # The following examples allow user-supplied arguments and can diff --git a/vars/global.yml b/vars/global.yml index 5767ee7c84..3da58777fa 100644 --- a/vars/global.yml +++ b/vars/global.yml @@ -10,6 +10,7 @@ tasks: /srv/web/infra/ansible/tasks vars: /srv/web/infra/ansible/vars is_fedora: "'$ansible_distribution' == 'Fedora'" is_rhel: "'$ansible_distribution' == 'RedHat'" +libdir: /usr/lib64 dist_tag: unknown auth_keys_from_fas: '/srv/web/infra/ansible/scripts/auth-keys-from-fas' el6_qcow_id: ami-00000013