00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef INCLUDE_logging_h__
00027 #define INCLUDE_logging_h__
00028
00029 #include "objects.h"
00030
00031
00032
00033 #define NSLOG_RUNTIME_ERROR 1
00034 #define NSLOG_RUNTIME_WARNING 2
00035
00036 #define NSLOG_VERIFICATION_ERROR 4
00037 #define NSLOG_VERIFICATION_WARNING 8
00038
00039 #define NSLOG_CONFIG_ERROR 16
00040 #define NSLOG_CONFIG_WARNING 32
00041
00042 #define NSLOG_PROCESS_INFO 64
00043 #define NSLOG_EVENT_HANDLER 128
00044
00045 #define NSLOG_EXTERNAL_COMMAND 512
00046
00047 #define NSLOG_HOST_UP 1024
00048 #define NSLOG_HOST_DOWN 2048
00049 #define NSLOG_HOST_UNREACHABLE 4096
00050
00051 #define NSLOG_SERVICE_OK 8192
00052 #define NSLOG_SERVICE_UNKNOWN 16384
00053 #define NSLOG_SERVICE_WARNING 32768
00054 #define NSLOG_SERVICE_CRITICAL 65536
00055
00056 #define NSLOG_PASSIVE_CHECK 131072
00057
00058 #define NSLOG_INFO_MESSAGE 262144
00059
00060 #define NSLOG_HOST_NOTIFICATION 524288
00061 #define NSLOG_SERVICE_NOTIFICATION 1048576
00062
00063
00064
00065 #define DEBUGL_ALL -1
00066 #define DEBUGL_NONE 0
00067 #define DEBUGL_FUNCTIONS 1
00068 #define DEBUGL_CONFIG 2
00069 #define DEBUGL_PROCESS 4
00070 #define DEBUGL_STATUSDATA 4
00071 #define DEBUGL_RETENTIONDATA 4
00072 #define DEBUGL_EVENTS 8
00073 #define DEBUGL_CHECKS 16
00074 #define DEBUGL_IPC 16
00075 #define DEBUGL_FLAPPING 16
00076 #define DEBUGL_EVENTHANDLERS 16
00077 #define DEBUGL_PERFDATA 16
00078 #define DEBUGL_NOTIFICATIONS 32
00079 #define DEBUGL_EVENTBROKER 64
00080 #define DEBUGL_EXTERNALCOMMANDS 128
00081 #define DEBUGL_COMMANDS 256
00082 #define DEBUGL_DOWNTIME 512
00083 #define DEBUGL_COMMENTS 1024
00084 #define DEBUGL_MACROS 2048
00085
00086 #define DEBUGV_BASIC 0
00087 #define DEBUGV_MORE 1
00088 #define DEBUGV_MOST 2
00089
00090
00091
00092 void logit(int,int,const char *, ...)
00093 __attribute__((__format__(__printf__, 3, 4)));
00094 int log_debug_info(int,int,const char *,...)
00095 __attribute__((__format__(__printf__, 3, 4)));
00096
00097 #ifndef NSCGI
00098 int write_to_all_logs(char *,unsigned long);
00099 int write_to_log(char *,unsigned long,time_t *);
00100 int write_to_syslog(char *,unsigned long);
00101 int log_service_event(service *);
00102 int log_host_event(host *);
00103 int log_host_states(int,time_t *);
00104 int log_service_states(int,time_t *);
00105 int rotate_log_file(time_t);
00106 int write_log_file_info(time_t *);
00107 int open_debug_log(void);
00108 int close_debug_log(void);
00109
00110 #endif
00111
00112 #endif
00113