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