Add more generic checks

- introduce host template linux-host to define vars.os
- sort service definitions alphabetically
- replace assign where true with assign where host.name == NodeName
- add load, ping4, ping6, ssh and users checks
- add http checks for hosts with vars.http_vhosts
- define basic vars.http_vhosts for master (beholder.cacert.org)
main
Jan Dittberner 9 months ago
parent 87ceb9bd4b
commit d436094797

@ -16,9 +16,15 @@ template Host "generic-host" {
check_command = "hostalive"
}
template Host "debian-host" {
template Host "linux-host" {
import "generic-host"
vars.os = "Linux"
}
template Host "debian-host" {
import "linux-host"
vars.osfamily = "Debian"
vars.procs = {

@ -12,12 +12,54 @@ apply Service "apt" {
assign where host.vars.osfamily == "Debian"
}
apply Service "disk " for (disk => config in host.vars.disks) {
import "generic-service"
check_command = "disk"
vars += config
assign where host.vars.disks
}
apply Service (http_vhost => config in host.vars.http_vhosts) {
import "generic-service"
check_command = "http"
vars += config
}
apply Service "icinga" {
import "generic-service"
check_command = "icinga"
assign where true
assign where host.name == NodeName
}
apply Service "load" {
import "generic-service"
check_command = "load"
assign where host.name == NodeName
}
apply Service "ping4" {
import "generic-service"
check_command = "ping4"
assign where host.address
}
apply Service "ping6" {
import "generic-service"
check_command = "ping6"
assign where host.address6
}
apply Service "procs" {
@ -25,7 +67,7 @@ apply Service "procs" {
check_command = "procs"
assign where true
assign where host.name == NodeName
}
apply Service "proc-" for (proc => config in host.vars.procs) {
@ -38,12 +80,18 @@ apply Service "proc-" for (proc => config in host.vars.procs) {
assign where host.vars.disks
}
apply Service "disk " for (disk => config in host.vars.disks) {
apply Service "ssh" {
import "generic-service"
check_command = "disk"
check_command = "ssh"
vars += config
assign where (host.address || host.address6) && host.vars.os == "Linux" && !host.vars.no_check_ssh
}
assign where host.vars.disks
apply Service "users" {
import "generic-service"
check_command = "users"
assign where host.name == NodeName
}

@ -13,4 +13,9 @@ object Host "beholder" {
vars.disks["/boot/efi"] = {
disk_partitions = "/boot/efi"
}
vars.http_vhosts["http redirect"] = {
http_uri = "/"
http_headerstring = "Location: https://beholder.cacert.org/"
}
}

Loading…
Cancel
Save