feat: extend monitoring master config

This commit is contained in:
2022-12-28 19:17:06 +01:00
parent 6a0b9ee9da
commit a79d8b1c6f
2 changed files with 219 additions and 2 deletions

View File

@@ -0,0 +1,182 @@
object CheckCommand "gateway" {
command = [ "/etc/icinga2/icinga-webhook-gateway/icinga-gateway-command.py" ]
arguments = {
"--protocol" = "$protocol$",
"--host" = "$host$",
"--port" = "$port$",
"--service" = "$service_name$"
}
}
object Host "THS" {
import "generic-host"
address = "localhost"
name = "THS"
vars.async = "true"
vars.linux = "true"
vars.ssl_address = "async-icinga.atlantishq.de"
vars.ssl_port = "443"
check_command = "http"
max_check_attempts = 5
retry_interval = 1m
vars.notification["mail"] = {
groups = ["icingaadmins"]
}
}
object Host "atlantispc" {
import "generic-host"
address = "localhost"
name = "atlantispc"
vars.async = "true"
vars.linux = "true"
vars.ssl_address = "async-icinga.atlantishq.de"
vars.ssl_port = "443"
check_command = "http"
max_check_attempts = 5
retry_interval = 1m
vars.notification["mail"] = {
groups = ["icingaadmins"]
}
}
object Host "atlantislaptop" {
import "generic-host"
address = "localhost"
name = "atlantislaptop"
vars.async = "true"
vars.linux = "true"
vars.ssl_address = "async-icinga.atlantishq.de"
vars.ssl_port = "443"
check_command = "http"
max_check_attempts = 5
retry_interval = 1m
vars.notification["mail"] = {
groups = ["icingaadmins"]
}
}
object Host "kathi" {
import "generic-host"
address = "localhost"
name = "kathi"
vars.async = "true"
vars.linux = "true"
vars.ssl_address = "async-icinga.atlantishq.de"
vars.ssl_port = "443"
check_command = "http"
max_check_attempts = 5
retry_interval = 1m
#vars.notification["mail"] = {
# groups = ["icingaadmins"]
#}
}
apply Service "backup_kathi_laptop" {
import "generic-service"
check_command = "gateway"
vars.protocol = "https"
vars.host = "async-icinga.athq.de"
vars.service_name = "backup_kathi_laptop"
assign where host.name == "kathi"
}
apply Service "apt_atlantis_laptop" {
import "generic-service"
check_command = "gateway"
vars.protocol = "https"
vars.host = "async-icinga.athq.de"
vars.service_name = "apt_atlantis_laptop"
assign where host.name == "atlantislaptop"
}
apply Service "apt_atlantis_pc" {
import "generic-service"
check_command = "gateway"
vars.protocol = "https"
vars.host = "async-icinga.athq.de"
vars.service_name = "apt_atlantis_pc"
assign where host.name == "atlantispc"
}
apply Service "backup_atlantis_laptop" {
import "generic-service"
check_command = "gateway"
vars.protocol = "https"
vars.host = "async-icinga.athq.de"
vars.service_name = "backup_atlantis_laptop"
assign where host.name == "atlantispc"
}
apply Service "backup_atlantishq" {
import "generic-service"
check_command = "gateway"
vars.protocol = "https"
vars.host = "async-icinga.athq.de"
vars.service_name = "backup_atlantishq"
assign where host.name == "atlantispc"
}
apply Service "backup_ths_server" {
import "generic-service"
check_command = "gateway"
vars.protocol = "https"
vars.host = "async-icinga.athq.de"
vars.service_name = "backup_ths_server"
assign where host.name == "atlantispc"
}
apply Service "backup_ths_offline_storrage_box" {
import "generic-service"
check_command = "gateway"
vars.protocol = "https"
vars.host = "async-icinga.athq.de"
vars.service_name = "backup_ths_offline_storrage_box"
assign where host.name == "atlantispc"
}
apply Service "backup_ths" {
import "generic-service"
check_command = "gateway"
vars.protocol = "https"
vars.host = "async-icinga.athq.de"
vars.service_name = "backup_ths"
assign where host.name == "THS"
}
apply Service "ths_auftragsdatenbank" {
import "generic-service"
check_command = "gateway"
vars.protocol = "https"
vars.host = "async-icinga.athq.de"
vars.service_name = "ths_auftragsdatenbank"
assign where host.name == "THS"
}

View File

@@ -1,9 +1,34 @@
- name: Install Dependecies
apt:
name: git
state: present
- name: Clone Passive Monitoring - name: Clone Passive Monitoring
git: git:
repo: https://github.com/FAUSheppy/icinga-passive-checks-monitoring repo: https://github.com/FAUSheppy/icinga-passive-checks-monitoring
dest: "/etc/monitoring/" dest: "/etc/monitoring/"
version: master version: master
- name: Clone Monitoring tools
git:
repo: https://github.com/FAUSheppy/monitoring-tools
dest: "/etc/monitoring-tools/"
version: master
- name: Set monitoring tools permissions
file:
dest: /etc/monitoring-tools/
owner: root
mode: u=rwX,g=rX,o=rX
recurse: yes
- name: Set monitoring permissions
file:
dest: /etc/monitoring/
owner: root
mode: u=rwX,g=rX,o=rX
recurse: yes
- name: Copy nsca-ng and send_nsca to /bin/ - name: Copy nsca-ng and send_nsca to /bin/
copy: copy:
src: nsca-ng src: nsca-ng
@@ -16,10 +41,20 @@
dest: /bin/send_nsca dest: /bin/send_nsca
mode: 0755 mode: 0755
- name: Copy icinga hosts conf - name: Copy icinga configuration
copy: copy:
src: icinga_master_hosts.conf src: "{{ item }}"
dest: /etc/icinga2/conf.d/ dest: /etc/icinga2/conf.d/
owner: root owner: root
group: nagios group: nagios
mode: 0640 mode: 0640
with_items:
- icinga_master_hosts.conf
- services_passive.conf
- services_passive_mail_extern.conf
- services_async.conf
- name: Signal command loaded from monitoring tools
lineinfile:
path: /etc/icinga2/icinga2.conf
line: "include monitoring-tools/commands.d/signal-notify.conf"