File: nebstructs.h

package info (click to toggle)
icinga 1.14.2%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 49,264 kB
  • sloc: ansic: 108,564; sql: 9,656; sh: 4,945; perl: 3,439; makefile: 1,213; php: 581; xml: 104
file content (545 lines) | stat: -rw-r--r-- 14,360 bytes parent folder | download | duplicates (2)
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
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
/*****************************************************************************
 *
 * NEBSTRUCTS.H - Event broker includes for Icinga
 *
 * Copyright (c) 1999-2009 Ethan Galstad (egalstad@nagios.org)
 * Copyright (c) 2009-2013 Nagios Core Development Team and Community Contributors
 * Copyright (c) 2009-2015 Icinga Development Team (http://www.icinga.org)
 *
 * License:
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 *****************************************************************************/

#ifndef _NEBSTRUCTS_H
#define _NEBSTRUCTS_H

#include "config.h"
#include "objects.h"
#include "icinga.h"

#ifdef __cplusplus
  extern "C" {
#endif

/****** STRUCTURES *************************/

/* process data structure */
typedef struct nebstruct_process_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;
        }nebstruct_process_data;


/* timed event data structure */
typedef struct nebstruct_timed_event_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             event_type;
	int             recurring;
	time_t          run_time;
	void            *event_data;

	void            *event_ptr;
        }nebstruct_timed_event_data;


/* log data structure */
typedef struct nebstruct_log_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	time_t          entry_time;
	int             data_type;
	char            *data;
	char		*host_name;
	char		*service_description;
        }nebstruct_log_data;


/* system command structure */
typedef struct nebstruct_system_command_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	struct timeval  start_time;
	struct timeval  end_time;
	int             timeout;
	char            *command_line;
	int             early_timeout;
	double          execution_time;
	int             return_code;
	char            *output;
        }nebstruct_system_command_data;


/* event handler structure */
typedef struct nebstruct_event_handler_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             eventhandler_type;
	char            *host_name;
	char            *service_description;
	int             state_type;
	int             state;
	int             timeout;
	char            *command_name;
	char            *command_args;
	char            *command_line;
	struct timeval  start_time;
	struct timeval  end_time;
	int             early_timeout;
	double          execution_time;
	int             return_code;
	char            *output;

	void            *object_ptr;
        }nebstruct_event_handler_data;


/* host check structure */
typedef struct nebstruct_host_check_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	char            *host_name;
	int             current_attempt;
	int             check_type;
	int             max_attempts;
	int             state_type;
	int             state;
	int             timeout;
	char            *command_name;
	char            *command_args;
	char            *command_line;
	struct timeval  start_time;
	struct timeval  end_time;
	int             early_timeout;
	double          execution_time;
	double          latency;
	int             return_code;
	char            *output;
	char            *long_output;
	char            *perf_data;

	void            *object_ptr;
        }nebstruct_host_check_data;


/* service check structure */
typedef struct nebstruct_service_check_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	char            *host_name;
	char            *service_description;
	int             check_type;
	int             current_attempt;
	int             max_attempts;
	int             state_type;
	int             state;
	int             timeout;
	char            *command_name;
	char            *command_args;
	char            *command_line;
	struct timeval  start_time;
	struct timeval  end_time;
	int             early_timeout;
	double          execution_time;
	double          latency;
	int             return_code;
	char            *output;
	char            *long_output;
	char            *perf_data;

	void            *object_ptr;
        }nebstruct_service_check_data;


/* comment data structure */
typedef struct nebstruct_comment_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             comment_type;
	char            *host_name;
	char            *service_description;
	time_t          entry_time;
	char            *author_name;
	char            *comment_data;
	int             persistent;
	int             source;
	int             entry_type;
	int             expires;
	time_t          expire_time;
	unsigned long   comment_id;

	void            *object_ptr; /* not implemented yet */
        }nebstruct_comment_data;


/* downtime data structure */
typedef struct nebstruct_downtime_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             downtime_type;
	char            *host_name;
	char            *service_description;
	time_t          entry_time;
	char            *author_name;
	char            *comment_data;
	time_t          start_time;
	time_t          end_time;
	int             fixed;
	unsigned long   duration;
	unsigned long   triggered_by;
	unsigned long   downtime_id;

	void            *object_ptr; /* not implemented yet */
	int		is_in_effect;
	time_t		trigger_time;
        }nebstruct_downtime_data;


/* flapping data structure */
typedef struct nebstruct_flapping_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             flapping_type;
	char            *host_name;
	char            *service_description;
	double          percent_change;
	double          high_threshold;
	double          low_threshold;
	unsigned long   comment_id;

	void            *object_ptr;
        }nebstruct_flapping_data;


/* program status structure */
typedef struct nebstruct_program_status_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	time_t          program_start;
	int             pid;
	int             daemon_mode;
	time_t          last_command_check;
	time_t          last_log_rotation;
	int             notifications_enabled;
	int             active_service_checks_enabled;
	int             passive_service_checks_enabled;
	int             active_host_checks_enabled;
	int             passive_host_checks_enabled;
	int             event_handlers_enabled;
	int             flap_detection_enabled;
	int             failure_prediction_enabled;
	int             process_performance_data;
	int             obsess_over_hosts;
	int             obsess_over_services;
	unsigned long   modified_host_attributes;
	unsigned long   modified_service_attributes;
	char            *global_host_event_handler;
	char            *global_service_event_handler;
	time_t		disable_notifications_expire_time;
        }nebstruct_program_status_data;


/* host status structure */
typedef struct nebstruct_host_status_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	void            *object_ptr;
        }nebstruct_host_status_data;


/* service status structure */
typedef struct nebstruct_service_status_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	void            *object_ptr;
        }nebstruct_service_status_data;


/* contact status structure */
typedef struct nebstruct_contact_status_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	void            *object_ptr;
        }nebstruct_contact_status_data;


/* notification data structure */
typedef struct nebstruct_notification_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             notification_type;
	struct timeval  start_time;
	struct timeval  end_time;
	char            *host_name;
	char            *service_description;
	int             reason_type;
	int             state;
	char            *output;
	char            *ack_author;
	char            *ack_data;
	int             escalated;
	int             contacts_notified;

	void            *object_ptr;
	char 		*long_output;
        }nebstruct_notification_data;


/* contact notification data structure */
typedef struct nebstruct_contact_notification_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             notification_type;
	struct timeval  start_time;
	struct timeval  end_time;
	char            *host_name;
	char            *service_description;
	char            *contact_name;
	int             reason_type;
	int             state;
	char            *output;
	char            *ack_author;
	char            *ack_data;
	int             escalated;

	void            *object_ptr;
	void            *contact_ptr;
        }nebstruct_contact_notification_data;


/* contact notification method data structure */
typedef struct nebstruct_contact_notification_method_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             notification_type;
	struct timeval  start_time;
	struct timeval  end_time;
	char            *host_name;
	char            *service_description;
	char            *contact_name;
	char            *command_name;
	char            *command_args;
	int             reason_type;
	int             state;
	char            *output;
	char            *ack_author;
	char            *ack_data;
	int             escalated;

	void            *object_ptr;
	void            *contact_ptr;
        }nebstruct_contact_notification_method_data;


/* adaptive program data structure */
typedef struct nebstruct_adaptive_program_data_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             command_type;
	unsigned long   modified_host_attribute;
	unsigned long   modified_host_attributes;
	unsigned long   modified_service_attribute;
	unsigned long   modified_service_attributes;
        }nebstruct_adaptive_program_data;


/* adaptive host data structure */
typedef struct nebstruct_adaptive_host_data_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             command_type;
	unsigned long   modified_attribute;
	unsigned long   modified_attributes;

	void            *object_ptr;
        }nebstruct_adaptive_host_data;


/* adaptive service data structure */
typedef struct nebstruct_adaptive_service_data_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             command_type;
	unsigned long   modified_attribute;
	unsigned long   modified_attributes;

	void            *object_ptr;
        }nebstruct_adaptive_service_data;


/* adaptive contact data structure */
typedef struct nebstruct_adaptive_contact_data_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             command_type;
	unsigned long   modified_attribute;
	unsigned long   modified_attributes;
	unsigned long   modified_host_attribute;
	unsigned long   modified_host_attributes;
	unsigned long   modified_service_attribute;
	unsigned long   modified_service_attributes;

	void            *object_ptr;
        }nebstruct_adaptive_contact_data;


/* external command data structure */
typedef struct nebstruct_external_command_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             command_type;
	time_t          entry_time;
	char            *command_string;
	char            *command_args;
        }nebstruct_external_command_data;


/* aggregated status data structure */
typedef struct nebstruct_aggregated_status_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

        }nebstruct_aggregated_status_data;


/* retention data structure */
typedef struct nebstruct_retention_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

        }nebstruct_retention_data;


/* acknowledgement structure */
typedef struct nebstruct_acknowledgement_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             acknowledgement_type;
	char            *host_name;
	char            *service_description;
	int             state;
	char            *author_name;
	char            *comment_data;
	int             is_sticky;
	int             persistent_comment;
	int             notify_contacts;

	void            *object_ptr;

	/* RB - 2011.09.10
	Not nice, but the only way at the moment */
	time_t		end_time;
        }nebstruct_acknowledgement_data;


/* state change structure */
typedef struct nebstruct_statechange_struct{
	int             type;
	int             flags;
	int             attr;
	struct timeval  timestamp;

	int             statechange_type;
	char            *host_name;
	char            *service_description;
	int             state;
	int             state_type;
	int             current_attempt;
	int             max_attempts;
	char            *output;

	void            *object_ptr;
	/* do not break the api */
	char            *long_output;
        }nebstruct_statechange_data;

#ifdef __cplusplus
  }
#endif

#endif