Commit 9d461ecf authored by Paschalis Korosoglou's avatar Paschalis Korosoglou

Merge pull request #66 from dpavlos/nagios_config

ARGO-389 Ansible configs for central nagios
parents b1fe6e53 3f8f883d
......@@ -5,5 +5,6 @@
roles:
- { role: firewall, tags: firewall }
- { role: repos, tags: repos }
- { role: ca_bundle, when: ca_bundle_install, tags: ca_bundle }
- { role: has_certificate, tags: certificate }
- { role: monitoring_engine, tags: monitoring_engine }
......@@ -2,27 +2,43 @@
nagios_components:
- { name: argo-ncg , repo: argo-prod }
- { name: argo-msg-nagios , repo: argo-prod }
## NCG vars ##
nagios_server: localhost
probes_type: local
nagios_admin_email: contact@nagiosadmin.localhost
vo: ops
enable_unicore_probes: "0"
metric_config_file: /etc/ncg-metric-config.d/local.conf
gocdb_root_url: https://goc.egi.eu/gocdbpi
cert_status: Production
nagios_role: PROJECT
probes_type: local
gocdb_root_url: https://localhost/gocdbpi
cert_status: Certified
contact_type: roc
nagios_role: project
include_empty_hosts: "0"
enable_notifications: "0"
local_metric_store: "0"
check_hosts: "0"
tenant_name: TENANT_A
poem_root_url: http://localhost/poem
include_proxy_checks: "0"
include_msg_checks_recv: "0"
ocsp_command: handle_service_check
backup_instance: "false"
## CGI vars ##
authorized_for_all_service_commands:
- /C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=SomeCN_1
- /C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=SomeCN_2
authorized_for_all_host_commands:
- /C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=SomeCN_1
- /C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit/CN=SomeCN_2
## Nagios.cfg vars ##
host_perfdata_file_processing_command: ncg-process-host-perfdata-file
service_perfdata_file_processing_command: ncg-process-service-perfdata-file
obsess_over_services: "1"
ocsp_command: handle_service_check
use_large_installation_tweaks: "1"
enable_environment_macros: "1"
backup_instance: "false"
allow_empty_hostgroup_assignment: "1"
cfg_dir: /etc/nagios/argo-ncg.d
use_syslog: "0"
log_initial_states: "1"
......@@ -30,9 +46,8 @@ log_external_commands: "0"
log_passive_checks: "0"
service_check_timeout: 910
process_performance_data: "1"
host_perfdata_file_template: "DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$"
service_perfdata_file_template: "DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$"
host_perfdata_file_processing_command: ncg-process-host-perfdata-file
service_perfdata_file_processing_command: ncg-process-service-perfdata-file
use_large_installation_tweaks: "1"
allow_empty_hostgroup_assignment: "1"
\ No newline at end of file
## Other vars
ca_bundle_install: false
---
- name: reload nagios
service: name=nagios state=reloaded
- name: reload httpd
service: name=httpd state=reloaded
......@@ -3,9 +3,19 @@
- name: Install Nagios
yum: name=nagios state=latest enablerepo=nagios
- name: Install Apache
yum: name=httpd state=latest
- name: Install pnp4nagios
yum: name=pnp4nagios state=latest
- name: Install Apache and mod_ssl
yum: name={{ item }} state=latest
with_items:
- httpd
- mod_ssl
- name: Install fetch-crl
yum: name=fetch-crl state=latest
when: ca_bundle_install
- name: Install NCG and MSG conponents
yum: name={{ item.name }} state=latest enablerepo={{ item.repo }}
with_items: nagios_components
......@@ -15,7 +25,7 @@
with_items: nagios_plugins
- name: Install Nagios UMD plugins
yum: name={{ item.name }} state=latest
yum: name={{ item }} state=latest
with_items: nagios_plugins_umd
when: nagios_plugins_umd is defined
......@@ -23,16 +33,91 @@
template: src=nagios.cfg.j2
dest=/etc/nagios/nagios.cfg
owner=nagios group=nagios mode=0644
notify: reload nagios
- name: Copy cgi.cfg file
template: src=cgi.cfg.j2
dest=/etc/nagios/cgi.cfg
owner=nagios group=nagios mode=0644
notify: reload nagios
- name: Copy ncg.conf file
#FIXME: Make this tenant unaware
- name: Copy ncg.conf file for EGI
template: src=ncg.conf.j2
dest=/etc/argo-ncg/ncg.conf
owner=root group=root
when: tenant_name == "EGI"
notify: reload nagios
- name: Copy ncg.conf file for EUDAT
template: src=ncg.conf.eudat.j2
dest=/etc/ncg/ncg.conf
owner=root group=root
when: tenant_name == "EUDAT"
notify: reload nagios
- name: Copy argo-voms-htpasswd.conf file
template: src=argo-voms-htpasswd.conf.j2
dest=/etc/argo-voms-htpasswd/argo-voms-htpasswd.conf
owner=root group=root
when: voms_htpasswd is defined
#FIXME: Temp workaround for tenants without BDII infrastructure.
- name: Copy broker-list file
template: src=broker-list.j2
dest=/var/cache/msg/broker-cache-file/broker-list
owner=root group=root mode=0644
when: broker_host is defined
##
- name: Copy argo-msg-cache file
template: src=argo-msg-cache.conf.j2
dest=/etc/argo-msg-cache.conf
owner=root group=root
when: lcg_gfal_infosys is defined and broker_network is defined
- name: Create vomses dir
- file: path=/etc/vomses
state=directory
owner=root group=root mode=0755
when: vomses is defined
- name: Copy vomses files
template: src=vomses.j2
dest=/etc/vomses/{{ item.name }}
owner=root group=root mode=0644
when: vomses is defined
with_items: vomses
- name: Create voms lsc dir
- file: path=/etc/grid-security/vomsdir/{{ item.vo }}
state=directory
owner=root group=root mode=0755
when: vomses is defined
with_items: vomses
- name: Create voms lsc files
- template: src=voms_lsc.j2
dest=/etc/grid-security/vomsdir/{{ item.vo }}/{{ item.server }}.lsc
owner=root group=root mode=0644
when: vomses is defined
with_items: vomses
- name: Create sha checksum for dashboard config
shell: echo -n {{ nagios_server }} | sha1sum | cut -f1 -d' '
register: sha
- name: Create dashboard config for msg-to-handler
template: src=dashboard.conf.j2
dest=/etc/msg-to-handler.d/DASHBOARD.conf
owner=root group=root mode=0644
when: send_to_dashboard is defined and send_to_dashboard == "1"
- name: Create apel config for msg-to-handler
template: src=apel.conf.j2
dest=/etc/msg-to-handler.d/APEL.conf
owner=root group=root mode=0644
when: send_to_apel is defined and send_to_apel == "1"
- name: Enable nagios and httpd on boot and start service
service: name={{ item }} state=started enabled=yes
......@@ -40,3 +125,19 @@
- nagios
- httpd
- name: Start fetch-crl cron
service: name=fetch-crl-cron state=started enabled=yes
when: ca_bundle_install
- name: Start fetch-crl boot
service: name=fetch-crl-boot state=started enabled=no
when: ca_bundle_install
ignore_errors: yes
- name: Enable argo-voms-htpasswd on boot and start service
service: name=argo-voms-htpasswd state=started enabled=yes
when: voms_htpasswd is defined
- name: Enable argo-msg-cache on boot and start service
service: name=argo-msg-cache state=started enabled=yes
when: lcg_gfal_infosys is defined
\ No newline at end of file
<handler APEL>
class = GridMon::MsgHandler::MetricOutput
<instance>
SOURCE = local
CACHE_DIR = /var/spool/argo-msg-nagios/incoming
</instance>
<subscribe>
destination = "/queue/Consumer.{{ nagios_role }}_{{ nagios_server|replace(".","_") }}.grid.accounting.test.apel.*"
</subscribe>
</handler>
# Configuration file for argo-msg-cache.
# Maintaining the Broker Cache File requires the end point of the information
# system.
# We support a ',' delimited list as lcg-utils does.
# LCG_GFAL_INFOSYS=bdii.example.org:2170
LCG_GFAL_INFOSYS={% for bdii in lcg_gfal_infosys %}{{ bdii }}{% if not loop.last %},{% endif %}{% endfor %}
# BROKER_NETWORK=PROD
BROKER_NETWORK={{ broker_network }}
\ No newline at end of file
{% for url in voms_htpasswd %}
{{ url }}
{% endfor %}
\ No newline at end of file
{% if broker_host is defined %}
stomp://{{ broker_host }}:6163
{% endif %}
\ No newline at end of file
stomp://{{ broker_host }}:6163
\ No newline at end of file
This diff is collapsed.
<handler Dashboard>
class = GridMon::MsgHandler::DashboardInput
<subscribe>
destination = /topic/nagios.probe.notification.ack.{{ sha.stdout }}
</subscribe>
</handler>
......@@ -846,8 +846,10 @@ process_performance_data={{ process_performance_data }}
#host_perfdata_file_template=[HOSTPERFDATA]\t$TIMET$\t$HOSTNAME$\t$HOSTEXECUTIONTIME$\t$HOSTOUTPUT$\t$HOSTPERFDATA$
#service_perfdata_file_template=[SERVICEPERFDATA]\t$TIMET$\t$HOSTNAME$\t$SERVICEDESC$\t$SERVICEEXECUTIONTIME$\t$SERVICELATENCY$\t$SERVICEOUTPUT$\t$SERVICEPERFDATA$
host_perfdata_file_template={{ host_perfdata_file_template }}
service_perfdata_file_template={{ service_perfdata_file_template }}
host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
# HOST AND SERVICE PERFORMANCE DATA FILE MODES
......
# Configuration uses Apache-like format
# as defined by Perl module Config::General.
# For further details see:
# http://search.cpan.org/dist/Config-General/
# Global variables which can be used in module
# configuration (e.g. LDAP_ADDRESS=$BDII).
# Variables in curly brackets are environment
# variables.
NAGIOS_SERVER = {{ nagios_server }}
PROBES_TYPE={{ probes_type }}
NAGIOS_ADMIN = {{ nagios_admin_email }}
VO = {{ vo }}
ENABLE_UNICORE_PROBES={{ enable_unicore_probes }}
BACKUP_INSTANCE = {{ backup_instance }}
<NCG::SiteSet>
<GOCDB>
GOCDB_ROOT_URL={{ gocdb_root_url }}
CERT_STATUS={{ cert_status }}
</GOCDB>
</NCG::SiteSet>
<NCG::SiteInfo>
<GOCDB>
GOCDB_ROOT_URL={{ gocdb_root_url }}
</GOCDB>
</NCG::SiteInfo>
<NCG::ConfigGen>
<Nagios>
TEMPLATES_DIR = /usr/share/grid-monitoring/config-gen/nagios
OUTPUT_DIR = /etc/nagios/wlcg.d
NAGIOS_ROLE = {{ nagios_role }}
INCLUDE_EMPTY_HOSTS = {{ include_empty_hosts }}
ENABLE_NOTIFICATIONS = {{ enable_notifications }}
CHECK_HOSTS = {{ check_hosts }}
TENANT = {{ tenant_name }}
</Nagios>
</NCG::ConfigGen>
<NCG::LocalMetrics>
<POEM>
POEM_ROOT_URL = {{ poem_root_url }}
</POEM>
<File>
DB_FILE=/etc/ncg/ncg.localdb
</File>
</NCG::LocalMetrics>
<NCG::LocalMetricsAttrs>
<Active>
GOCDB_ROOT_URL={{ gocdb_root_url }}
ENABLE_UNICORE_PROBES=$ENABLE_UNICORE_PROBES
INCLUDE_PROXY_CHECKS = {{ include_proxy_checks }}
INCLUDE_MSG_CHECKS_RECV = {{ include_msg_checks_recv }}
</Active>
<File>
DB_FILE=/etc/ncg/ncg.localdb
</File>
</NCG::LocalMetricsAttrs>
include ncg.conf.d/*.conf
......@@ -9,58 +9,90 @@
# variables.
NAGIOS_SERVER = {{ nagios_server }}
PROBES_TYPE= {{ probes_type }}
NAGIOS_ADMIN = {{ nagios_admin_email }}
VO = {{ vo }}
ENABLE_UNICORE_PROBES= {{ enable_unicore_probes }}
METRIC_CONFIG_FILE = {{ metric_config_file }}
MYPROXY_SERVER = {{ myproxy_server }}
BACKUP_INSTANCE = {{ backup_instance }}
<NCG::SiteSet>
<GOCDB>
GOCDB_ROOT_URL={{ gocdb_root_url }}
CERT_STATUS={{ cert_status }}
ENABLE_UNICORE_PROBES=$ENABLE_UNICORE_PROBES
</GOCDB>
<File>
DB_FILE=/etc/argo-ncg/ncg.localdb
DB_DIRECTORY=/etc/argo-ncg/ncg-localdb.d
</File>
</NCG::SiteSet>
<NCG::SiteContacts>
<GOCDB>
GOCDB_ROOT_URL={{ gocdb_root_url }}
</GOCDB>
<GOCDB>
CONTACT_TYPE=alarm
GOCDB_ROOT_URL={{ gocdb_root_url }}
</GOCDB>
<GOCDB>
CONTACT_TYPE={{ contact_type }}
GOCDB_ROOT_URL={{ gocdb_root_url }}
</GOCDB>
<File>
DB_FILE=/etc/argo-ncg/ncg.localdb
DB_DIRECTORY=/etc/argo-ncg/ncg-localdb.d
</File>
</NCG::SiteContacts>
<NCG::SiteInfo>
<GOCDB>
GOCDB_ROOT_URL={{ gocdb_root_url }}
</GOCDB>
<File>
DB_FILE=/etc/argo-ncg/ncg.localdb
DB_DIRECTORY=/etc/argo-ncg/ncg-localdb.d
</File>
</NCG::SiteInfo>
<NCG::LocalMetricsAttrs>
<Active>
GOCDB_ROOT_URL={{ gocdb_root_url }}
ENABLE_UNICORE_PROBES=$ENABLE_UNICORE_PROBES
BDII_HOST={{ bdii_host }}
INCLUDE_PROXY_CHECKS = {{ include_proxy_checks }}
LOCAL_METRIC_STORE = {{ local_metric_store }}
</Active>
<LDAP>
LDAP_ADDRESS={{ bdii_host }}
</LDAP>
<File>
DB_FILE=/etc/argo-ncg/ncg.localdb
DB_DIRECTORY=/etc/argo-ncg/ncg-localdb.d
</File>
</NCG::LocalMetricsAttrs>
<NCG::ConfigGen>
<Nagios>
TEMPLATES_DIR = /usr/share/grid-monitoring/config-gen/nagios
OUTPUT_DIR = /etc/nagios/wlcg.d
NRPE_OUTPUT_DIR = /etc/nagios/nrpe/
NAGIOS_ROLE = {{ nagios_role }}
INCLUDE_EMPTY_HOSTS = {{ include_empty_hosts }}
ENABLE_NOTIFICATIONS = {{ enable_notifications }}
SEND_TO_DASHBOARD = {{ send_to_dashboard }}
CHECK_HOSTS = {{ check_hosts }}
TENANT = {{ tenant_name }}
</Nagios>
</NCG::ConfigGen>
<NCG::LocalMetrics>
<File>
DB_FILE=/etc/argo-ncg/ncg.localdb
DB_DIRECTORY=/etc/argo-ncg/ncg-localdb.d
</File>
<POEM>
POEM_ROOT_URL = {{ poem_root_url }}
POEM_PROFILES = {% for poem in poem_profiles %}{{ poem }}{% if not loop.last %},{% endif %}{% endfor %}
</POEM>
<File>
DB_FILE=/etc/ncg/ncg.localdb
</File>
</NCG::LocalMetrics>
<NCG::LocalMetricsAttrs>
<Active>
GOCDB_ROOT_URL={{ gocdb_root_url }}
ENABLE_UNICORE_PROBES=$ENABLE_UNICORE_PROBES
INCLUDE_PROXY_CHECKS = {{ include_proxy_checks }}
INCLUDE_MSG_CHECKS_RECV = {{ include_msg_checks_recv }}
</Active>
<File>
DB_FILE=/etc/ncg/ncg.localdb
</File>
</NCG::LocalMetricsAttrs>
include ncg.conf.d/*.conf
{{ item.dn }}
{{ item.issuer }}
\ No newline at end of file
"{{ item.vo }}" "{{ item.server }}" "{{ item.port }}" "{{ item.dn }}" "{{ item.vo }}" "24"
\ No newline at end of file
......@@ -42,5 +42,6 @@
- name: Install UMD repo
tags: umd_repo
shell: yum install http://repository.egi.eu/sw/production/umd/3/sl6/x86_64/updates/umd-release-3.0.1-1.el6.noarch.rpm
yum: name=http://repository.egi.eu/sw/production/umd/3/sl6/x86_64/updates/umd-release-3.0.1-1.el6.noarch.rpm
state=present
when: inventory_hostname in groups.monitoring_engine and nagios_plugins_umd is defined
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment