add a service to a hostgroup
i have a couple of Debian 9 "Server/Host/Client" they all should have some Basic Service Check like (apt, disk, mem, swap, procs, users, running_kernel, apt, ssh, iostat, ping4, fping4, tcp, udp, ssl, ntp_time)
because i don't want to add this check to each host i did define a hostgroup and add the hostgroupname to the host (--> "define Hostgroup & add Host to a Hostgroup")
Merci to rsx (Roland)
steps i have done... | icinga2 Master | |||
went to the zone.d | # cd /etc/icinga2/zones.d/ | |||
crate a new directory | # mkdir services | |||
went to the new directory | # cd /services or # cd /etc/icinga2/zones.d/services |
|||
open a new file | # vi service2debian9.conf | |||
to check apt on all defined Debian 9 "Host/Server/Client" | apply Service "apt" { import "generic-service" check_command = "apt" assign where host.address && host.vars.os == "debian9" command_endpoint = host_name } |
|||
to Check swap | apply Service "swap" { import "generic-service" check_command = "swap" assign where host.address && host.vars.os == "debian9" command_endpoint = host_name } |
|||
Check it if it for error | # icinga2 daemon -C | |||
if ok | # systemctl restart icinga2 |
---
Sometimes all would be perfect but a Service is on a Host not needed or not available. so you will get a error. to avoid the error - just ignore the host like this |
32 apply Service "swap" { 33 import "generic-service" 34 check_command = "swap" 35 36 assign where host.address && host.vars.os == "debian9" 37 ignore where host.name == "memoryalpha.kozo.ch" 38 command_endpoint = host_name 39 } |
|||
# icinga2 daemon -C | ||||
# systemctl restart icinga2 |
---
Quellen/Source:
- 05-service-monitoring/#general-monitoring
- have a look and for my test
-
-
-
-
-
- 00 Digi-Bee übersicht
- 02 Digi-Bee Stand01 Gewicht
- 01 Digi-Bee Stand01 Wetter
- 04 Digi-Bee Stand02 Gewicht
- 03 Digi-Bee Stand02 Wetter
- SparkFun LoRa Gateway - 1-Channel (ESP32) | WRL-15006
- Solar - TTGO - LORA
- 2 Stück LILYGO® TTGO LORA32 868 Mhz ESP32 LoRa OLED 0,96 Zoll Blaues Display Bluetooth WIFI ESP-32 Entwicklungsboard Modul Mit Antenne
- Budget Solar Set 2W mit Laderegler für Lipo Akku
- SparkFun LiPo Battery Manager - Battery Babysitter
- ESP8266 Universal Raw e-Paper Driver Board WiFi
- Batterie Shield 5V 3A / 3V 1A (2 x 18650 Lithium)
- linux scripts
- Chip Sensoren List
- 4-ch Current/Voltage/Power Monitor HAT for Raspberry Pi, I2C/SMBus
- Raspberry | Raspberry Pi Zero W - Full Kit
- telegraf influxdb grafana on raspberrypi from scratch
- load wifi-credentials file with
- Luxxus Starter Pack - 3 bulbs - Model NCL302E27
- Raspberry | Raspberry Pi 4 Model B 4GB RAM
- Raspberry | Raspberry Pi 4 Model B 4GB RAM
- Raspberry | Raspberry Pi 4 Model B 4GB RAM | IoT05
- my IoT zoo - Software part
- Phoscon deConz - Raspbee II, ZigBee-Aufsatzmodul für Raspberry Pi
- Audio-Technica | AT-LP120XUSB - Plattenspieler