00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _NAGIOS_H
00022 #define _NAGIOS_H
00023
00024 #include "config.h"
00025 #include "common.h"
00026 #include "locations.h"
00027 #include "objects.h"
00028
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032
00033 #define MAX_COMMAND_ARGUMENTS 32
00034 #define MAX_USER_MACROS 256
00035
00036 #define MAX_STATE_LENGTH 32
00037 #define MAX_STATETYPE_LENGTH 24
00038 #define MAX_CHECKTYPE_LENGTH 8
00039 #define MAX_NOTIFICATIONTYPE_LENGTH 32
00040 #define MAX_NOTIFICATIONNUMBER_LENGTH 8
00041 #define MAX_ATTEMPT_LENGTH 8
00042 #define MAX_TOTALS_LENGTH 8
00043 #define MAX_EXECUTIONTIME_LENGTH 10
00044 #define MAX_LATENCY_LENGTH 10
00045 #define MAX_DURATION_LENGTH 17
00046 #define MAX_DOWNTIME_LENGTH 3
00047 #define MAX_STATEID_LENGTH 2
00048 #define MAX_PERCENTCHANGE_LENGTH 8
00049
00050 #define MACRO_ENV_VAR_PREFIX "NAGIOS_"
00051
00052 #define MACRO_X_COUNT 99
00053
00054 #define MACRO_HOSTNAME 0
00055 #define MACRO_HOSTALIAS 1
00056 #define MACRO_HOSTADDRESS 2
00057 #define MACRO_SERVICEDESC 3
00058 #define MACRO_SERVICESTATE 4
00059 #define MACRO_SERVICESTATEID 5
00060 #define MACRO_SERVICEATTEMPT 6
00061 #define MACRO_LONGDATETIME 7
00062 #define MACRO_SHORTDATETIME 8
00063 #define MACRO_DATE 9
00064 #define MACRO_TIME 10
00065 #define MACRO_TIMET 11
00066 #define MACRO_LASTHOSTCHECK 12
00067 #define MACRO_LASTSERVICECHECK 13
00068 #define MACRO_LASTHOSTSTATECHANGE 14
00069 #define MACRO_LASTSERVICESTATECHANGE 15
00070 #define MACRO_HOSTOUTPUT 16
00071 #define MACRO_SERVICEOUTPUT 17
00072 #define MACRO_HOSTPERFDATA 18
00073 #define MACRO_SERVICEPERFDATA 19
00074 #define MACRO_CONTACTNAME 20
00075 #define MACRO_CONTACTALIAS 21
00076 #define MACRO_CONTACTEMAIL 22
00077 #define MACRO_CONTACTPAGER 23
00078 #define MACRO_ADMINEMAIL 24
00079 #define MACRO_ADMINPAGER 25
00080 #define MACRO_HOSTSTATE 26
00081 #define MACRO_HOSTSTATEID 27
00082 #define MACRO_HOSTATTEMPT 28
00083 #define MACRO_NOTIFICATIONTYPE 29
00084 #define MACRO_NOTIFICATIONNUMBER 30
00085 #define MACRO_HOSTEXECUTIONTIME 31
00086 #define MACRO_SERVICEEXECUTIONTIME 32
00087 #define MACRO_HOSTLATENCY 33
00088 #define MACRO_SERVICELATENCY 34
00089 #define MACRO_HOSTDURATION 35
00090 #define MACRO_SERVICEDURATION 36
00091 #define MACRO_HOSTDURATIONSEC 37
00092 #define MACRO_SERVICEDURATIONSEC 38
00093 #define MACRO_HOSTDOWNTIME 39
00094 #define MACRO_SERVICEDOWNTIME 40
00095 #define MACRO_HOSTSTATETYPE 41
00096 #define MACRO_SERVICESTATETYPE 42
00097 #define MACRO_HOSTPERCENTCHANGE 43
00098 #define MACRO_SERVICEPERCENTCHANGE 44
00099 #define MACRO_HOSTGROUPNAME 45
00100 #define MACRO_HOSTGROUPALIAS 46
00101 #define MACRO_SERVICEGROUPNAME 47
00102 #define MACRO_SERVICEGROUPALIAS 48
00103 #define MACRO_HOSTACKAUTHOR 49
00104 #define MACRO_HOSTACKCOMMENT 50
00105 #define MACRO_SERVICEACKAUTHOR 51
00106 #define MACRO_SERVICEACKCOMMENT 52
00107 #define MACRO_LASTSERVICEOK 53
00108 #define MACRO_LASTSERVICEWARNING 54
00109 #define MACRO_LASTSERVICEUNKNOWN 55
00110 #define MACRO_LASTSERVICECRITICAL 56
00111 #define MACRO_LASTHOSTUP 57
00112 #define MACRO_LASTHOSTDOWN 58
00113 #define MACRO_LASTHOSTUNREACHABLE 59
00114 #define MACRO_SERVICECHECKCOMMAND 60
00115 #define MACRO_HOSTCHECKCOMMAND 61
00116 #define MACRO_MAINCONFIGFILE 62
00117 #define MACRO_STATUSDATAFILE 63
00118 #define MACRO_COMMENTDATAFILE 64
00119 #define MACRO_DOWNTIMEDATAFILE 65
00120 #define MACRO_RETENTIONDATAFILE 66
00121 #define MACRO_OBJECTCACHEFILE 67
00122 #define MACRO_TEMPFILE 68
00123 #define MACRO_LOGFILE 69
00124 #define MACRO_RESOURCEFILE 70
00125 #define MACRO_COMMANDFILE 71
00126 #define MACRO_HOSTPERFDATAFILE 72
00127 #define MACRO_SERVICEPERFDATAFILE 73
00128 #define MACRO_HOSTACTIONURL 74
00129 #define MACRO_HOSTNOTESURL 75
00130 #define MACRO_HOSTNOTES 76
00131 #define MACRO_SERVICEACTIONURL 77
00132 #define MACRO_SERVICENOTESURL 78
00133 #define MACRO_SERVICENOTES 79
00134 #define MACRO_TOTALHOSTSUP 80
00135 #define MACRO_TOTALHOSTSDOWN 81
00136 #define MACRO_TOTALHOSTSUNREACHABLE 82
00137 #define MACRO_TOTALHOSTSDOWNUNHANDLED 83
00138 #define MACRO_TOTALHOSTSUNREACHABLEUNHANDLED 84
00139 #define MACRO_TOTALHOSTPROBLEMS 85
00140 #define MACRO_TOTALHOSTPROBLEMSUNHANDLED 86
00141 #define MACRO_TOTALSERVICESOK 87
00142 #define MACRO_TOTALSERVICESWARNING 88
00143 #define MACRO_TOTALSERVICESCRITICAL 89
00144 #define MACRO_TOTALSERVICESUNKNOWN 90
00145 #define MACRO_TOTALSERVICESWARNINGUNHANDLED 91
00146 #define MACRO_TOTALSERVICESCRITICALUNHANDLED 92
00147 #define MACRO_TOTALSERVICESUNKNOWNUNHANDLED 93
00148 #define MACRO_TOTALSERVICEPROBLEMS 94
00149 #define MACRO_TOTALSERVICEPROBLEMSUNHANDLED 95
00150 #define MACRO_PROCESSSTARTTIME 96
00151 #define MACRO_HOSTCHECKTYPE 97
00152 #define MACRO_SERVICECHECKTYPE 98
00153
00154
00155
00156 #define DEFAULT_LOG_LEVEL 1
00157 #define DEFAULT_USE_SYSLOG 1
00158 #define DEFAULT_SYSLOG_LEVEL 2
00159
00160 #define DEFAULT_NOTIFICATION_LOGGING 1
00161
00162 #define DEFAULT_INTER_CHECK_DELAY 5.0
00163 #define DEFAULT_INTERLEAVE_FACTOR 1
00164 #define DEFAULT_SLEEP_TIME 0.5
00165 #define DEFAULT_INTERVAL_LENGTH 60
00166 #define DEFAULT_RETRY_INTERVAL 30
00167 #define DEFAULT_COMMAND_CHECK_INTERVAL -1
00168 #define DEFAULT_SERVICE_REAPER_INTERVAL 10
00169 #define DEFAULT_MAX_REAPER_TIME 30
00170 #define DEFAULT_MAX_PARALLEL_SERVICE_CHECKS 0
00171 #define DEFAULT_RETENTION_UPDATE_INTERVAL 60
00172 #define DEFAULT_RETENTION_SCHEDULING_HORIZON 900
00173 #define DEFAULT_STATUS_UPDATE_INTERVAL 60
00174 #define DEFAULT_FRESHNESS_CHECK_INTERVAL 60
00175 #define DEFAULT_AUTO_RESCHEDULING_INTERVAL 30
00176 #define DEFAULT_AUTO_RESCHEDULING_WINDOW 180
00177
00178 #define DEFAULT_NOTIFICATION_TIMEOUT 30
00179 #define DEFAULT_EVENT_HANDLER_TIMEOUT 30
00180 #define DEFAULT_HOST_CHECK_TIMEOUT 30
00181 #define DEFAULT_SERVICE_CHECK_TIMEOUT 60
00182 #define DEFAULT_OCSP_TIMEOUT 15
00183 #define DEFAULT_OCHP_TIMEOUT 15
00184 #define DEFAULT_PERFDATA_TIMEOUT 5
00185 #define DEFAULT_TIME_CHANGE_THRESHOLD 900
00186
00187 #define DEFAULT_LOG_HOST_RETRIES 0
00188 #define DEFAULT_LOG_SERVICE_RETRIES 0
00189 #define DEFAULT_LOG_EVENT_HANDLERS 1
00190 #define DEFAULT_LOG_INITIAL_STATES 0
00191 #define DEFAULT_LOG_EXTERNAL_COMMANDS 1
00192 #define DEFAULT_LOG_PASSIVE_CHECKS 1
00193
00194 #define DEFAULT_AGGRESSIVE_HOST_CHECKING 0
00195 #define DEFAULT_CHECK_EXTERNAL_COMMANDS 0
00196 #define DEFAULT_CHECK_ORPHANED_SERVICES 1
00197 #define DEFAULT_ENABLE_FLAP_DETECTION 0
00198 #define DEFAULT_PROCESS_PERFORMANCE_DATA 0
00199 #define DEFAULT_CHECK_SERVICE_FRESHNESS 1
00200 #define DEFAULT_CHECK_HOST_FRESHNESS 0
00201 #define DEFAULT_AUTO_RESCHEDULE_CHECKS 0
00202
00203 #define DEFAULT_LOW_SERVICE_FLAP_THRESHOLD 20.0
00204 #define DEFAULT_HIGH_SERVICE_FLAP_THRESHOLD 30.0
00205 #define DEFAULT_LOW_HOST_FLAP_THRESHOLD 20.0
00206 #define DEFAULT_HIGH_HOST_FLAP_THRESHOLD 30.0
00207
00208 #define DEFAULT_HOST_CHECK_SPREAD 30
00209 #define DEFAULT_SERVICE_CHECK_SPREAD 30
00210
00211
00212
00213
00214
00215 #define NSLOG_RUNTIME_ERROR 1
00216 #define NSLOG_RUNTIME_WARNING 2
00217
00218 #define NSLOG_VERIFICATION_ERROR 4
00219 #define NSLOG_VERIFICATION_WARNING 8
00220
00221 #define NSLOG_CONFIG_ERROR 16
00222 #define NSLOG_CONFIG_WARNING 32
00223
00224 #define NSLOG_PROCESS_INFO 64
00225 #define NSLOG_EVENT_HANDLER 128
00226
00227 #define NSLOG_EXTERNAL_COMMAND 512
00228
00229 #define NSLOG_HOST_UP 1024
00230 #define NSLOG_HOST_DOWN 2048
00231 #define NSLOG_HOST_UNREACHABLE 4096
00232
00233 #define NSLOG_SERVICE_OK 8192
00234 #define NSLOG_SERVICE_UNKNOWN 16384
00235 #define NSLOG_SERVICE_WARNING 32768
00236 #define NSLOG_SERVICE_CRITICAL 65536
00237
00238 #define NSLOG_PASSIVE_CHECK 131072
00239
00240 #define NSLOG_INFO_MESSAGE 262144
00241
00242 #define NSLOG_HOST_NOTIFICATION 524288
00243 #define NSLOG_SERVICE_NOTIFICATION 1048576
00244
00245
00246
00247
00248 #define HOST_UP 0
00249 #define HOST_DOWN 1
00250 #define HOST_UNREACHABLE 2
00251
00252
00253
00254
00255 #define INITIAL_STATES 1
00256 #define CURRENT_STATES 2
00257
00258
00259
00260
00261 #define DEPENDENCIES_OK 0
00262 #define DEPENDENCIES_FAILED 1
00263
00264
00265
00266
00267 #define PROPAGATE_TO_PARENT_HOSTS 1
00268 #define PROPAGATE_TO_CHILD_HOSTS 2
00269
00270
00271
00272
00273 #define STATE_OK 0
00274 #define STATE_WARNING 1
00275 #define STATE_CRITICAL 2
00276 #define STATE_UNKNOWN 3
00277
00278
00279
00280
00281 #define HOST_FLAPPING 0
00282 #define SERVICE_FLAPPING 1
00283
00284
00285
00286
00287 #define HOST_NOTIFICATION 0
00288 #define SERVICE_NOTIFICATION 1
00289
00290
00291
00292
00293 #define NOTIFICATION_NORMAL 0
00294 #define NOTIFICATION_ACKNOWLEDGEMENT 1
00295 #define NOTIFICATION_FLAPPINGSTART 2
00296 #define NOTIFICATION_FLAPPINGSTOP 3
00297
00298
00299
00300
00301 #define HOST_EVENTHANDLER 0
00302 #define SERVICE_EVENTHANDLER 1
00303 #define GLOBAL_HOST_EVENTHANDLER 2
00304 #define GLOBAL_SERVICE_EVENTHANDLER 3
00305
00306
00307
00308
00309 #define HOST_STATECHANGE 0
00310 #define SERVICE_STATECHANGE 1
00311
00312
00313
00314
00315 #define EVENT_SERVICE_CHECK 0
00316 #define EVENT_COMMAND_CHECK 1
00317 #define EVENT_LOG_ROTATION 2
00318 #define EVENT_PROGRAM_SHUTDOWN 3
00319 #define EVENT_PROGRAM_RESTART 4
00320 #define EVENT_SERVICE_REAPER 5
00321 #define EVENT_ORPHAN_CHECK 6
00322 #define EVENT_RETENTION_SAVE 7
00323 #define EVENT_STATUS_SAVE 8
00324 #define EVENT_SCHEDULED_DOWNTIME 9
00325 #define EVENT_SFRESHNESS_CHECK 10
00326 #define EVENT_EXPIRE_DOWNTIME 11
00327 #define EVENT_HOST_CHECK 12
00328 #define EVENT_HFRESHNESS_CHECK 13
00329 #define EVENT_RESCHEDULE_CHECKS 14
00330 #define EVENT_EXPIRE_COMMENT 15
00331 #define EVENT_SLEEP 98
00332 #define EVENT_USER_FUNCTION 99
00333
00334
00335
00336
00337 #define ICD_NONE 0
00338 #define ICD_DUMB 1
00339 #define ICD_SMART 2
00340 #define ICD_USER 3
00341
00342
00343
00344
00345 #define ILF_USER 0
00346 #define ILF_SMART 1
00347
00348
00349
00350
00351 #define CHECK_OPTION_NONE 0
00352 #define CHECK_OPTION_FORCE_EXECUTION 1
00353
00354
00355
00356
00357 #define ACTIVE_DOWNTIME 0
00358 #define PENDING_DOWNTIME 1
00359
00360
00361
00362
00363 #define STRIP_ILLEGAL_MACRO_CHARS 1
00364 #define ESCAPE_MACRO_CHARS 2
00365 #define URL_ENCODE_MACRO_CHARS 4
00366
00367
00368
00369
00370
00371
00372 typedef struct timed_event_struct{
00373 int event_type;
00374 time_t run_time;
00375 int recurring;
00376 unsigned long event_interval;
00377 int compensate_for_time_change;
00378 void *timing_func;
00379 void *event_data;
00380 void *event_args;
00381 struct timed_event_struct *next;
00382 }timed_event;
00383
00384
00385
00386 typedef struct notify_list_struct{
00387 contact *contact;
00388 struct notify_list_struct *next;
00389 }notification;
00390
00391
00392
00393 typedef struct service_message_struct{
00394 char host_name[MAX_HOSTNAME_LENGTH];
00395 char description[MAX_SERVICEDESC_LENGTH];
00396 int return_code;
00397 int exited_ok;
00398 int check_type;
00399 int parallelized;
00400 struct timeval start_time;
00401 struct timeval finish_time;
00402 int early_timeout;
00403 char output[MAX_PLUGINOUTPUT_LENGTH];
00404 }service_message;
00405
00406
00407
00408 typedef struct sched_info_struct{
00409 int total_services;
00410 int total_scheduled_services;
00411 int total_hosts;
00412 int total_scheduled_hosts;
00413 double average_services_per_host;
00414 double average_scheduled_services_per_host;
00415 unsigned long service_check_interval_total;
00416 unsigned long host_check_interval_total;
00417 double average_service_check_interval;
00418 double average_host_check_interval;
00419 double average_service_inter_check_delay;
00420 double average_host_inter_check_delay;
00421 double service_inter_check_delay;
00422 double host_inter_check_delay;
00423 int service_interleave_factor;
00424 int max_service_check_spread;
00425 int max_host_check_spread;
00426 time_t first_service_check;
00427 time_t last_service_check;
00428 time_t first_host_check;
00429 time_t last_host_check;
00430 }sched_info;
00431
00432
00433
00434 typedef struct passive_check_result_struct{
00435 char *host_name;
00436 char *svc_description;
00437 int return_code;
00438 char *output;
00439 time_t check_time;
00440 struct passive_check_result_struct *next;
00441 }passive_check_result;
00442
00443
00444
00445 typedef struct circular_buffer_struct{
00446 void **buffer;
00447 int tail;
00448 int head;
00449 int items;
00450 int high;
00451 unsigned long overflow;
00452 pthread_mutex_t buffer_lock;
00453 }circular_buffer;
00454
00455
00456
00457 typedef struct mmapfile_struct{
00458 char *path;
00459 int mode;
00460 int fd;
00461 unsigned long file_size;
00462 unsigned long current_position;
00463 unsigned long current_line;
00464 void *mmap_buf;
00465 }mmapfile;
00466
00467
00468
00469
00470 #define DEFAULT_EXTERNAL_COMMAND_BUFFER_SLOTS 4096
00471 #define DEFAULT_CHECK_RESULT_BUFFER_SLOTS 4096
00472
00473
00474 #define TOTAL_WORKER_THREADS 2
00475
00476 #define COMMAND_WORKER_THREAD 0
00477 #define SERVICE_WORKER_THREAD 1
00478
00479
00480
00481
00482
00483 int read_main_config_file(char *);
00484 int read_resource_file(char *);
00485 int read_all_object_data(char *);
00486
00487
00488
00489 int pre_flight_check(void);
00490 void init_timing_loop(void);
00491 void setup_sighandler(void);
00492 void reset_sighandler(void);
00493 int daemon_init(void);
00494 int drop_privileges(char *,char *);
00495 void display_scheduling_info(void);
00496
00497
00498
00499 int read_svc_message(service_message *);
00500 int write_svc_message(service_message *);
00501 int open_command_file(void);
00502 int close_command_file(void);
00503
00504
00505
00506 int schedule_new_event(int,int,time_t,int,unsigned long,void *,int,void *,void *);
00507 void reschedule_event(timed_event *,timed_event **);
00508 int deschedule_event(int,int,void *,void *);
00509 void add_event(timed_event *,timed_event **);
00510 void remove_event(timed_event *,timed_event **);
00511 int event_execution_loop(void);
00512 int handle_timed_event(timed_event *);
00513 void run_service_check(service *);
00514 void reap_service_checks(void);
00515 int check_service_dependencies(service *,int);
00516 int check_host_dependencies(host *,int);
00517 void check_for_orphaned_services(void);
00518 void check_service_result_freshness(void);
00519 void check_host_result_freshness(void);
00520 void adjust_check_scheduling(void);
00521 int my_system(char *,int,int *,double *,char *,int);
00522 void compensate_for_system_time_change(unsigned long,unsigned long);
00523 void adjust_timestamp_for_time_change(time_t,time_t,unsigned long,time_t *);
00524 void resort_event_list(timed_event **);
00525
00526
00527
00528 void check_for_service_flapping(service *,int);
00529 void check_for_host_flapping(host *,int);
00530 void set_service_flap(service *,double,double,double);
00531 void clear_service_flap(service *,double,double,double);
00532 void set_host_flap(host *,double,double,double);
00533 void clear_host_flap(host *,double,double,double);
00534 void enable_flap_detection_routines(void);
00535 void disable_flap_detection_routines(void);
00536 void enable_host_flap_detection(host *);
00537 void disable_host_flap_detection(host *);
00538 void enable_service_flap_detection(service *);
00539 void disable_service_flap_detection(service *);
00540
00541
00542
00543 int verify_route_to_host(host *,int);
00544 int run_scheduled_host_check(host *);
00545 int check_host(host *,int,int);
00546 int run_host_check(host *,int);
00547 int handle_host_state(host *);
00548
00549
00550
00551 int obsessive_compulsive_service_check_processor(service *);
00552 int obsessive_compulsive_host_check_processor(host *);
00553 int handle_service_event(service *);
00554 int run_service_event_handler(service *);
00555 int run_global_service_event_handler(service *);
00556 int handle_host_event(host *);
00557 int run_host_event_handler(host *);
00558 int run_global_host_event_handler(host *);
00559
00560
00561
00562 int check_service_notification_viability(service *,int);
00563 int is_valid_escalation_for_service_notification(service *,serviceescalation *);
00564 int should_service_notification_be_escalated(service *);
00565 int service_notification(service *,int,char *,char *);
00566 int check_contact_service_notification_viability(contact *,service *,int);
00567 int notify_contact_of_service(contact *,service *,int,char *,char *,int);
00568 int check_host_notification_viability(host *,int);
00569 int is_valid_host_escalation_for_host_notification(host *,hostescalation *);
00570 int should_host_notification_be_escalated(host *);
00571 int host_notification(host *,int,char *,char *);
00572 int check_contact_host_notification_viability(contact *,host *,int);
00573 int notify_contact_of_host(contact *,host *,int,char *,char *,int);
00574 int create_notification_list_from_host(host *,int *);
00575 int create_notification_list_from_service(service *,int *);
00576 int add_notification(contact *);
00577 notification * find_notification(char *);
00578 time_t get_next_host_notification_time(host *,time_t);
00579 time_t get_next_service_notification_time(service *,time_t);
00580
00581
00582
00583 int write_to_logs_and_console(char *,unsigned long,int);
00584 int write_to_console(char *);
00585 int write_to_all_logs(char *,unsigned long);
00586 int write_to_all_logs_with_timestamp(char *,unsigned long,time_t *);
00587 int write_to_log(char *,unsigned long,time_t *);
00588 int write_to_syslog(char *,unsigned long);
00589 int log_service_event(service *);
00590 int log_host_event(host *);
00591 int log_host_states(int,time_t *);
00592 int log_service_states(int,time_t *);
00593 int rotate_log_file(time_t);
00594 int write_log_file_info(time_t *);
00595
00596
00597
00598 void cleanup(void);
00599 void free_memory(void);
00600 int reset_variables(void);
00601 void free_notification_list(void);
00602
00603
00604
00605 int hashfunc1(const char *name1, int hashslots);
00606 int hashfunc2(const char *name1, const char *name2, int hashslots);
00607 int compare_hashdata1(const char *,const char *);
00608 int compare_hashdata2(const char *,const char *,const char *,const char *);
00609
00610
00611
00612 void sighandler(int);
00613 void service_check_sighandler(int);
00614 void my_system_sighandler(int);
00615 void file_lock_sighandler(int);
00616 void strip(char *);
00617 char *my_strtok(char *,char *);
00618 char *my_strsep(char **,const char *);
00619 char *get_url_encoded_string(char *);
00620 int contains_illegal_object_chars(char *);
00621 int my_rename(char *,char *);
00622 void get_raw_command_line(char *,char *,int,int);
00623 int check_time_against_period(time_t,char *);
00624 void get_next_valid_time(time_t, time_t *,char *);
00625 void get_datetime_string(time_t *,char *,int,int);
00626 time_t get_next_log_rotation_time(void);
00627 int init_embedded_perl(char **);
00628 int deinit_embedded_perl(void);
00629
00630
00631
00632 int process_macros(char *,char *,int,int);
00633 char *clean_macro_chars(char *,int);
00634 int grab_service_macros(service *);
00635 int grab_host_macros(host *);
00636 int grab_contact_macros(contact *);
00637 int grab_datetime_macros(void);
00638 int grab_summary_macros(contact *);
00639 int grab_on_demand_macro(char *);
00640 int grab_on_demand_host_macro(host *,char *);
00641 int grab_on_demand_service_macro(service *,char *);
00642 int clear_argv_macros(void);
00643 int clear_volatile_macros(void);
00644 int clear_nonvolatile_macros(void);
00645
00646
00647
00648 void check_for_external_commands(void);
00649 void process_external_command(int,time_t,char *);
00650 int process_host_command(int,time_t,char *);
00651 int process_hostgroup_command(int,time_t,char *);
00652 int process_service_command(int,time_t,char *);
00653 int process_servicegroup_command(int,time_t,char *);
00654
00655
00656
00657 int cmd_add_comment(int,time_t,char *);
00658 int cmd_delete_comment(int,char *);
00659 int cmd_delete_all_comments(int,char *);
00660 int cmd_delay_notification(int,char *);
00661 int cmd_schedule_service_check(int,char *,int);
00662 int cmd_schedule_check(int,char *);
00663 int cmd_schedule_host_service_checks(int,char *,int);
00664 int cmd_signal_process(int,char *);
00665 int cmd_process_service_check_result(int,time_t,char *);
00666 int cmd_process_host_check_result(int,time_t,char *);
00667 int cmd_acknowledge_problem(int,char *);
00668 int cmd_remove_acknowledgement(int,char *);
00669 int cmd_schedule_downtime(int,time_t,char *);
00670 int cmd_delete_downtime(int,char *);
00671 int cmd_change_command(int,char *);
00672 int cmd_change_check_interval(int,char *);
00673 int cmd_change_max_attempts(int,char *);
00674
00675 int process_passive_service_check(time_t,char *,char *,int,char *);
00676 int process_passive_host_check(time_t,char *,int,char *);
00677
00678
00679
00680 void disable_service_checks(service *);
00681 void enable_service_checks(service *);
00682 void schedule_service_check(service *,time_t,int);
00683 void schedule_host_check(host *,time_t,int);
00684 void enable_all_notifications(void);
00685 void disable_all_notifications(void);
00686 void enable_service_notifications(service *);
00687 void disable_service_notifications(service *);
00688 void enable_host_notifications(host *);
00689 void disable_host_notifications(host *);
00690 void enable_and_propagate_notifications(host *,int,int,int,int);
00691 void disable_and_propagate_notifications(host *,int,int,int,int);
00692 void schedule_and_propagate_downtime(host *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long);
00693 void acknowledge_host_problem(host *,char *,char *,int,int,int);
00694 void acknowledge_service_problem(service *,char *,char *,int,int,int);
00695 void remove_host_acknowledgement(host *);
00696 void remove_service_acknowledgement(service *);
00697 void start_executing_service_checks(void);
00698 void stop_executing_service_checks(void);
00699 void start_accepting_passive_service_checks(void);
00700 void stop_accepting_passive_service_checks(void);
00701 void enable_passive_service_checks(service *);
00702 void disable_passive_service_checks(service *);
00703 void start_using_event_handlers(void);
00704 void stop_using_event_handlers(void);
00705 void enable_service_event_handler(service *);
00706 void disable_service_event_handler(service *);
00707 void enable_host_event_handler(host *);
00708 void disable_host_event_handler(host *);
00709 void enable_host_checks(host *);
00710 void disable_host_checks(host *);
00711 void start_obsessing_over_service_checks(void);
00712 void stop_obsessing_over_service_checks(void);
00713 void start_obsessing_over_host_checks(void);
00714 void stop_obsessing_over_host_checks(void);
00715 void enable_service_freshness_checks(void);
00716 void disable_service_freshness_checks(void);
00717 void enable_host_freshness_checks(void);
00718 void disable_host_freshness_checks(void);
00719 void process_passive_service_checks(void);
00720 void enable_all_failure_prediction(void);
00721 void disable_all_failure_prediction(void);
00722 void enable_performance_data(void);
00723 void disable_performance_data(void);
00724 void start_executing_host_checks(void);
00725 void stop_executing_host_checks(void);
00726 void start_accepting_passive_host_checks(void);
00727 void stop_accepting_passive_host_checks(void);
00728 void enable_passive_host_checks(host *);
00729 void disable_passive_host_checks(host *);
00730 void start_obsessing_over_service(service *);
00731 void stop_obsessing_over_service(service *);
00732 void start_obsessing_over_host(host *);
00733 void stop_obsessing_over_host(host *);
00734 void set_host_notification_number(host *,int);
00735 void set_service_notification_number(service *,int);
00736
00737 int init_service_result_worker_thread(void);
00738 int shutdown_service_result_worker_thread(void);
00739 void * service_result_worker_thread(void *);
00740 void cleanup_service_result_worker_thread(void *);
00741
00742 int init_command_file_worker_thread(void);
00743 int shutdown_command_file_worker_thread(void);
00744 void * command_file_worker_thread(void *);
00745 void cleanup_command_file_worker_thread(void *);
00746
00747 int submit_external_command(char *,int *);
00748 int submit_raw_external_command(char *,time_t *,int *);
00749
00750 char *get_program_version(void);
00751 char *get_program_modification_date(void);
00752
00753 mmapfile *mmap_fopen(char *);
00754 int mmap_fclose(mmapfile *);
00755 char *mmap_fgets(mmapfile *);
00756 char *mmap_fgets_multiline(mmapfile *);
00757
00758
00759 int init_macrox_names(void);
00760 int add_macrox_name(int,char *);
00761 int free_macrox_names(void);
00762 int set_all_macro_environment_vars(int);
00763 int set_macrox_environment_vars(int);
00764 int set_argv_macro_environment_vars(int);
00765 int set_macro_environment_var(char *,char *,int);
00766
00767 #ifdef __cplusplus
00768 }
00769 #endif
00770 #endif
00771