I feel like there has to be a better way. I have a remote vm I need to run checks from. I can’t run a satellite instance here, but I can run whatever scripts. I do have access to the monitoring-plugin ones. I’m defining all of my remote by_ssh checks in the host object. Ideally I think I’d like to have the services referenced by the “-H ip.address” show as services under that host and not the server running the by_ssh checks.
Any ideas on how to clean this up?
object Host "192.168.100.100" {
import "generic-host"
address = "192.168.100.100"
display_name = "Hosted VM"
check_command = "hostalive"
vars.os = "Linux"
vars.by_ssh_checks["100 TCP/53"] = "/usr/local/libexec/check_tcp -H 172.16.1.100 -p 53"
vars.by_ssh_checks["100 TCP/80"] = "/usr/local/libexec/check_tcp -H 172.16.1.100 -p 80"
vars.by_ssh_checks["100 TCP/443"] = "/usr/local/libexec/check_tcp -H 172.16.1.100 -p 443"
vars.by_ssh_checks["100 TCP/8080"] = "/usr/local/libexec/check_tcp -H 172.16.1.100 -p 8080"
vars.by_ssh_checks["200 TCP/53"] = "/usr/local/libexec/check_tcp -H 172.16.1.200 -p 53"
vars.by_ssh_checks["200 TCP/80"] = "/usr/local/libexec/check_tcp -H 172.16.1.200 -p 80"
vars.by_ssh_checks["200 TCP/443"] = "/usr/local/libexec/check_tcp -H 172.16.1.200 -p 443"
vars.by_ssh_checks["200 TCP/8080"] = "/usr/local/libexec/check_tcp -H 172.16.1.200 -p 8080"
vars.by_ssh_checks["Uptime"] = "uptime"
}
apply Service for (check => by_ssh_check in host.vars.by_ssh_checks) {
import "generic-service"
// make this a variable maybe
host_name = "192.168.100.100"
check_command = "by_ssh"
display_name = check
vars.by_ssh_command = by_ssh_check
vars.by_ssh_logname = "icinga"
}