140 lines
2.6 KiB
Plaintext
140 lines
2.6 KiB
Plaintext
template Host "proxmox-host" {
|
|
import "generic-host"
|
|
|
|
vars.pve_host = name
|
|
vars.pve_node = name.split(".")[0]
|
|
// ... or if not matching the fqdn (nodename.domain.example)
|
|
// vars.pve_node = "proxmox-host"
|
|
|
|
// if your icinga host don't trust your pve certificate, you'll have to uncomment this line
|
|
// vars.pve_insecure_connection = true
|
|
vars.pve_user = "monitor@pve"
|
|
vars.pve_password = "SuperSecretPassw0rd"
|
|
|
|
// change to false, if node is no member of a pve cluster
|
|
vars.pve_cluster = true
|
|
}
|
|
|
|
object Host "proxmox-host.domain.example" {
|
|
import "proxmox-host"
|
|
|
|
address = "192.168.42.42"
|
|
|
|
vars.pve_storage["flashpool"] = {
|
|
pve_warning = 80
|
|
pve_critical = 90
|
|
}
|
|
|
|
vars.pve_storage["diskpool"] = {
|
|
pve_warning = 80
|
|
pve_critical = 90
|
|
}
|
|
|
|
// Ignore these disks in health check (USB sticks, SD cards, etc.)
|
|
vars.pve_ignore_disks = [ "sdn", "sdg" ]
|
|
|
|
vars.virtual_machines["vm-01"] = {
|
|
}
|
|
}
|
|
|
|
template Service "pve-service" {
|
|
import "generic-service"
|
|
|
|
check_command = "pve"
|
|
}
|
|
|
|
apply Service "cluster" {
|
|
import "pve-service"
|
|
|
|
vars.pve_mode = "cluster"
|
|
|
|
assign where host.vars.pve_host && host.vars.pve_cluster
|
|
}
|
|
|
|
apply Service "services" {
|
|
import "pve-service"
|
|
|
|
vars.pve_mode = "services"
|
|
|
|
// Ignore cluster status on single nodes
|
|
if (!host.vars.pve_cluster) {
|
|
vars.pve_ignore_services = host.vars.pve_ignore_services || []
|
|
vars.pve_ignore_services.add("corosync")
|
|
}
|
|
|
|
assign where host.vars.pve_host
|
|
}
|
|
|
|
apply Service "updates" {
|
|
import "pve-service"
|
|
|
|
check_interval = 12h
|
|
retry_interval = 2h
|
|
max_check_attempts = 3
|
|
|
|
vars.pve_mode = "updates"
|
|
|
|
assign where host.vars.pve_host
|
|
}
|
|
|
|
apply Service "disk-health" {
|
|
import "pve-service"
|
|
|
|
vars.pve_mode = "disk-health"
|
|
|
|
assign where host.vars.pve_host
|
|
}
|
|
|
|
apply Service "io_wait" {
|
|
import "pve-service"
|
|
|
|
vars.pve_mode = "io_wait"
|
|
|
|
vars.pve_warning = 10
|
|
vars.pve_critical = 30
|
|
|
|
assign where host.vars.pve_host
|
|
}
|
|
|
|
apply Service "cpu" {
|
|
import "pve-service"
|
|
|
|
vars.pve_mode = "cpu"
|
|
|
|
vars.pve_warning = 70
|
|
vars.pve_critical = 90
|
|
|
|
assign where host.vars.pve_host
|
|
}
|
|
|
|
apply Service "memory" {
|
|
import "pve-service"
|
|
|
|
vars.pve_mode = "memory"
|
|
|
|
vars.pve_warning = 80
|
|
vars.pve_critical = 90
|
|
|
|
assign where host.vars.pve_host
|
|
}
|
|
|
|
apply Service "storage " for (storage => config in host.vars.pve_storage) {
|
|
import "pve-service"
|
|
|
|
vars += config
|
|
|
|
vars.pve_mode = "storage"
|
|
vars.pve_resource_name = storage
|
|
}
|
|
|
|
apply Service "pve-vm " for (vm => config in host.vars.virtual_machines) {
|
|
import "pve-service"
|
|
|
|
vars += config
|
|
|
|
vars.pve_mode = "vm"
|
|
vars.pve_resource_name = vm
|
|
|
|
assign where host.vars.pve_host
|
|
}
|