mirror of
https://github.com/FAUSheppy/no-secrets-athq-ansible
synced 2025-12-09 21:48:32 +01:00
inital: hypervisor ansible
This commit is contained in:
28
roles/monitoring-client/tasks/main.yaml
Normal file
28
roles/monitoring-client/tasks/main.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
- name: Install Dependencies
|
||||
apt:
|
||||
name:
|
||||
- python3-nagiosplugin
|
||||
- nagios-plugins-contrib
|
||||
state: present
|
||||
|
||||
- name: Clone Passive Monitoring
|
||||
git:
|
||||
repo: https://github.com/FAUSheppy/icinga-passive-checks-monitoring
|
||||
dest: "/etc/monitoring/"
|
||||
version: master
|
||||
|
||||
- name: Clone Monitoring Tools
|
||||
git:
|
||||
repo: https://github.com/FAUSheppy/monitoring-tools
|
||||
dest: "/etc/monitoring-tools/"
|
||||
version: master
|
||||
|
||||
- name: Check if PostgreSQL is installed
|
||||
command: dpkg -s postgresql
|
||||
register: postgresql_installed
|
||||
ignore_errors: true
|
||||
changed_when: False
|
||||
|
||||
- name: Set has_postgres variable
|
||||
set_fact:
|
||||
has_postgres: "{{ postgresql_installed.rc == 0 }}"
|
||||
11
roles/monitoring-client/templates/monitoring.conf
Normal file
11
roles/monitoring-client/templates/monitoring.conf
Normal file
@@ -0,0 +1,11 @@
|
||||
nobody disk /usr/lib/nagios/plugins/check_disk
|
||||
nobody load /usr/lib/nagios/plugins/check_log
|
||||
nobody systemd /etc/monitoring-tools/pynagsystemd.py
|
||||
|
||||
{% if has_postgres %}
|
||||
nobody load /usr/lib/nagios/plugins/check_psql
|
||||
{% endif }
|
||||
|
||||
{% for entry in checks %}
|
||||
{{ entry["user"] }} {{ entry["name"] }} {{ entry["command"] }}
|
||||
{% endfor %}
|
||||
5
roles/monitoring-client/templates/send_nsca.cfg
Normal file
5
roles/monitoring-client/templates/send_nsca.cfg
Normal file
@@ -0,0 +1,5 @@
|
||||
identity = {{ nsca_identity }}
|
||||
password = {{ nsca_password }}
|
||||
server = {{ nsca_server }}
|
||||
port = {{ nsca_server_port }}
|
||||
tls_ciphers = "PSK-AES256-CBC-SHA"
|
||||
17
roles/monitoring-master/tasks/main.yaml
Normal file
17
roles/monitoring-master/tasks/main.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
- name: Clone Passive Monitoring
|
||||
git:
|
||||
repo: https://github.com/FAUSheppy/icinga-passive-checks-monitoring
|
||||
dest: "/etc/monitoring/"
|
||||
version: master
|
||||
|
||||
- name: Copy nsca-ng and send_nsca to /bin/
|
||||
copy:
|
||||
src: nsca-ng
|
||||
dest: /bin/nsca-ng
|
||||
mode: 0755
|
||||
|
||||
- name: Copy nsca-ng and send_nsca to /bin/
|
||||
copy:
|
||||
src: send_nsca
|
||||
dest: /bin/send_nsca
|
||||
mode: 0755
|
||||
Reference in New Issue
Block a user