broker.h

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

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