From 133174dc412f08234d6198253fb0fd5c3c6ba8ce Mon Sep 17 00:00:00 2001 From: Rottler Tamas Date: Fri, 28 Jul 2023 10:56:14 +0200 Subject: [PATCH] check ssh, extra_oping/ssh --- templates/host | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/templates/host b/templates/host index be6f781..d4b9d61 100644 --- a/templates/host +++ b/templates/host @@ -15,6 +15,15 @@ object Host "{{ hostvars[item].inventory_hostname }}" { icon_image_alt = "MikroTik RouterOS" } +object Service "ssh" { + import "generic-service" + host_name = "{{ hostvars[item].inventory_hostname }}" + check_command = "ssh" +{% if hostvars[item].ansible_port is defined %} + vars.ssh_port = "{{ hostvars[item].ansible_port }}" +{% endif %} +} + object Service "mikrotik" { import "generic-service" host_name = "{{ hostvars[item].inventory_hostname }}" @@ -43,5 +52,22 @@ object Service "ping_ov_backup_ip" { } {% endif %} +{% if hostvars[item].extra_ping is defined %} +object Service "ping_{{ hostvars[item].extra_ping }}" { + import "generic-service" + host_name = "{{ hostvars[item].inventory_hostname }}" + check_command = "ping" + vars.ping_address = "{{ hostvars[item].extra_ping }}" +} +{% endif %} + +{% if hostvars[item].extra_ssh is defined %} +object Service "ssh_{{ hostvars[item].extra_ssh }}" { + import "generic-service" + host_name = "{{ hostvars[item].inventory_hostname }}" + check_command = "ssh" + vars.ssh_address = "{{ hostvars[item].extra_ssh }}" +} +{% endif %} # vim: set tabstop=4 shiftwidth=4 expandtab smarttab: