mirror of
https://github.com/FAUSheppy/no-secrets-athq-ansible
synced 2025-12-06 20:11:37 +01:00
inital: hypervisor ansible
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.swp
|
||||||
63
files/COPYING_NSCA_NG
Normal file
63
files/COPYING_NSCA_NG
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
https://github.com/weiss/nsca-ng/blob/master/COPYING
|
||||||
|
|
||||||
|
Unless otherwise noted, all files distributed as part of NSCA-ng are covered
|
||||||
|
by the copyright and license statement below. Some files (outside the `src'
|
||||||
|
directory) are subject to different copyright and/or license terms, as
|
||||||
|
specified at the top of those files. However, all NSCA-ng code is believed
|
||||||
|
to be covered by terms which are at least as permissive as the following
|
||||||
|
license.
|
||||||
|
|
||||||
|
| Copyright (c) 2013 Holger Weiss <holger@weiss.in-berlin.de>
|
||||||
|
| All rights reserved.
|
||||||
|
|
|
||||||
|
| Redistribution and use in source and binary forms, with or without
|
||||||
|
| modification, are permitted provided that the following conditions are
|
||||||
|
| met:
|
||||||
|
|
|
||||||
|
| 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
| this list of conditions and the following disclaimer.
|
||||||
|
|
|
||||||
|
| 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
| notice, this list of conditions and the following disclaimer in the
|
||||||
|
| documentation and/or other materials provided with the distribution.
|
||||||
|
|
|
||||||
|
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||||
|
| IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
| THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
| PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||||
|
| CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
| EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
| PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||||
|
| PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||||
|
| LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
| NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
| SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
In addition to these copyright and license terms, binary redistributions may
|
||||||
|
be required to reproduce the following copyright notices, depending on which
|
||||||
|
source files are compiled. The above license statement applies to all of
|
||||||
|
them.
|
||||||
|
|
||||||
|
If any files in the `lib/ev' directory are used during compilation:
|
||||||
|
|
||||||
|
| Copyright (c) 2007-2018 Marc Alexander Lehmann <libev@schmorp.de>
|
||||||
|
| Copyright (c) 2011 Emanuele Giaquinta
|
||||||
|
|
||||||
|
If any files in the `lib/pidfile' directory are used during compilation:
|
||||||
|
|
||||||
|
| Copyright (c) 2005 Pawel Jakub Dawidek <pjd@FreeBSD.org>
|
||||||
|
| Copyright (c) 2007 Dag-Erling Coidan Smoergrav
|
||||||
|
|
||||||
|
If the file `lib/pidfile/flock.c' is used during compilation:
|
||||||
|
|
||||||
|
| Copyright (c) 2001 The NetBSD Foundation, Inc.
|
||||||
|
|
||||||
|
If any files in the `python' directory (except for `uthash.h') are used:
|
||||||
|
|
||||||
|
| Copyright (c) 2014 Alexander Golovko
|
||||||
|
|
||||||
|
If any files in the `perl' directory are used:
|
||||||
|
|
||||||
|
| Copyright (c) 2015 Matthias Bethke
|
||||||
|
|
||||||
|
Additional requirements may be imposed by external libraries.
|
||||||
BIN
files/nsca-ng
Executable file
BIN
files/nsca-ng
Executable file
Binary file not shown.
BIN
files/send_nsca
Executable file
BIN
files/send_nsca
Executable file
Binary file not shown.
3
host_vars/irc.yaml
Normal file
3
host_vars/irc.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
checks :
|
||||||
|
- { user : sheppy, name : irc, cmd : ""}
|
||||||
3
host_vars/mail.yaml
Normal file
3
host_vars/mail.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
checks :
|
||||||
|
- { user : nobody, name : mail_queue, cmd : ""}
|
||||||
3
host_vars/ths.yaml
Normal file
3
host_vars/ths.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
checks :
|
||||||
|
- { user : sheppy, name : irc, cmd : ""}
|
||||||
4
host_vars/vpn.yaml
Normal file
4
host_vars/vpn.yaml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
checks :
|
||||||
|
- { user : nobody, name : wireguard_rudi, cmd : ""}
|
||||||
|
- { user : nobody, name : wireguard_hase, cmd : ""}
|
||||||
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