blob: 422cc0481a3e1bd62dcf06924f982c4c75528343 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
object Host "7560-server" {
import "test-generic-host"
address = "127.0.0.1"
check_command = "hostalive"
vars.interfaces += {
eth0 = {
port = 1
vlan = "internal"
address = "127.0.0.2"
qos = "enabled"
}
eth1 = {
port = 2
vlan = "mgmt"
address = "127.0.1.2"
}
eth2 = {
port = 3
vlan = "remote"
address = "127.0.2.2"
}
}
}
apply Service "if-" for (if_name => config in host.vars.interfaces) {
import "test-generic-service"
check_command = "ping4"
vars.qos = "disabled"
vars += config
display_name = "if-" + if_name + "-" + vars.vlan
notes = "Interface check for Port " + string(vars.port) + " in VLAN " + vars.vlan + " on Address " + vars.address + " QoS " + vars.qos
notes_url = "http://foreman.company.com/hosts/" + host.name
action_url = "http://snmp.checker.company.com/" + host.name + "if-" + if_name
assign where match("7560-*", host.name) && typeof(host.vars.interfaces) == typeof({})
}
|