nebstructs.h

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

Generated on Tue Apr 13 15:15:28 2010 for DNX by  doxygen 1.5.6