74 lines
1.8 KiB
Plaintext

# {{ ansible_managed }}
{% set c = icinga_contact_default %}
{% if icinga_contact is defined %}
{% set c = icinga_contact %}
{% endif %}
object Host "{{ inventory_hostname }}" {
import "generic-host"
address = "{{ ansible_host }}"
vars.os = "routeros"
vars.notification["mail"] = {
groups = [ {{ c }} ]
}
icon_image = "routeros.png"
icon_image_alt = "MikroTik RouterOS"
}
object Service "ssh" {
import "generic-service"
host_name = "{{ inventory_hostname }}"
check_command = "ssh"
{% if ansible_port is defined and ansible_port != 22 %}
vars.ssh_port = "{{ ansible_port }}"
{% endif %}
}
object Service "mikrotik_system" {
import "generic-service"
host_name = "{{ inventory_hostname }}"
check_command = "mikrotik_system"
vars.apiuser = "{{ apiuser }}"
vars.apipasswd = "{{ apipasswd }}"
}
{% if 'check_ltebackup' in group_names %}
object Service "ltebackup" {
import "generic-service"
host_name = "{{ inventory_hostname }}"
check_command = "mikrotik_ltebackup"
vars.user = "{{ apiuser }}"
vars.password = "{{ apipasswd }}"
vars.ca = "{{ apica }}"
}
{% endif %}
{% if ov_backup_ip is defined %}
object Service "ping_ov_backup_ip" {
import "generic-service"
host_name = "{{ inventory_hostname }}"
check_command = "ping"
vars.ping_address = "{{ ov_backup_ip }}"
}
{% endif %}
{% if extra_ping is defined %}
object Service "ping_{{ extra_ping }}" {
import "generic-service"
host_name = "{{ inventory_hostname }}"
check_command = "ping"
vars.ping_address = "{{ extra_ping }}"
}
{% endif %}
{% if extra_ssh is defined %}
object Service "ssh_{{ extra_ssh }}" {
import "generic-service"
host_name = "{{ inventory_hostname }}"
check_command = "ssh"
vars.ssh_address = "{{ extra_ssh }}"
}
{% endif %}
# vim: set tabstop=4 shiftwidth=4 expandtab smarttab: