forked from FracKenA/op5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
input_models.go
343 lines (330 loc) · 22.4 KB
/
input_models.go
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
package op5
type Command struct {
CommandName string `json:"command_name"` //Name / description for the command. Good practise is to use check_ followed by a descriptive name for the test, for example check_http for a simple HTTP check. This, like ALL variables ending in '_name', must be a unique name.
CommandLine string `json:"command_line"` // This is the shell command that will be executed. Naemon macros (shortcuts) like $USER$ can be used.
Register bool `json:"register,omitempty"` //Tells op5 Monitor in which file this object should be stored. This can come in handy if you are used to edit the configuration directly in the text files. For security reasons, file creation through the web-interface is not supported.
FileID string `json:"file_id,omitempty"` //If this is set to on/true, the object is considered to be part of the configuration. Otherwise it used as a template.
}
type Contact struct {
ContactName string `json:"contact_name,omitempty"`
Alias string `json:"alias,omitempty"`
HostNotificationOptions []string `json:"host_notification_options,omitempty"`
ServiceNotificationOptions []string `json:"service_notification_options,omitempty"`
HostNotificationCmds string `json:"host_notification_cmds,omitempty"`
ServiceNotificationCmds string `json:"service_notification_cmds,omitempty"`
Register bool `json:"register,omitempty"`
Template string `json:"template,omitempty"`
FileID string `json:"file_id,omitempty"`
HostNotificationsEnabled bool `json:"host_notifications_enabled,omitempty"`
ServiceNotificationsEnabled bool `json:"service_notifications_enabled,omitempty"`
CanSubmitCommands bool `json:"can_submit_commands,omitempty"`
RetainStatusInformation bool `json:"retain_status_information,omitempty"`
RetainNonStatusInformation bool `json:"retain_nonstatus_information,omitempty"`
HostNotificationPeriod string `json:"host_notification_period,omitempty"`
ServiceNotificationPeriod string `json:"service_notification_period,omitempty"`
HostNotificationCmdsArgs string `json:"host_notification_cmds_args,omitempty"`
ServiceNotificationCmdsArgs string `json:"service_notification_cmds_args,omitempty"`
ContactGroups []interface{} `json:"contactgroups,omitempty"`
Email string `json:"email,omitempty"`
Pager string `json:"pager,omitempty"`
Address1 string `json:"address1,omitempty"`
Address2 string `json:"address2,omitempty"`
Address3 string `json:"address3,omitempty"`
Address4 string `json:"address4,omitempty"`
Address5 string `json:"address5,omitempty"`
Address6 string `json:"address6,omitempty"`
EnableAccess string `json:"enable_access,omitempty"`
RealName string `json:"realname,omitempty"`
Password string `json:"password,omitempty"`
PasswordAlgo string `json:"password_algo,omitempty"`
Modules []interface{} `json:"modules,omitempty"`
Groups []interface{} `json:"groups,omitempty"`
AccessLevels string `json:"Access Levels,omitempty"`
RealNameUser string `json:"Realname,omitempty"`
PasswordUser string `json:"Password,omitempty"`
Role []interface{} `json:"Role,omitempty"`
}
type ContactTemplate struct {
HostNotificationsEnabled bool `json:"host_notifications_enabled,omitempty"`
ServiceNotificationsEnabled bool `json:"service_notifications_enabled,omitempty"`
CanSubmitCommands bool `json:"can_submit_commands,omitempty"`
RetainStatusInformation bool `json:"retain_status_information,omitempty"`
RetainNonStatusInformation bool `json:"retain_nonstatus_information,omitempty"`
HostNotificationPeriod string `json:"host_notification_period,omitempty"`
ServiceNotificationPeriod string `json:"service_notification_period,omitempty"`
HostNotificationOptions []string `json:"host_notification_options,omitempty"`
ServiceNotificationOptions []string `json:"service_notification_options,omitempty"`
HostNotificationCmds string `json:"host_notification_cmds,omitempty"`
ServiceNotificationCmds string `json:"service_notification_cmds,omitempty"`
Register bool `json:"register,omitempty"`
Name string `json:"name,omitempty"`
FileID string `json:"file_id,omitempty"`
Template string `json:"template,omitempty"`
HostNotificationCmdsArgs string `json:"host_notification_cmds_args,omitempty"`
ServiceNotificationCmdsArgs string `json:"service_notification_cmds_args,omitempty"`
ContactGroups []interface{} `json:"contactgroups,omitempty"`
Email string `json:"email,omitempty"`
Pager string `json:"pager,omitempty"`
Address1 string `json:"address1,omitempty"`
Address2 string `json:"address2,omitempty"`
Address3 string `json:"address3,omitempty"`
Address4 string `json:"address4,omitempty"`
Address5 string `json:"address5,omitempty"`
Address6 string `json:"address6,omitempty"`
}
type ContactGroup struct {
ContactGroupName string `json:"contactgroup_name,omitempty"`
Alias string `json:"alias,omitempty"`
Register bool `json:"register,omitempty"`
FileID string `json:"file_id,omitempty"`
Members []interface{} `json:"members,omitempty"`
ContactGroupMembers []interface{} `json:"contactgroup_members,omitempty"`
}
type Host struct {
HostName string `json:"host_name,omitempty"`
Address string `json:"address,omitempty"`
MaxCheckAttempts int `json:"max_check_attempts,omitempty"`
CheckInterval int `json:"check_interval,omitempty"`
NotificationInterval int `json:"notification_interval,omitempty"`
Template string `json:"template,omitempty"`
Register bool `json:"register,omitempty"`
FileID string `json:"file_id,omitempty"`
Contacts []string `json:"contacts,omitempty"`
CheckCommand string `json:"check_command,omitempty"`
RetryInterval int `json:"retry_interval,omitempty"`
ActiveChecksEnabled bool `json:"active_checks_enabled,omitempty"`
PassiveChecksEnabled bool `json:"passive_checks_enabled,omitempty"`
CheckPeriod string `json:"check_period,omitempty"`
EventHandlerEnabled bool `json:"event_handler_enabled,omitempty"`
FlapDetectionEnabled bool `json:"flap_detection_enabled,omitempty"`
ProcessPerfData bool `json:"process_perf_data,omitempty"`
RetainStatusInformation bool `json:"retain_status_information,omitempty"`
RetainNonStatusInformation bool `json:"retain_nonstatus_information,omitempty"`
NotificationPeriod string `json:"notification_period,omitempty"`
NotificationOptions []string `json:"notification_options,omitempty"`
NotificationsEnabled bool `json:"notifications_enabled,omitempty"`
Alias string `json:"alias,omitempty"`
DisplayName string `json:"display_name,omitempty"`
HostGroups []string `json:"hostgroups,omitempty"`
Parents []interface{} `json:"parents,omitempty"`
Children []interface{} `json:"children,omitempty"`
CheckCommandArgs string `json:"check_command_args,omitempty"`
ContactGroups []interface{} `json:"contact_groups,omitempty"`
Obsess string `json:"obsess,omitempty"`
CheckFreshness string `json:"check_freshness,omitempty"`
FreshnessThreshold string `json:"freshness_threshold,omitempty"`
EventHandler string `json:"event_handler,omitempty"`
EventHandlerArgs string `json:"event_handler_args,omitempty"`
LowFlapThreshold string `json:"low_flap_threshold,omitempty"`
HighFlapThreshold string `json:"high_flap_threshold,omitempty"`
FlapDetectionOptions []interface{} `json:"flap_detection_options,omitempty"`
FirstNotificationDelay string `json:"first_notification_delay,omitempty"`
StalkingOptions []interface{} `json:"stalking_options,omitempty"`
IconImage string `json:"icon_image,omitempty"`
IconImageAlt string `json:"icon_image_alt,omitempty"`
StatusMapImage string `json:"statusmap_image,omitempty"`
Notes string `json:"notes,omitempty"`
ActionURL string `json:"action_url,omitempty"`
NotesURL string `json:"notes_url,omitempty"`
TwoDCoords string `json:"2d_coords,omitempty"`
ObsessOverHost string `json:"obsess_over_host,omitempty"`
Services []Service `json:"services,omitempty"`
CustomVars map[string]interface{} `json:"-"`
}
type HostTemplate struct {
CheckCommand string `json:"check_command,omitempty"`
MaxCheckAttempts int `json:"max_check_attempts,omitempty"`
CheckInterval int `json:"check_interval,omitempty"`
RetryInterval int `json:"retry_interval,omitempty"`
ActiveChecksEnabled bool `json:"active_checks_enabled,omitempty"`
PassiveChecksEnabled bool `json:"passive_checks_enabled,omitempty"`
CheckPeriod string `json:"check_period,omitempty"`
EventHandlerEnabled bool `json:"event_handler_enabled,omitempty"`
FlapDetectionEnabled bool `json:"flap_detection_enabled,omitempty"`
ProcessPerfData bool `json:"process_perf_data,omitempty"`
RetainStatusInformation bool `json:"retain_status_information,omitempty"`
RetainNonStatusInformation bool `json:"retain_nonstatus_information,omitempty"`
NotificationInterval int `json:"notification_interval,omitempty"`
NotificationPeriod string `json:"notification_period,omitempty"`
NotificationOptions []string `json:"notification_options,omitempty"`
NotificationsEnabled bool `json:"notifications_enabled,omitempty"`
Name string `json:"name,omitempty"`
Register bool `json:"register,omitempty"`
FileID string `json:"file_id,omitempty"`
Template string `json:"template,omitempty"`
Alias string `json:"alias,omitempty"`
DisplayName string `json:"display_name,omitempty"`
Address string `json:"address,omitempty"`
HostGroups []interface{} `json:"hostgroups,omitempty"`
Parents []interface{} `json:"parents,omitempty"`
Children []interface{} `json:"children,omitempty"`
CheckCommandArgs string `json:"check_command_args,omitempty"`
Contacts []interface{} `json:"contacts,omitempty"`
ContactGroups []interface{} `json:"contact_groups,omitempty"`
Obsess string `json:"obsess,omitempty"`
CheckFreshness string `json:"check_freshness,omitempty"`
FreshnessThreshold string `json:"freshness_threshold,omitempty"`
EventHandler string `json:"event_handler,omitempty"`
EventHandlerArgs string `json:"event_handler_args,omitempty"`
LowFlapThreshold string `json:"low_flap_threshold,omitempty"`
HighFlapThreshold string `json:"high_flap_threshold,omitempty"`
FlapDetectionOptions []interface{} `json:"flap_detection_options,omitempty"`
FirstNotificationDelay string `json:"first_notification_delay,omitempty"`
StalkingOptions []interface{} `json:"stalking_options,omitempty"`
IconImage string `json:"icon_image,omitempty"`
IconImageAlt string `json:"icon_image_alt,omitempty"`
StatusMapImage string `json:"statusmap_image,omitempty"`
Notes string `json:"notes,omitempty"`
ActionURL string `json:"action_url,omitempty"`
NotesURL string `json:"notes_url,omitempty"`
TwoDCoords string `json:"2d_coords,omitempty"`
ObsessOverHost string `json:"obsess_over_host,omitempty"`
CustomVars map[string]interface{} `json:"-"`
}
type HostGroup struct {
HostGroupName string `json:"hostgroup_name,omitempty"`
Alias string `json:"alias,omitempty"`
Register bool `json:"register,omitempty"`
FileID string `json:"file_id,omitempty"`
Members []interface{} `json:"members,omitempty"`
HostGroupMembers []interface{} `json:"hostgroup_members,omitempty"`
Notes string `json:"notes,omitempty"`
NotesURL string `json:"notes_url,omitempty"`
ActionURL string `json:"action_url,omitempty"`
Services []Service `json:"services,omitempty"`
}
type Service struct {
HostName string `json:"host_name,omitempty"`
ServiceDescription string `json:"service_description,omitempty"`
CheckCommand string `json:"check_command,omitempty"`
CheckCommandArgs string `json:"check_command_args,omitempty"`
MaxCheckAttempts int `json:"max_check_attempts,omitempty"`
CheckInterval int `json:"check_interval,omitempty"`
ParallelizeCheck bool `json:"parallelize_check,omitempty"`
Obsess bool `json:"obsess,omitempty"`
FlapDetectionEnabled bool `json:"flap_detection_enabled,omitempty"`
NotificationInterval int `json:"notification_interval,omitempty"`
Template string `json:"template,omitempty"`
Register bool `json:"register,omitempty"`
FileID string `json:"file_id,omitempty"`
Contacts []string `json:"contacts,omitempty"`
IsVolatile bool `json:"is_volatile,omitempty"`
RetryInterval int `json:"retry_interval,omitempty"`
ActiveChecksEnabled bool `json:"active_checks_enabled,omitempty"`
PassiveChecksEnabled bool `json:"passive_checks_enabled,omitempty"`
CheckPeriod string `json:"check_period,omitempty"`
EventHandlerEnabled bool `json:"event_handler_enabled,omitempty"`
ProcessPerfData bool `json:"process_perf_data,omitempty"`
RetainStatusInformation bool `json:"retain_status_information,omitempty"`
RetainNonStatusInformation bool `json:"retain_nonstatus_information,omitempty"`
NotificationPeriod string `json:"notification_period,omitempty"`
NotificationOptions []string `json:"notification_options,omitempty"`
NotificationsEnabled bool `json:"notifications_enabled,omitempty"`
HostGroupName string `json:"hostgroup_name,omitempty"`
DisplayName string `json:"display_name,omitempty"`
ServiceGroups []interface{} `json:"servicegroups,omitempty"`
CheckFreshness string `json:"check_freshness,omitempty"`
FreshnessThreshold string `json:"freshness_threshold,omitempty"`
EventHandler string `json:"event_handler,omitempty"`
EventHandlerArgs string `json:"event_handler_args,omitempty"`
LowFlapThreshold string `json:"low_flap_threshold,omitempty"`
HighFlapThreshold string `json:"high_flap_threshold,omitempty"`
FlapDetectionOptions []interface{} `json:"flap_detection_options,omitempty"`
FirstNotificationDelay string `json:"first_notification_delay,omitempty"`
ContactGroups []interface{} `json:"contact_groups,omitempty"`
StalkingOptions []interface{} `json:"stalking_options,omitempty"`
Notes string `json:"notes,omitempty"`
NotesURL string `json:"notes_url,omitempty"`
ActionURL string `json:"action_url,omitempty"`
IconImage string `json:"icon_image,omitempty"`
IconImageAlt string `json:"icon_image_alt,omitempty"`
ObsessOverService bool `json:"obsess_over_service,omitempty"`
CustomVars map[string]interface{} `json:"-"`
}
type ServiceTemplate struct {
IsVolatile bool `json:"is_volatile,omitempty"`
CheckCommand string `json:"check_command,omitempty"`
MaxCheckAttempts int `json:"max_check_attempts,omitempty"`
CheckInterval int `json:"check_interval,omitempty"`
RetryInterval int `json:"retry_interval,omitempty"`
ActiveChecksEnabled bool `json:"active_checks_enabled,omitempty"`
PassiveChecksEnabled bool `json:"passive_checks_enabled,omitempty"`
CheckPeriod string `json:"check_period,omitempty"`
EventHandlerEnabled bool `json:"event_handler_enabled,omitempty"`
FlapDetectionEnabled bool `json:"flap_detection_enabled,omitempty"`
ProcessPerfData bool `json:"process_perf_data,omitempty"`
RetainStatusInformation bool `json:"retain_status_information,omitempty"`
RetainNonStatusInformation bool `json:"retain_nonstatus_information,omitempty"`
NotificationInterval int `json:"notification_interval,omitempty"`
NotificationPeriod string `json:"notification_period,omitempty"`
NotificationOptions []string `json:"notification_options,omitempty"`
NotificationsEnabled bool `json:"notifications_enabled,omitempty"`
Name string `json:"name,omitempty"`
Register bool `json:"register,omitempty"`
FileID string `json:"file_id,omitempty"`
Template string `json:"template,omitempty"`
HostgroupName string `json:"hostgroup_name,omitempty"`
DisplayName string `json:"display_name,omitempty"`
CheckCommandArgs string `json:"check_command_args,omitempty"`
Servicegroups []interface{} `json:"servicegroups,omitempty"`
ParallelizeCheck string `json:"parallelize_check,omitempty"`
Obsess string `json:"obsess,omitempty"`
CheckFreshness string `json:"check_freshness,omitempty"`
FreshnessThreshold string `json:"freshness_threshold,omitempty"`
EventHandler string `json:"event_handler,omitempty"`
EventHandlerArgs string `json:"event_handler_args,omitempty"`
LowFlapThreshold string `json:"low_flap_threshold,omitempty"`
HighFlapThreshold string `json:"high_flap_threshold,omitempty"`
FlapDetectionOptions []interface{} `json:"flap_detection_options,omitempty"`
FirstNotificationDelay string `json:"first_notification_delay,omitempty"`
Contacts []interface{} `json:"contacts,omitempty"`
ContactGroups []interface{} `json:"contact_groups,omitempty"`
StalkingOptions []interface{} `json:"stalking_options,omitempty"`
Notes string `json:"notes,omitempty"`
NotesURL string `json:"notes_url,omitempty"`
ActionURL string `json:"action_url,omitempty"`
IconImage string `json:"icon_image,omitempty"`
IconImageAlt string `json:"icon_image_alt,omitempty"`
ObsessOverService string `json:"obsess_over_service,omitempty"`
CustomVars map[string]interface{} `json:"-"`
}
type ServiceGroup struct {
ServiceGroupName string `json:"servicegroup_name,omitempty"`
Register bool `json:"register,omitempty"`
FileID string `json:"file_id,omitempty"`
Members []string `json:"members,omitempty"`
Alias string `json:"alias,omitempty"`
ServiceGroupMembers []interface{} `json:"servicegroup_members,omitempty"`
Notes string `json:"notes,omitempty"`
NotesURL string `json:"notes_url,omitempty"`
ActionURL string `json:"action_url,omitempty"`
}
type TimePeriod struct {
TimePeriodName string `json:"timeperiod_name,omitempty"`
Alias string `json:"alias,omitempty"`
Sunday string `json:"sunday,omitempty"`
Monday string `json:"monday,omitempty"`
Tuesday string `json:"tuesday,omitempty"`
Wednesday string `json:"wednesday,omitempty"`
Thursday string `json:"thursday,omitempty"`
Friday string `json:"friday,omitempty"`
Saturday string `json:"saturday,omitempty"`
Register bool `json:"register,omitempty"`
FileID string `json:"file_id,omitempty"`
Exclude []interface{} `json:"exclude,omitempty"`
}
type User struct {
Username string `json:"username,omitempty"`
Realname string `json:"realname,omitempty"`
Modules []string `json:"modules,omitempty"`
Groups []string `json:"groups,omitempty"`
PasswordAlgo string `json:"password_algo,omitempty"`
AccessLevels []interface{} `json:"Access Levels,omitempty"`
UsernameUser string `json:"Username,omitempty"`
RealNameUser string `json:"Realname,omitempty"`
Role []string `json:"Role,omitempty"`
}
type UserGroup struct {
AccessRights []string `json:"access_rights,omitempty"`
Name string `json:"name,omitempty"`
}