include/nebstructs.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  * NEBSTRUCTS.H - Event broker includes for Icinga
00004  *
00005  * Copyright (c) 1999-2009 Ethan Galstad (egalstad@nagios.org)
00006  * Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors
00007  * Copyright (c) 2009-2011 Icinga Development Team (http://www.icinga.org)
00008  *
00009  * License:
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License version 2 as
00013  * published by the Free Software Foundation.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00023  *
00024  *****************************************************************************/
00025 
00026 #ifndef _NEBSTRUCTS_H
00027 #define _NEBSTRUCTS_H
00028 
00029 #include "config.h"
00030 #include "objects.h"
00031 #include "icinga.h"
00032 
00033 #ifdef __cplusplus
00034   extern "C" {
00035 #endif
00036 
00037 /****** STRUCTURES *************************/
00038 
00039 /* process data structure */
00040 typedef struct nebstruct_process_struct{
00041         int             type;
00042         int             flags;
00043         int             attr;
00044         struct timeval  timestamp;
00045         }nebstruct_process_data;
00046 
00047 
00048 /* timed event data structure */
00049 typedef struct nebstruct_timed_event_struct{
00050         int             type;
00051         int             flags;
00052         int             attr;
00053         struct timeval  timestamp;
00054 
00055         int             event_type;
00056         int             recurring;
00057         time_t          run_time;
00058         void            *event_data;
00059 
00060         void            *event_ptr;
00061         }nebstruct_timed_event_data;
00062 
00063 
00064 /* log data structure */
00065 typedef struct nebstruct_log_struct{
00066         int             type;
00067         int             flags;
00068         int             attr;
00069         struct timeval  timestamp;
00070 
00071         time_t          entry_time;
00072         int             data_type;
00073         char            *data;
00074         }nebstruct_log_data;
00075 
00076 
00077 /* system command structure */
00078 typedef struct nebstruct_system_command_struct{
00079         int             type;
00080         int             flags;
00081         int             attr;
00082         struct timeval  timestamp;
00083 
00084         struct timeval  start_time;
00085         struct timeval  end_time;
00086         int             timeout;
00087         char            *command_line;
00088         int             early_timeout;
00089         double          execution_time;
00090         int             return_code;
00091         char            *output;
00092         }nebstruct_system_command_data;
00093 
00094 
00095 /* event handler structure */
00096 typedef struct nebstruct_event_handler_struct{
00097         int             type;
00098         int             flags;
00099         int             attr;
00100         struct timeval  timestamp;
00101 
00102         int             eventhandler_type;
00103         char            *host_name;
00104         char            *service_description;
00105         int             state_type;
00106         int             state;
00107         int             timeout;
00108         char            *command_name;
00109         char            *command_args;
00110         char            *command_line;
00111         struct timeval  start_time;
00112         struct timeval  end_time;
00113         int             early_timeout;
00114         double          execution_time;
00115         int             return_code;
00116         char            *output;
00117 
00118         void            *object_ptr;
00119         }nebstruct_event_handler_data;
00120 
00121 
00122 /* host check structure */
00123 typedef struct nebstruct_host_check_struct{
00124         int             type;
00125         int             flags;
00126         int             attr;
00127         struct timeval  timestamp;
00128 
00129         char            *host_name;
00130         int             current_attempt;
00131         int             check_type;
00132         int             max_attempts;
00133         int             state_type;
00134         int             state;
00135         int             timeout;
00136         char            *command_name;
00137         char            *command_args;
00138         char            *command_line;
00139         struct timeval  start_time;
00140         struct timeval  end_time;
00141         int             early_timeout;
00142         double          execution_time;
00143         double          latency;
00144         int             return_code;
00145         char            *output;
00146         char            *long_output;
00147         char            *perf_data;
00148 
00149         void            *object_ptr;
00150         }nebstruct_host_check_data;
00151 
00152 
00153 /* service check structure */
00154 typedef struct nebstruct_service_check_struct{
00155         int             type;
00156         int             flags;
00157         int             attr;
00158         struct timeval  timestamp;
00159 
00160         char            *host_name;
00161         char            *service_description;
00162         int             check_type;
00163         int             current_attempt;
00164         int             max_attempts;
00165         int             state_type;
00166         int             state;
00167         int             timeout;
00168         char            *command_name;
00169         char            *command_args;
00170         char            *command_line;
00171         struct timeval  start_time;
00172         struct timeval  end_time;
00173         int             early_timeout;
00174         double          execution_time;
00175         double          latency;
00176         int             return_code;
00177         char            *output;
00178         char            *long_output;
00179         char            *perf_data;
00180 
00181         void            *object_ptr;
00182         }nebstruct_service_check_data;
00183 
00184 
00185 /* comment data structure */
00186 typedef struct nebstruct_comment_struct{
00187         int             type;
00188         int             flags;
00189         int             attr;
00190         struct timeval  timestamp;
00191 
00192         int             comment_type;
00193         char            *host_name;
00194         char            *service_description;
00195         time_t          entry_time;
00196         char            *author_name;
00197         char            *comment_data;
00198         int             persistent;
00199         int             source;
00200         int             entry_type;
00201         int             expires;
00202         time_t          expire_time;
00203         unsigned long   comment_id;
00204 
00205         void            *object_ptr; /* not implemented yet */
00206         }nebstruct_comment_data;
00207 
00208 
00209 /* downtime data structure */
00210 typedef struct nebstruct_downtime_struct{
00211         int             type;
00212         int             flags;
00213         int             attr;
00214         struct timeval  timestamp;
00215 
00216         int             downtime_type;
00217         char            *host_name;
00218         char            *service_description;
00219         time_t          entry_time;
00220         char            *author_name;
00221         char            *comment_data;
00222         time_t          start_time;
00223         time_t          end_time;
00224         int             fixed;
00225         unsigned long   duration;
00226         unsigned long   triggered_by;
00227         unsigned long   downtime_id;
00228 
00229         void            *object_ptr; /* not implemented yet */
00230         }nebstruct_downtime_data;
00231 
00232 
00233 /* flapping data structure */
00234 typedef struct nebstruct_flapping_struct{
00235         int             type;
00236         int             flags;
00237         int             attr;
00238         struct timeval  timestamp;
00239 
00240         int             flapping_type;
00241         char            *host_name;
00242         char            *service_description;
00243         double          percent_change;
00244         double          high_threshold;
00245         double          low_threshold;
00246         unsigned long   comment_id;
00247 
00248         void            *object_ptr;
00249         }nebstruct_flapping_data;
00250 
00251 
00252 /* program status structure */
00253 typedef struct nebstruct_program_status_struct{
00254         int             type;
00255         int             flags;
00256         int             attr;
00257         struct timeval  timestamp;
00258 
00259         time_t          program_start;
00260         int             pid;
00261         int             daemon_mode;
00262         time_t          last_command_check;
00263         time_t          last_log_rotation;
00264         int             notifications_enabled;
00265         int             active_service_checks_enabled;
00266         int             passive_service_checks_enabled;
00267         int             active_host_checks_enabled;
00268         int             passive_host_checks_enabled;
00269         int             event_handlers_enabled;
00270         int             flap_detection_enabled;
00271         int             failure_prediction_enabled;
00272         int             process_performance_data;
00273         int             obsess_over_hosts;
00274         int             obsess_over_services;
00275         unsigned long   modified_host_attributes;
00276         unsigned long   modified_service_attributes;
00277         char            *global_host_event_handler;
00278         char            *global_service_event_handler;
00279         }nebstruct_program_status_data;
00280 
00281 
00282 /* host status structure */
00283 typedef struct nebstruct_host_status_struct{
00284         int             type;
00285         int             flags;
00286         int             attr;
00287         struct timeval  timestamp;
00288 
00289         void            *object_ptr;
00290         }nebstruct_host_status_data;
00291 
00292 
00293 /* service status structure */
00294 typedef struct nebstruct_service_status_struct{
00295         int             type;
00296         int             flags;
00297         int             attr;
00298         struct timeval  timestamp;
00299 
00300         void            *object_ptr;
00301         }nebstruct_service_status_data;
00302 
00303 
00304 /* contact status structure */
00305 typedef struct nebstruct_contact_status_struct{
00306         int             type;
00307         int             flags;
00308         int             attr;
00309         struct timeval  timestamp;
00310 
00311         void            *object_ptr;
00312         }nebstruct_contact_status_data;
00313 
00314 
00315 /* notification data structure */
00316 typedef struct nebstruct_notification_struct{
00317         int             type;
00318         int             flags;
00319         int             attr;
00320         struct timeval  timestamp;
00321 
00322         int             notification_type;
00323         struct timeval  start_time;
00324         struct timeval  end_time;
00325         char            *host_name;
00326         char            *service_description;
00327         int             reason_type;
00328         int             state;
00329         char            *output;
00330         char            *ack_author;
00331         char            *ack_data;
00332         int             escalated;
00333         int             contacts_notified;
00334 
00335         void            *object_ptr;
00336         }nebstruct_notification_data;
00337 
00338 
00339 /* contact notification data structure */
00340 typedef struct nebstruct_contact_notification_struct{
00341         int             type;
00342         int             flags;
00343         int             attr;
00344         struct timeval  timestamp;
00345 
00346         int             notification_type;
00347         struct timeval  start_time;
00348         struct timeval  end_time;
00349         char            *host_name;
00350         char            *service_description;
00351         char            *contact_name;
00352         int             reason_type;
00353         int             state;
00354         char            *output;
00355         char            *ack_author;
00356         char            *ack_data;
00357         int             escalated;
00358 
00359         void            *object_ptr;
00360         void            *contact_ptr;
00361         }nebstruct_contact_notification_data;
00362 
00363 
00364 /* contact notification method data structure */
00365 typedef struct nebstruct_contact_notification_method_struct{
00366         int             type;
00367         int             flags;
00368         int             attr;
00369         struct timeval  timestamp;
00370 
00371         int             notification_type;
00372         struct timeval  start_time;
00373         struct timeval  end_time;
00374         char            *host_name;
00375         char            *service_description;
00376         char            *contact_name;
00377         char            *command_name;
00378         char            *command_args;
00379         int             reason_type;
00380         int             state;
00381         char            *output;
00382         char            *ack_author;
00383         char            *ack_data;
00384         int             escalated;
00385 
00386         void            *object_ptr;
00387         void            *contact_ptr;
00388         }nebstruct_contact_notification_method_data;
00389 
00390 
00391 /* adaptive program data structure */
00392 typedef struct nebstruct_adaptive_program_data_struct{
00393         int             type;
00394         int             flags;
00395         int             attr;
00396         struct timeval  timestamp;
00397 
00398         int             command_type;
00399         unsigned long   modified_host_attribute;
00400         unsigned long   modified_host_attributes;
00401         unsigned long   modified_service_attribute;
00402         unsigned long   modified_service_attributes;
00403         }nebstruct_adaptive_program_data;
00404 
00405 
00406 /* adaptive host data structure */
00407 typedef struct nebstruct_adaptive_host_data_struct{
00408         int             type;
00409         int             flags;
00410         int             attr;
00411         struct timeval  timestamp;
00412 
00413         int             command_type;
00414         unsigned long   modified_attribute;
00415         unsigned long   modified_attributes;
00416 
00417         void            *object_ptr;
00418         }nebstruct_adaptive_host_data;
00419 
00420 
00421 /* adaptive service data structure */
00422 typedef struct nebstruct_adaptive_service_data_struct{
00423         int             type;
00424         int             flags;
00425         int             attr;
00426         struct timeval  timestamp;
00427 
00428         int             command_type;
00429         unsigned long   modified_attribute;
00430         unsigned long   modified_attributes;
00431 
00432         void            *object_ptr;
00433         }nebstruct_adaptive_service_data;
00434 
00435 
00436 /* adaptive contact data structure */
00437 typedef struct nebstruct_adaptive_contact_data_struct{
00438         int             type;
00439         int             flags;
00440         int             attr;
00441         struct timeval  timestamp;
00442 
00443         int             command_type;
00444         unsigned long   modified_attribute;
00445         unsigned long   modified_attributes;
00446         unsigned long   modified_host_attribute;
00447         unsigned long   modified_host_attributes;
00448         unsigned long   modified_service_attribute;
00449         unsigned long   modified_service_attributes;
00450 
00451         void            *object_ptr;
00452         }nebstruct_adaptive_contact_data;
00453 
00454 
00455 /* external command data structure */
00456 typedef struct nebstruct_external_command_struct{
00457         int             type;
00458         int             flags;
00459         int             attr;
00460         struct timeval  timestamp;
00461 
00462         int             command_type;
00463         time_t          entry_time;
00464         char            *command_string;
00465         char            *command_args;
00466         }nebstruct_external_command_data;
00467 
00468 
00469 /* aggregated status data structure */
00470 typedef struct nebstruct_aggregated_status_struct{
00471         int             type;
00472         int             flags;
00473         int             attr;
00474         struct timeval  timestamp;
00475 
00476         }nebstruct_aggregated_status_data;
00477 
00478 
00479 /* retention data structure */
00480 typedef struct nebstruct_retention_struct{
00481         int             type;
00482         int             flags;
00483         int             attr;
00484         struct timeval  timestamp;
00485 
00486         }nebstruct_retention_data;
00487 
00488 
00489 /* acknowledgement structure */
00490 typedef struct nebstruct_acknowledgement_struct{
00491         int             type;
00492         int             flags;
00493         int             attr;
00494         struct timeval  timestamp;
00495 
00496         int             acknowledgement_type;
00497         char            *host_name;
00498         char            *service_description;
00499         int             state;
00500         char            *author_name;
00501         char            *comment_data;
00502         int             is_sticky;
00503         int             persistent_comment;
00504         int             notify_contacts;
00505 
00506         void            *object_ptr;
00507         }nebstruct_acknowledgement_data;
00508 
00509 
00510 /* state change structure */
00511 typedef struct nebstruct_statechange_struct{
00512         int             type;
00513         int             flags;
00514         int             attr;
00515         struct timeval  timestamp;
00516 
00517         int             statechange_type;
00518         char            *host_name;
00519         char            *service_description;
00520         int             state;
00521         int             state_type;
00522         int             current_attempt;
00523         int             max_attempts;
00524         char            *output;
00525 
00526         void            *object_ptr;
00527         }nebstruct_statechange_data;
00528 
00529 #ifdef __cplusplus
00530   }
00531 #endif
00532 
00533 #endif

Generated on Wed Mar 30 17:22:22 2011 for icinga-core by  doxygen 1.4.7