include/broker.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  *
00003  * BROKER.H - Event broker includes for Icinga
00004  *
00005  * Copyright (c) 2002-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 _BROKER_H
00027 #define _BROKER_H
00028 
00029 #include "config.h"
00030 #include "icinga.h"
00031 
00032 #ifdef __cplusplus
00033   extern "C" {
00034 #endif
00035 
00036 /*************** EVENT BROKER OPTIONS *****************/
00037 
00038 #define BROKER_NOTHING                  0
00039 #define BROKER_EVERYTHING               1048575
00040 
00041 #define BROKER_PROGRAM_STATE            1       /* DONE */
00042 #define BROKER_TIMED_EVENTS             2       /* DONE */
00043 #define BROKER_SERVICE_CHECKS           4       /* DONE */
00044 #define BROKER_HOST_CHECKS              8       /* DONE */
00045 #define BROKER_EVENT_HANDLERS           16      /* DONE */
00046 #define BROKER_LOGGED_DATA              32      /* DONE */
00047 #define BROKER_NOTIFICATIONS            64      /* DONE */
00048 #define BROKER_FLAPPING_DATA            128     /* DONE */
00049 #define BROKER_COMMENT_DATA             256     /* DONE */
00050 #define BROKER_DOWNTIME_DATA            512     /* DONE */
00051 #define BROKER_SYSTEM_COMMANDS          1024    /* DONE */
00052 #define BROKER_OCP_DATA                 2048    /* DONE */
00053 #define BROKER_STATUS_DATA              4096    /* DONE */
00054 #define BROKER_ADAPTIVE_DATA            8192    /* DONE */
00055 #define BROKER_EXTERNALCOMMAND_DATA     16384   /* DONE */
00056 #define BROKER_RETENTION_DATA           32768   /* DONE */
00057 #define BROKER_ACKNOWLEDGEMENT_DATA     65536  
00058 #define BROKER_STATECHANGE_DATA         131072
00059 #define BROKER_RESERVED18               262144
00060 #define BROKER_RESERVED19               524288
00061 
00062 
00063 /****** EVENT TYPES ************************/
00064 
00065 #define NEBTYPE_NONE                          0
00066 
00067 #define NEBTYPE_HELLO                            1
00068 #define NEBTYPE_GOODBYE                          2
00069 #define NEBTYPE_INFO                             3
00070 
00071 #define NEBTYPE_PROCESS_START                    100
00072 #define NEBTYPE_PROCESS_DAEMONIZE                101
00073 #define NEBTYPE_PROCESS_RESTART                  102
00074 #define NEBTYPE_PROCESS_SHUTDOWN                 103
00075 #define NEBTYPE_PROCESS_PRELAUNCH                104   /* before objects are read or verified */
00076 #define NEBTYPE_PROCESS_EVENTLOOPSTART           105
00077 #define NEBTYPE_PROCESS_EVENTLOOPEND             106
00078 
00079 #define NEBTYPE_TIMEDEVENT_ADD                   200
00080 #define NEBTYPE_TIMEDEVENT_REMOVE                201
00081 #define NEBTYPE_TIMEDEVENT_EXECUTE               202
00082 #define NEBTYPE_TIMEDEVENT_DELAY                 203   /* NOT IMPLEMENTED */
00083 #define NEBTYPE_TIMEDEVENT_SKIP                  204   /* NOT IMPLEMENTED */
00084 #define NEBTYPE_TIMEDEVENT_SLEEP                 205
00085 
00086 #define NEBTYPE_LOG_DATA                         300
00087 #define NEBTYPE_LOG_ROTATION                     301
00088 
00089 #define NEBTYPE_SYSTEM_COMMAND_START             400
00090 #define NEBTYPE_SYSTEM_COMMAND_END               401
00091 
00092 #define NEBTYPE_EVENTHANDLER_START               500
00093 #define NEBTYPE_EVENTHANDLER_END                 501
00094 
00095 #define NEBTYPE_NOTIFICATION_START               600
00096 #define NEBTYPE_NOTIFICATION_END                 601
00097 #define NEBTYPE_CONTACTNOTIFICATION_START        602
00098 #define NEBTYPE_CONTACTNOTIFICATION_END          603
00099 #define NEBTYPE_CONTACTNOTIFICATIONMETHOD_START  604
00100 #define NEBTYPE_CONTACTNOTIFICATIONMETHOD_END    605
00101 
00102 #define NEBTYPE_SERVICECHECK_INITIATE            700
00103 #define NEBTYPE_SERVICECHECK_PROCESSED           701
00104 #define NEBTYPE_SERVICECHECK_RAW_START           702   /* NOT IMPLEMENTED */
00105 #define NEBTYPE_SERVICECHECK_RAW_END             703   /* NOT IMPLEMENTED */
00106 #define NEBTYPE_SERVICECHECK_ASYNC_PRECHECK      704
00107 
00108 #define NEBTYPE_HOSTCHECK_INITIATE               800   /* a check of the route to the host has been initiated */
00109 #define NEBTYPE_HOSTCHECK_PROCESSED              801   /* the processed/final result of a host check */
00110 #define NEBTYPE_HOSTCHECK_RAW_START              802   /* the start of a "raw" host check */
00111 #define NEBTYPE_HOSTCHECK_RAW_END                803   /* a finished "raw" host check */
00112 #define NEBTYPE_HOSTCHECK_ASYNC_PRECHECK         804
00113 #define NEBTYPE_HOSTCHECK_SYNC_PRECHECK          805
00114 
00115 #define NEBTYPE_COMMENT_ADD                      900
00116 #define NEBTYPE_COMMENT_DELETE                   901
00117 #define NEBTYPE_COMMENT_LOAD                     902
00118 
00119 #define NEBTYPE_FLAPPING_START                   1000
00120 #define NEBTYPE_FLAPPING_STOP                    1001
00121 
00122 #define NEBTYPE_DOWNTIME_ADD                     1100
00123 #define NEBTYPE_DOWNTIME_DELETE                  1101
00124 #define NEBTYPE_DOWNTIME_LOAD                    1102
00125 #define NEBTYPE_DOWNTIME_START                   1103
00126 #define NEBTYPE_DOWNTIME_STOP                    1104
00127 
00128 #define NEBTYPE_PROGRAMSTATUS_UPDATE             1200
00129 #define NEBTYPE_HOSTSTATUS_UPDATE                1201
00130 #define NEBTYPE_SERVICESTATUS_UPDATE             1202
00131 #define NEBTYPE_CONTACTSTATUS_UPDATE             1203
00132 
00133 #define NEBTYPE_ADAPTIVEPROGRAM_UPDATE           1300
00134 #define NEBTYPE_ADAPTIVEHOST_UPDATE              1301
00135 #define NEBTYPE_ADAPTIVESERVICE_UPDATE           1302
00136 #define NEBTYPE_ADAPTIVECONTACT_UPDATE           1303
00137 
00138 #define NEBTYPE_EXTERNALCOMMAND_START            1400
00139 #define NEBTYPE_EXTERNALCOMMAND_END              1401
00140 
00141 #define NEBTYPE_AGGREGATEDSTATUS_STARTDUMP       1500
00142 #define NEBTYPE_AGGREGATEDSTATUS_ENDDUMP         1501
00143 
00144 #define NEBTYPE_RETENTIONDATA_STARTLOAD          1600
00145 #define NEBTYPE_RETENTIONDATA_ENDLOAD            1601
00146 #define NEBTYPE_RETENTIONDATA_STARTSAVE          1602
00147 #define NEBTYPE_RETENTIONDATA_ENDSAVE            1603
00148 
00149 #define NEBTYPE_ACKNOWLEDGEMENT_ADD              1700
00150 #define NEBTYPE_ACKNOWLEDGEMENT_REMOVE           1701   /* NOT IMPLEMENTED */
00151 #define NEBTYPE_ACKNOWLEDGEMENT_LOAD             1702   /* NOT IMPLEMENTED */
00152 
00153 #define NEBTYPE_STATECHANGE_START                1800   /* NOT IMPLEMENTED */
00154 #define NEBTYPE_STATECHANGE_END                  1801
00155 
00156 
00157 
00158 /****** EVENT FLAGS ************************/
00159 
00160 #define NEBFLAG_NONE                          0
00161 #define NEBFLAG_PROCESS_INITIATED             1         /* event was initiated by Icinga process */
00162 #define NEBFLAG_USER_INITIATED                2         /* event was initiated by a user request */
00163 #define NEBFLAG_MODULE_INITIATED              3         /* event was initiated by an event broker module */
00164 
00165 
00166 
00167 
00168 /****** EVENT ATTRIBUTES *******************/
00169 
00170 #define NEBATTR_NONE                          0
00171 
00172 #define NEBATTR_SHUTDOWN_NORMAL               1
00173 #define NEBATTR_SHUTDOWN_ABNORMAL             2
00174 #define NEBATTR_RESTART_NORMAL                4
00175 #define NEBATTR_RESTART_ABNORMAL              8
00176 
00177 #define NEBATTR_FLAPPING_STOP_NORMAL          1
00178 #define NEBATTR_FLAPPING_STOP_DISABLED        2         /* flapping stopped because flap detection was disabled */
00179 
00180 #define NEBATTR_DOWNTIME_STOP_NORMAL          1
00181 #define NEBATTR_DOWNTIME_STOP_CANCELLED       2
00182 
00183 
00184 
00185 /****** EVENT BROKER FUNCTIONS *************/
00186 
00187 #ifdef USE_EVENT_BROKER
00188 struct timeval get_broker_timestamp(struct timeval *);
00189 void broker_program_state(int,int,int,struct timeval *);
00190 void broker_timed_event(int,int,int,timed_event *,struct timeval *);
00191 void broker_log_data(int,int,int,char *,unsigned long,time_t,struct timeval *);
00192 int broker_event_handler(int,int,int,int,void *,int,int,struct timeval,struct timeval,double,int,int,int,char *,char *,char *,struct timeval *);
00193 void broker_ocp_data(int,int,int,void *,int,int,double,int,int,struct timeval *);
00194 void broker_system_command(int,int,int,struct timeval,struct timeval,double,int,int,int,char *,char *,struct timeval *);
00195 int broker_host_check(int,int,int,host *,int,int,int,struct timeval,struct timeval,char *,double,double,int,int,int,char *,char *,char *,char *,struct timeval *);
00196 int broker_service_check(int,int,int,service *,int,struct timeval,struct timeval,char *,double,double,int,int,int,char *,struct timeval *);
00197 void broker_comment_data(int,int,int,int,int,char *,char *,time_t,char *,char *,int,int,int,time_t,unsigned long,struct timeval *);
00198 void broker_downtime_data(int,int,int,int,char *,char *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long,unsigned long,struct timeval *);
00199 void broker_flapping_data(int,int,int,int,void *,double,double,double,struct timeval *);
00200 void broker_program_status(int,int,int,struct timeval *);
00201 void broker_host_status(int,int,int,host *,struct timeval *);
00202 void broker_service_status(int,int,int,service *,struct timeval *);
00203 void broker_contact_status(int,int,int,contact *,struct timeval *);
00204 int broker_notification_data(int,int,int,int,int,struct timeval,struct timeval,void *,char *,char *,int,int,struct timeval *);
00205 int broker_contact_notification_data(int,int,int,int,int,struct timeval,struct timeval,void *,contact *,char *,char *,int,struct timeval *);
00206 int broker_contact_notification_method_data(int,int,int,int,int,struct timeval,struct timeval,void *,contact *,char *,char *,char *,int,struct timeval *);
00207 void broker_adaptive_program_data(int,int,int,int,unsigned long,unsigned long,unsigned long,unsigned long,struct timeval *);
00208 void broker_adaptive_host_data(int,int,int,host *,int,unsigned long,unsigned long,struct timeval *);
00209 void broker_adaptive_service_data(int,int,int,service *,int,unsigned long,unsigned long,struct timeval *);
00210 void broker_adaptive_contact_data(int,int,int,contact *,int,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long,unsigned long, struct timeval *);
00211 void broker_external_command(int,int,int,int,time_t,char *,char *,struct timeval *);
00212 void broker_aggregated_status_data(int,int,int,struct timeval *);
00213 void broker_retention_data(int,int,int,struct timeval *);
00214 void broker_acknowledgement_data(int,int,int,int,void *,char *,char *,int,int,int,struct timeval *);
00215 void broker_statechange_data(int,int,int,int,void *,int,int,int,int,struct timeval *);
00216 #endif
00217 
00218 
00219 #ifdef __cplusplus
00220   }
00221 #endif
00222 
00223 #endif

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