-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.conf
120 lines (114 loc) · 3.83 KB
/
example.conf
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# modules is an array; order is important
modules = [
email
linuxfib
]
# The email module exports the following actions:
# email.sendmail
# * subject (optional): Subject for the email
# * text (optional): Body of the email
# Placeholders are available for inclusion in the text:
# - {module} for the module which triggered the email
# - {message} for the message from that module
email {
from_address = "[email protected]"
to_address = "[email protected]"
# default_subject = "Email from NetForeman"
server = 127.0.0.1
# port = 25
# username = "johndoe"
# password = "R%ty2jk"
}
email_relay_host = 198.51.100.20
core_routers = [ 192.0.2.129, 192.0.2.143 ]
linuxfib {
# route_checks is an array, order is important
route_checks = [
# make sure we can reach the email relay host
{
dest = ${email_relay_host}
# must lead to somewhere, i.e. not a blackhole
non_null = true
# on_error is an array, order is important
on_error = [
{ # replace or add missing route
action = linuxfib.replace_route
dest = ${email_relay_host}
nexthops = ${core_routers}
}
{
action = email.sendmail
# variable substitution works on non-quoted strings
subject=Added fallback route for ${email_relay_host}
}
]
}
# make sure there is a default gateway
{
dest = 0.0.0.0/0
non_null = true
on_error = [
{ # add missing route
action = linuxfib.add_route
dest = 0.0.0.0/0
nexthops = ${core_routers}
}
{
action = email.sendmail
subject = "Added fallback default route"
}
]
}
# make sure the route to a specific host is via a set of routers
{
dest = 198.51.100.5
# route must match any of the following nexthops
nexthops_any = [ 192.0.2.129, 192.0.2.143 ]
on_error = [
{
action = linuxfib.add_route
dest = 198.51.100.5
nexthops = ${core_routers}
}
{
action = email.sendmail
subject = "Added fallback route for 198.51.100.5"
}
]
}
]
}
process {
process_checks = [
{
basename = bird
# make sure the process is running with the exact
# (whitespace-separated) arguments (optional)
cmdline = /usr/sbin/bird -u bird -g bird
# cmdline can also be specified as a comma-separated list
#cmdline = [ /usr/sbin/bird, -u, bird, -g, bird ]
# program must be running as a certain user (optional)
user = bird
on_error = [
{
action = email.sendmail
subject = "bird not running as expected, attempting restart"
}
{
action = process.execute
cmdline = [/etc/init.d/bird, restart]
user = 0
# timeout=null for no timeout (default 5s)
timeout = 4
on_fail_or_output = [
{
action = email.sendmail
subject = Output from bird process_check
}
]
}
]
}
]
}
# vim: set syntax=conf expandtab smarttab tabstop=4 shiftwidth=4 softtabstop=4 :