![]() |
Icinga-core 1.4.0
next gen monitoring
|
00001 /************************************************************************ 00002 * 00003 * IDOMOD.H - IDO NEB Module Include File 00004 * Copyright (c) 2005-2006 Ethan Galstad 00005 * Copyright (c) 2009-2011 Icinga Development Team (http://www.icinga.org) 00006 * 00007 ************************************************************************/ 00008 00009 #ifndef _NDBXT_IDOMOD_H 00010 #define _NDBXT_IDOMOD_H 00011 00012 #define IDOMOD_VERSION "1.4.0" 00013 #define IDOMOD_NAME "IDOMOD" 00014 #define IDOMOD_DATE "05-11-2011" 00015 00016 /************** misc definitions *************/ 00017 00018 /* this is needed for access to daemon's internal data */ 00019 #define NSCORE 1 00020 00021 #define IDOMOD_MAX_BUFLEN 49152 00022 00023 /************** structures *******************/ 00024 00025 typedef struct idomod_sink_buffer_struct{ 00026 char **buffer; 00027 unsigned long size; 00028 unsigned long head; 00029 unsigned long tail; 00030 unsigned long items; 00031 unsigned long maxitems; 00032 unsigned long overflow; 00033 }idomod_sink_buffer; 00034 00035 00036 /************* types of process data ***********/ 00037 00038 #define IDOMOD_PROCESS_PROCESS_DATA 1 00039 #define IDOMOD_PROCESS_TIMED_EVENT_DATA 2 00040 #define IDOMOD_PROCESS_LOG_DATA 4 00041 #define IDOMOD_PROCESS_SYSTEM_COMMAND_DATA 8 00042 #define IDOMOD_PROCESS_EVENT_HANDLER_DATA 16 00043 #define IDOMOD_PROCESS_NOTIFICATION_DATA 32 00044 #define IDOMOD_PROCESS_SERVICE_CHECK_DATA 64 00045 #define IDOMOD_PROCESS_HOST_CHECK_DATA 128 00046 #define IDOMOD_PROCESS_COMMENT_DATA 256 00047 #define IDOMOD_PROCESS_DOWNTIME_DATA 512 00048 #define IDOMOD_PROCESS_FLAPPING_DATA 1024 00049 #define IDOMOD_PROCESS_PROGRAM_STATUS_DATA 2048 00050 #define IDOMOD_PROCESS_HOST_STATUS_DATA 4096 00051 #define IDOMOD_PROCESS_SERVICE_STATUS_DATA 8192 00052 #define IDOMOD_PROCESS_ADAPTIVE_PROGRAM_DATA 16384 00053 #define IDOMOD_PROCESS_ADAPTIVE_HOST_DATA 32768 00054 #define IDOMOD_PROCESS_ADAPTIVE_SERVICE_DATA 65536 00055 #define IDOMOD_PROCESS_EXTERNAL_COMMAND_DATA 131072 00056 #define IDOMOD_PROCESS_OBJECT_CONFIG_DATA 262144 00057 #define IDOMOD_PROCESS_MAIN_CONFIG_DATA 524288 00058 #define IDOMOD_PROCESS_AGGREGATED_STATUS_DATA 1048576 00059 #define IDOMOD_PROCESS_RETENTION_DATA 2097152 00060 #define IDOMOD_PROCESS_ACKNOWLEDGEMENT_DATA 4194304 00061 #define IDOMOD_PROCESS_STATECHANGE_DATA 8388608 00062 #define IDOMOD_PROCESS_CONTACT_STATUS_DATA 16777216 00063 #define IDOMOD_PROCESS_ADAPTIVE_CONTACT_DATA 33554432 00064 00065 #define IDOMOD_PROCESS_EVERYTHING 67108863 00066 00067 00068 /************* types of config dump ************/ 00069 00070 #define IDOMOD_CONFIG_DUMP_NONE 0 00071 #define IDOMOD_CONFIG_DUMP_ORIGINAL 1 00072 #define IDOMOD_CONFIG_DUMP_RETAINED 2 00073 #define IDOMOD_CONFIG_DUMP_ALL 3 00074 00075 00076 /************* debugging levels ****************/ 00077 00078 #define IDOMOD_DEBUGL_ALL -1 00079 #define IDOMOD_DEBUGL_NONE 0 00080 #define IDOMOD_DEBUGL_PROCESSINFO 1 00081 #define IDOMOD_DEBUGL_SQL 2 00082 00083 #define IDOMOD_DEBUGV_BASIC 0 00084 #define IDOMOD_DEBUGV_MORE 1 00085 #define IDOMOD_DEBUGV_MOST 2 00086 00087 00088 /************* functions ***********************/ 00089 00090 int nebmodule_init(int,char *,void *); 00091 int nebmodule_deinit(int,int); 00092 00093 int idomod_init(void); 00094 int idomod_deinit(void); 00095 00096 int idomod_check_icinga_object_version(void); 00097 00098 int idomod_write_to_logs(char *,int); 00099 00100 int idomod_process_module_args(char *); 00101 int idomod_process_config_var(char *); 00102 int idomod_process_config_file(char *); 00103 00104 int idomod_open_sink(void); 00105 int idomod_close_sink(void); 00106 int idomod_write_to_sink(char *,int,int); 00107 int idomod_rotate_sink_file(void *); 00108 int idomod_hello_sink(int,int); 00109 int idomod_goodbye_sink(void); 00110 00111 int idomod_sink_buffer_init(idomod_sink_buffer *sbuf,unsigned long); 00112 int idomod_sink_buffer_deinit(idomod_sink_buffer *sbuf); 00113 int idomod_sink_buffer_push(idomod_sink_buffer *sbuf,char *); 00114 char *idomod_sink_buffer_peek(idomod_sink_buffer *sbuf); 00115 char *idomod_sink_buffer_pop(idomod_sink_buffer *sbuf); 00116 int idomod_sink_buffer_items(idomod_sink_buffer *sbuf); 00117 unsigned long idomod_sink_buffer_get_overflow(idomod_sink_buffer *sbuf); 00118 int idomod_sink_buffer_set_overflow(idomod_sink_buffer *sbuf,unsigned long); 00119 00120 int idomod_load_unprocessed_data(char *); 00121 int idomod_save_unprocessed_data(char *); 00122 00123 int idomod_register_callbacks(void); 00124 int idomod_deregister_callbacks(void); 00125 00126 int idomod_broker_data(int,void *); 00127 00128 int idomod_write_config(int); 00129 int idomod_write_object_config(int); 00130 00131 int idomod_write_config_files(void); 00132 int idomod_write_main_config_file(void); 00133 int idomod_write_resource_config_files(void); 00134 int idomod_write_resource_config_file(char *); 00135 00136 int idomod_write_runtime_variables(void); 00137 00138 int idomod_log_debug_info(int , int , const char *, ...); 00139 00140 #endif