diff --git a/group_vars/monitoring_engine b/group_vars/monitoring_engine new file mode 100644 index 0000000000000000000000000000000000000000..4523ea7c764e751296d8fdc9be997684b417fd56 --- /dev/null +++ b/group_vars/monitoring_engine @@ -0,0 +1,8 @@ +--- +cert_path: /etc/pki/tls/certs/localhost.crt +key_path: /etc/pki/tls/private/localhost.key + +iptables_rules: + input: + - { dport: "80", proto: "tcp", policy: "accept"} + - { dport: "443", proto: "tcp", policy: "accept"} diff --git a/inventory b/inventory index e1c402a91aea2b0a5b3149adfd3f2fd8c5d07e43..70a9fc3226b892c8e6765cc35fb5422e5ee0cab2 100644 --- a/inventory +++ b/inventory @@ -9,4 +9,7 @@ standalone.node poem.node [webui] -webui.node \ No newline at end of file +webui.node + +[monitoring_engine] +monitoring_engine.node \ No newline at end of file diff --git a/monitoring_engine.yml b/monitoring_engine.yml new file mode 100644 index 0000000000000000000000000000000000000000..3e86e0bdcd51f4647e1751b64ce4b5ff7057e1bb --- /dev/null +++ b/monitoring_engine.yml @@ -0,0 +1,9 @@ +--- + +- hosts: monitoring_engine + user: root + roles: + - { role: firewall, tags: firewall } + - { role: repos, tags: repos } + - { role: has_certificate, tags: certificate } + - { role: monitoring_engine, tags: monitoring_engine } diff --git a/roles/monitoring_engine/defaults/main.yml b/roles/monitoring_engine/defaults/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..1f14d38ba0aece16c239494d8177b718fb9d885c --- /dev/null +++ b/roles/monitoring_engine/defaults/main.yml @@ -0,0 +1,21 @@ + +nagios_components: + - { name: argo-ncg , repo: argo-prod } + - { name: argo-msg-nagios , repo: argo-prod } + +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 +include_empty_hosts: "0" +enable_notifications: "0" +check_hosts: "0" +tenant: TENANT_A +poem_root_url: http://localhost/poem +include_proxy_checks: "0" +include_msg_checks_recv: "0" \ No newline at end of file diff --git a/roles/monitoring_engine/tasks/main.yml b/roles/monitoring_engine/tasks/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..36a3c38a9cfb35d72d503ae69fa3ee3b3c1698b9 --- /dev/null +++ b/roles/monitoring_engine/tasks/main.yml @@ -0,0 +1,8 @@ +--- + +- name: Install Nagios + yum: name=nagios-4.0.8-1.el6.srce.x86_64.rpm state=present enablerepo=nagios + +- name: Install NCG and MSG conponents + yum: name={{ item.name }} state=latest enablerepo={{ item.repo }} + with_items: nagios_components \ No newline at end of file diff --git a/roles/monitoring_engine/templates/ncg.conf.j2 b/roles/monitoring_engine/templates/ncg.conf.j2 new file mode 100644 index 0000000000000000000000000000000000000000..0cee8401e3849c03c8ff2fe643e77fd7f9efe245 --- /dev/null +++ b/roles/monitoring_engine/templates/ncg.conf.j2 @@ -0,0 +1,65 @@ +# 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 }} +METRIC_CONFIG_FILE = {{ metric_config_file }} + + + + GOCDB_ROOT_URL={{ gocdb_root_url }} + CERT_STATUS={{ cert_status }} + + + + + GOCDB_ROOT_URL={{ gocdb_root_url }} + + + + + + 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 }} + CHECK_HOSTS = {{ check_hosts }} + TENANT = {{ tenant }} + + + + + + POEM_ROOT_URL = {{ poem_root_url }} + + + DB_FILE=/etc/ncg/ncg.localdb + + + + + + 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 }} + + + DB_FILE=/etc/ncg/ncg.localdb + + + +include ncg.conf.d/*.conf + diff --git a/roles/repos/files/etc/yum.repos.d/nagios.repo b/roles/repos/files/etc/yum.repos.d/nagios.repo new file mode 100644 index 0000000000000000000000000000000000000000..63d643cb46857e0987f3c2d7da15a8b955022531 --- /dev/null +++ b/roles/repos/files/etc/yum.repos.d/nagios.repo @@ -0,0 +1,5 @@ +[nagios] +name=Nagios Repository +baseurl=http://ftp.srce.hr/srce-redhat/base/el6/$basearch +enabled=0 +gpgcheck=0 \ No newline at end of file diff --git a/roles/repos/tasks/main.yml b/roles/repos/tasks/main.yml index cc246279404b6fb2f0da592fdfd2d581cafcb3fe..810764902a6b833ca6b9f3964b0f9a1d49b9f570 100644 --- a/roles/repos/tasks/main.yml +++ b/roles/repos/tasks/main.yml @@ -32,3 +32,10 @@ dest=/etc/yum.repos.d/cloudera-cdh5.repo backup=no owner=root group=root mode=0644 when: inventory_hostname in groups.standalone + +- name: Install Nagios repo + tags: monitoring_engine_repo + copy: src=etc/yum.repos.d/nagios.repo + dest=/etc/yum.repos.d/nagios.repo backup=no + owner=root group=root mode=0644 + when: inventory_hostname in groups.monitoring_engine \ No newline at end of file