This repository has been archived by the owner on Feb 5, 2024. It is now read-only.
forked from HeyStaks/icinga2-formula
-
Notifications
You must be signed in to change notification settings - Fork 1
/
pillar.example
201 lines (201 loc) · 5.22 KB
/
pillar.example
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
icinga2:
master_host: salt
port: 5665
config:
templates:
generic-host:
type: Host
conf:
max_check_attempts: 3
check_interval: 1m
retry_interval: 30s
check_command: hostalive
generic-service:
type: Service
conf:
max_check_attempts: 5
check_interval: 1m
retry_interval: 30s
generic-user:
type: User
generic-template-all:
type: Notification
conf:
types:
- Problem
- Acknowledgenment
- Recovery
- Custom
- FlappingStart
- FlappingEnd
- DowntimeStart
- DowntimeEnd
- DowntimeRemoved
period: "24x7"
mail-host-notification:
type: Notification
conf:
import: generic-template-all
command: mail-host-notification
states:
- Up
- Down
mail-service-notification:
type: Notification
conf:
import: generic-template-all
command: mail-service-notification
states:
- OK
- Warning
- Critical
- Unknown
hosts:
NodeName:
type: Host
conf:
import: generic-host
address: 127.0.0.1
vars:
os: Linux
disk_wfree: 15%
ssh_port: 22
notification.slack: "true"
http_vhosts:
Icinga web 2:
http_uri: /icingaweb2
http_port: 443
http_ssl: "true"
disks:
disk:
groups:
linux-servers:
type: HostGroup
conf:
display_name: "Linux Servers"
assign:
- host.vars.os == "Linux"
windows-servers:
type: HostGroup
conf:
display_name: "Windows Servers"
assign:
- host.vars.os == "Windows"
ping:
type: ServiceGroup
conf:
display_name: "Ping Service"
assign:
- match("ping*", service.name)
http:
type: ServiceGroup
conf:
display_name: "HTTP Service"
assign:
- match("http*", service.check_command)
disk:
type: ServiceGroup
conf:
display_name: "Disk Checks"
assign:
- match("disk*", service.check_command)
downtimes:
backup-downtime:
type: ScheduledDowntime
to: Service
conf:
author: icingaadmin
comment: Scheduled downtime for backup
ranges:
monday: service.vars.backup_downtime
tuesday: service.vars.backup_downtime
wednesday: service.vars.backup_downtime
thursday: service.vars.backup_downtime
friday: service.vars.backup_downtime
saturday: service.vars.backup_downtime
sunday: service.vars.backup_downtime
assign:
- service.vars.backup_downtime != ""
notifications:
mail-icingaadmin-host:
type: Notification
to: Host
conf:
import: mail-host-notification
user_groups: host.vars.notification.mail.groups
users: host.vars.notification.mail.users
assign:
- host.vars.notification.mail
mail-icingaadmin-service:
type: Notification
to: Service
conf:
import: mail-service-notification
user_groups: host.vars.notification.mail.groups
users: host.vars.notification.mail.users
assign:
- host.vars.notification.mail
services:
icinga:
type: Service
conf:
import: generic-service
check_command: icinga
assign:
- host.name == NodeName
procs:
type: Service
conf:
import: generic-service
check_command: procs
assign:
- host.name == NodeName
swap:
type: Service
conf:
import: generic-service
check_command: swap
assign:
- host.name == NodeName
users:
type: Service
conf:
import: generic-service
check_command: users
assign:
- host.name == NodeName
ping4:
type: Service
conf:
import: generic-service
check_command: ping4
assign:
- host.address
ssh:
type: Service
conf:
import: generic-service
check_command: ssh
assign:
- (host.address || host.address6) && host.vars.os == "Linux"
load:
type: Service
conf:
import: generic-service
check_command: load
vars:
backup_downtime: "02:00-03:00"
assign:
- host.name == NodeName
http_vhosts:
type: Service
for: (http_vhost => config in host.vars.http_vhosts)
conf:
import: generic-service
check_command: http
disks:
type: Service
for: (disk => config in host.vars.disks)
conf:
import: generic-service
check_command: disk