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 #ifndef __GNUC__
00025 # define __attribute__(x)
00026 #endif
00027
00028 #include "config.h"
00029 #include "common.h"
00030 #include "locations.h"
00031 #include "objects.h"
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #define MAX_PLUGIN_OUTPUT_LENGTH 8192
00047
00048
00049
00050
00051
00052 #define DEFAULT_LOG_LEVEL 1
00053 #define DEFAULT_USE_SYSLOG 1
00054 #define DEFAULT_SYSLOG_LEVEL 2
00055
00056 #define DEFAULT_NOTIFICATION_LOGGING 1
00057
00058 #define DEFAULT_INTER_CHECK_DELAY 5.0
00059 #define DEFAULT_INTERLEAVE_FACTOR 1
00060 #define DEFAULT_SLEEP_TIME 0.5
00061 #define DEFAULT_INTERVAL_LENGTH 60
00062 #define DEFAULT_RETRY_INTERVAL 30
00063 #define DEFAULT_COMMAND_CHECK_INTERVAL -1
00064 #define DEFAULT_CHECK_REAPER_INTERVAL 10
00065 #define DEFAULT_MAX_REAPER_TIME 30
00066 #define DEFAULT_MAX_CHECK_RESULT_AGE 3600
00067 #define DEFAULT_MAX_PARALLEL_SERVICE_CHECKS 0
00068 #define DEFAULT_RETENTION_UPDATE_INTERVAL 60
00069 #define DEFAULT_RETENTION_SCHEDULING_HORIZON 900
00070 #define DEFAULT_STATUS_UPDATE_INTERVAL 60
00071 #define DEFAULT_FRESHNESS_CHECK_INTERVAL 60
00072 #define DEFAULT_AUTO_RESCHEDULING_INTERVAL 30
00073 #define DEFAULT_AUTO_RESCHEDULING_WINDOW 180
00074 #define DEFAULT_ORPHAN_CHECK_INTERVAL 60
00075
00076 #define DEFAULT_NOTIFICATION_TIMEOUT 30
00077 #define DEFAULT_EVENT_HANDLER_TIMEOUT 30
00078 #define DEFAULT_HOST_CHECK_TIMEOUT 30
00079 #define DEFAULT_SERVICE_CHECK_TIMEOUT 60
00080 #define DEFAULT_OCSP_TIMEOUT 15
00081 #define DEFAULT_OCHP_TIMEOUT 15
00082 #define DEFAULT_PERFDATA_TIMEOUT 5
00083 #define DEFAULT_TIME_CHANGE_THRESHOLD 900
00084
00085 #define DEFAULT_LOG_HOST_RETRIES 0
00086 #define DEFAULT_LOG_SERVICE_RETRIES 0
00087 #define DEFAULT_LOG_EVENT_HANDLERS 1
00088 #define DEFAULT_LOG_INITIAL_STATES 0
00089 #define DEFAULT_LOG_EXTERNAL_COMMANDS 1
00090 #define DEFAULT_LOG_PASSIVE_CHECKS 1
00091
00092 #define DEFAULT_DEBUG_LEVEL 0
00093 #define DEFAULT_DEBUG_VERBOSITY 1
00094 #define DEFAULT_MAX_DEBUG_FILE_SIZE 1000000
00095
00096 #define DEFAULT_AGGRESSIVE_HOST_CHECKING 0
00097 #define DEFAULT_CHECK_EXTERNAL_COMMANDS 1
00098 #define DEFAULT_CHECK_ORPHANED_SERVICES 1
00099 #define DEFAULT_CHECK_ORPHANED_HOSTS 1
00100 #define DEFAULT_ENABLE_FLAP_DETECTION 0
00101 #define DEFAULT_PROCESS_PERFORMANCE_DATA 0
00102 #define DEFAULT_CHECK_SERVICE_FRESHNESS 1
00103 #define DEFAULT_CHECK_HOST_FRESHNESS 0
00104 #define DEFAULT_AUTO_RESCHEDULE_CHECKS 0
00105 #define DEFAULT_TRANSLATE_PASSIVE_HOST_CHECKS 0
00106 #define DEFAULT_PASSIVE_HOST_CHECKS_SOFT 0
00107
00108 #define DEFAULT_LOW_SERVICE_FLAP_THRESHOLD 20.0
00109 #define DEFAULT_HIGH_SERVICE_FLAP_THRESHOLD 30.0
00110 #define DEFAULT_LOW_HOST_FLAP_THRESHOLD 20.0
00111 #define DEFAULT_HIGH_HOST_FLAP_THRESHOLD 30.0
00112
00113 #define DEFAULT_HOST_CHECK_SPREAD 30
00114 #define DEFAULT_SERVICE_CHECK_SPREAD 30
00115
00116 #define DEFAULT_CACHED_HOST_CHECK_HORIZON 15
00117 #define DEFAULT_CACHED_SERVICE_CHECK_HORIZON 15
00118 #define DEFAULT_ENABLE_PREDICTIVE_HOST_DEPENDENCY_CHECKS 1
00119 #define DEFAULT_ENABLE_PREDICTIVE_SERVICE_DEPENDENCY_CHECKS 1
00120
00121 #define DEFAULT_USE_LARGE_INSTALLATION_TWEAKS 0
00122
00123 #define DEFAULT_ENABLE_EMBEDDED_PERL 1
00124 #define DEFAULT_USE_EMBEDDED_PERL_IMPLICITLY 1
00125
00126 #define DEFAULT_ADDITIONAL_FRESHNESS_LATENCY 15
00127
00128
00129
00130
00131
00132 #define NSLOG_RUNTIME_ERROR 1
00133 #define NSLOG_RUNTIME_WARNING 2
00134
00135 #define NSLOG_VERIFICATION_ERROR 4
00136 #define NSLOG_VERIFICATION_WARNING 8
00137
00138 #define NSLOG_CONFIG_ERROR 16
00139 #define NSLOG_CONFIG_WARNING 32
00140
00141 #define NSLOG_PROCESS_INFO 64
00142 #define NSLOG_EVENT_HANDLER 128
00143
00144 #define NSLOG_EXTERNAL_COMMAND 512
00145
00146 #define NSLOG_HOST_UP 1024
00147 #define NSLOG_HOST_DOWN 2048
00148 #define NSLOG_HOST_UNREACHABLE 4096
00149
00150 #define NSLOG_SERVICE_OK 8192
00151 #define NSLOG_SERVICE_UNKNOWN 16384
00152 #define NSLOG_SERVICE_WARNING 32768
00153 #define NSLOG_SERVICE_CRITICAL 65536
00154
00155 #define NSLOG_PASSIVE_CHECK 131072
00156
00157 #define NSLOG_INFO_MESSAGE 262144
00158
00159 #define NSLOG_HOST_NOTIFICATION 524288
00160 #define NSLOG_SERVICE_NOTIFICATION 1048576
00161
00162
00163
00164
00165 #define DEBUGL_ALL -1
00166 #define DEBUGL_NONE 0
00167 #define DEBUGL_FUNCTIONS 1
00168 #define DEBUGL_CONFIG 2
00169 #define DEBUGL_PROCESS 4
00170 #define DEBUGL_STATUSDATA 4
00171 #define DEBUGL_RETENTIONDATA 4
00172 #define DEBUGL_EVENTS 8
00173 #define DEBUGL_CHECKS 16
00174 #define DEBUGL_IPC 16
00175 #define DEBUGL_FLAPPING 16
00176 #define DEBUGL_EVENTHANDLERS 16
00177 #define DEBUGL_PERFDATA 16
00178 #define DEBUGL_NOTIFICATIONS 32
00179 #define DEBUGL_EVENTBROKER 64
00180 #define DEBUGL_EXTERNALCOMMANDS 128
00181 #define DEBUGL_COMMANDS 256
00182 #define DEBUGL_DOWNTIME 512
00183 #define DEBUGL_COMMENTS 1024
00184 #define DEBUGL_MACROS 2048
00185
00186 #define DEBUGV_BASIC 0
00187 #define DEBUGV_MORE 1
00188 #define DEBUGV_MOST 2
00189
00190
00191
00192
00193 #define HOST_UP 0
00194 #define HOST_DOWN 1
00195 #define HOST_UNREACHABLE 2
00196
00197
00198
00199
00200
00201 #define INITIAL_STATES 1
00202 #define CURRENT_STATES 2
00203
00204
00205
00206
00207
00208 #define DEPENDENCIES_OK 0
00209 #define DEPENDENCIES_FAILED 1
00210
00211
00212
00213
00214
00215 #define PROPAGATE_TO_PARENT_HOSTS 1
00216 #define PROPAGATE_TO_CHILD_HOSTS 2
00217
00218
00219
00220
00221
00222 #define STATE_OK 0
00223 #define STATE_WARNING 1
00224 #define STATE_CRITICAL 2
00225 #define STATE_UNKNOWN 3
00226
00227
00228
00229
00230
00231 #define HOST_FLAPPING 0
00232 #define SERVICE_FLAPPING 1
00233
00234
00235
00236
00237
00238 #define HOST_NOTIFICATION 0
00239 #define SERVICE_NOTIFICATION 1
00240
00241
00242
00243
00244
00245 #define NOTIFICATION_NORMAL 0
00246 #define NOTIFICATION_ACKNOWLEDGEMENT 1
00247 #define NOTIFICATION_FLAPPINGSTART 2
00248 #define NOTIFICATION_FLAPPINGSTOP 3
00249 #define NOTIFICATION_FLAPPINGDISABLED 4
00250 #define NOTIFICATION_DOWNTIMESTART 5
00251 #define NOTIFICATION_DOWNTIMEEND 6
00252 #define NOTIFICATION_DOWNTIMECANCELLED 7
00253 #define NOTIFICATION_CUSTOM 99
00254
00255
00256
00257
00258
00259 #define HOST_EVENTHANDLER 0
00260 #define SERVICE_EVENTHANDLER 1
00261 #define GLOBAL_HOST_EVENTHANDLER 2
00262 #define GLOBAL_SERVICE_EVENTHANDLER 3
00263
00264
00265
00266
00267
00268 #define HOST_STATECHANGE 0
00269 #define SERVICE_STATECHANGE 1
00270
00271
00272
00273
00274 #define SERVICE_CHECK 0
00275 #define HOST_CHECK 1
00276
00277
00278
00279
00280
00281 #define EVENT_SERVICE_CHECK 0
00282 #define EVENT_COMMAND_CHECK 1
00283 #define EVENT_LOG_ROTATION 2
00284 #define EVENT_PROGRAM_SHUTDOWN 3
00285 #define EVENT_PROGRAM_RESTART 4
00286 #define EVENT_CHECK_REAPER 5
00287 #define EVENT_ORPHAN_CHECK 6
00288 #define EVENT_RETENTION_SAVE 7
00289 #define EVENT_STATUS_SAVE 8
00290 #define EVENT_SCHEDULED_DOWNTIME 9
00291 #define EVENT_SFRESHNESS_CHECK 10
00292 #define EVENT_EXPIRE_DOWNTIME 11
00293 #define EVENT_HOST_CHECK 12
00294 #define EVENT_HFRESHNESS_CHECK 13
00295 #define EVENT_RESCHEDULE_CHECKS 14
00296 #define EVENT_EXPIRE_COMMENT 15
00297 #define EVENT_SLEEP 98
00298 #define EVENT_USER_FUNCTION 99
00299
00300
00301
00302
00303
00304 #define ICD_NONE 0
00305 #define ICD_DUMB 1
00306 #define ICD_SMART 2
00307 #define ICD_USER 3
00308
00309
00310
00311
00312
00313 #define ILF_USER 0
00314 #define ILF_SMART 1
00315
00316
00317
00318
00319
00320 #define ACTIVE_DOWNTIME 0
00321 #define PENDING_DOWNTIME 1
00322
00323
00324
00325
00326
00327
00328 typedef struct timed_event_struct{
00329 int event_type;
00330 time_t run_time;
00331 int recurring;
00332 unsigned long event_interval;
00333 int compensate_for_time_change;
00334 void *timing_func;
00335 void *event_data;
00336 void *event_args;
00337 int event_options;
00338 struct timed_event_struct *next;
00339 struct timed_event_struct *prev;
00340 }timed_event;
00341
00342
00343
00344 typedef struct notify_list_struct{
00345 contact *contact;
00346 struct notify_list_struct *next;
00347 }notification;
00348
00349
00350
00351 typedef struct check_result_struct{
00352 int object_check_type;
00353 char *host_name;
00354 char *service_description;
00355 int check_type;
00356 int check_options;
00357 int scheduled_check;
00358 int reschedule_check;
00359 char *output_file;
00360 FILE *output_file_fp;
00361 int output_file_fd;
00362 double latency;
00363 struct timeval start_time;
00364 struct timeval finish_time;
00365 int early_timeout;
00366 int exited_ok;
00367 int return_code;
00368 char *output;
00369 struct check_result_struct *next;
00370 }check_result;
00371
00372
00373
00374 typedef struct sched_info_struct{
00375 int total_services;
00376 int total_scheduled_services;
00377 int total_hosts;
00378 int total_scheduled_hosts;
00379 double average_services_per_host;
00380 double average_scheduled_services_per_host;
00381 unsigned long service_check_interval_total;
00382 unsigned long host_check_interval_total;
00383 double average_service_execution_time;
00384 double average_service_check_interval;
00385 double average_host_check_interval;
00386 double average_service_inter_check_delay;
00387 double average_host_inter_check_delay;
00388 double service_inter_check_delay;
00389 double host_inter_check_delay;
00390 int service_interleave_factor;
00391 int max_service_check_spread;
00392 int max_host_check_spread;
00393 time_t first_service_check;
00394 time_t last_service_check;
00395 time_t first_host_check;
00396 time_t last_host_check;
00397 }sched_info;
00398
00399
00400
00401 typedef struct passive_check_result_struct{
00402 int object_check_type;
00403 char *host_name;
00404 char *service_description;
00405 int return_code;
00406 char *output;
00407 time_t check_time;
00408 double latency;
00409 struct passive_check_result_struct *next;
00410 }passive_check_result;
00411
00412
00413
00414 typedef struct circular_buffer_struct{
00415 void **buffer;
00416 int tail;
00417 int head;
00418 int items;
00419 int high;
00420 unsigned long overflow;
00421 pthread_mutex_t buffer_lock;
00422 }circular_buffer;
00423
00424
00425
00426 typedef struct mmapfile_struct{
00427 char *path;
00428 int mode;
00429 int fd;
00430 unsigned long file_size;
00431 unsigned long current_position;
00432 unsigned long current_line;
00433 void *mmap_buf;
00434 }mmapfile;
00435
00436
00437
00438 typedef struct dbuf_struct{
00439 char *buf;
00440 unsigned long used_size;
00441 unsigned long allocated_size;
00442 unsigned long chunk_size;
00443 }dbuf;
00444
00445
00446 #define CHECK_STATS_BUCKETS 15
00447
00448
00449 typedef struct check_stats_struct{
00450 int current_bucket;
00451 int bucket[CHECK_STATS_BUCKETS];
00452 int overflow_bucket;
00453 int minute_stats[3];
00454 time_t last_update;
00455 }check_stats;
00456
00457
00458
00459
00460
00461 #define DEFAULT_EXTERNAL_COMMAND_BUFFER_SLOTS 4096
00462
00463
00464 #define TOTAL_WORKER_THREADS 1
00465
00466 #define COMMAND_WORKER_THREAD 0
00467
00468
00469
00470
00471
00472
00473 int read_main_config_file(char *);
00474 int read_resource_file(char *);
00475 int read_all_object_data(char *);
00476
00477
00478
00479 int pre_flight_check(void);
00480 int pre_flight_object_check(int *,int *);
00481 int pre_flight_circular_check(int *,int *);
00482 void init_timing_loop(void);
00483 void setup_sighandler(void);
00484 void reset_sighandler(void);
00485 int daemon_init(void);
00486 int drop_privileges(char *,char *);
00487 void display_scheduling_info(void);
00488
00489
00490
00491 int schedule_new_event(int,int,time_t,int,unsigned long,void *,int,void *,void *,int);
00492 void reschedule_event(timed_event *,timed_event **,timed_event **);
00493 void add_event(timed_event *,timed_event **,timed_event **);
00494 void remove_event(timed_event *,timed_event **,timed_event **);
00495 int event_execution_loop(void);
00496 int handle_timed_event(timed_event *);
00497 void adjust_check_scheduling(void);
00498 void compensate_for_system_time_change(unsigned long,unsigned long);
00499 void adjust_timestamp_for_time_change(time_t,time_t,unsigned long,time_t *);
00500 void resort_event_list(timed_event **,timed_event **);
00501
00502
00503
00504 int move_check_result_to_queue(char *);
00505 int process_check_result_queue(char *);
00506 int process_check_result_file(char *);
00507 int add_check_result_to_list(check_result *);
00508 check_result *read_check_result(void);
00509 int delete_check_result_file(char *);
00510 int free_check_result_list(void);
00511 int init_check_result(check_result *);
00512 int free_check_result(check_result *);
00513 int parse_check_output(char *,char **,char **,char **,int,int);
00514 int open_command_file(void);
00515 int close_command_file(void);
00516
00517
00518
00519 int check_service_dependencies(service *,int);
00520 int check_host_dependencies(host *,int);
00521 void check_for_orphaned_services(void);
00522 void check_for_orphaned_hosts(void);
00523 void check_service_result_freshness(void);
00524 int is_service_result_fresh(service *,time_t,int);
00525 void check_host_result_freshness(void);
00526 int is_host_result_fresh(host *,time_t,int);
00527 int my_system(char *,int,int *,double *,char **,int);
00528
00529
00530
00531 void check_for_service_flapping(service *,int,int);
00532 void check_for_host_flapping(host *,int,int,int);
00533 void set_service_flap(service *,double,double,double,int);
00534 void clear_service_flap(service *,double,double,double);
00535 void set_host_flap(host *,double,double,double,int);
00536 void clear_host_flap(host *,double,double,double);
00537 void enable_flap_detection_routines(void);
00538 void disable_flap_detection_routines(void);
00539 void enable_host_flap_detection(host *);
00540 void disable_host_flap_detection(host *);
00541 void enable_service_flap_detection(service *);
00542 void disable_service_flap_detection(service *);
00543 void handle_host_flap_detection_disabled(host *);
00544 void handle_service_flap_detection_disabled(service *);
00545
00546
00547
00548 int perform_on_demand_host_check(host *,int *,int,int,unsigned long);
00549 int perform_scheduled_host_check(host *,int,double);
00550 int check_host_check_viability_3x(host *,int,int *,time_t *);
00551 int adjust_host_check_attempt_3x(host *,int);
00552 int determine_host_reachability(host *);
00553 int process_host_check_result_3x(host *,int,char *,int,int,int,unsigned long);
00554 int perform_on_demand_host_check_3x(host *,int *,int,int,unsigned long);
00555 int run_sync_host_check_3x(host *,int *,int,int,unsigned long);
00556 int execute_sync_host_check_3x(host *);
00557 int run_scheduled_host_check_3x(host *,int,double);
00558 int run_async_host_check_3x(host *,int,double,int,int,int *,time_t *);
00559 int handle_async_host_check_result_3x(host *,check_result *);
00560
00561
00562
00563 int check_service_check_viability(service *,int,int *,time_t *);
00564 int run_scheduled_service_check(service *,int,double);
00565 int run_async_service_check(service *,int,double,int,int,int *,time_t *);
00566 int handle_async_service_check_result(service *,check_result *);
00567
00568
00569
00570 int handle_host_state(host *);
00571
00572
00573
00574
00575 int reap_check_results(void);
00576
00577
00578
00579 int init_check_stats(void);
00580 int update_check_stats(int,time_t);
00581 int generate_check_stats(void);
00582
00583
00584
00585
00586 int obsessive_compulsive_service_check_processor(service *);
00587 int obsessive_compulsive_host_check_processor(host *);
00588 int handle_service_event(service *);
00589 int run_service_event_handler(service *);
00590 int run_global_service_event_handler(service *);
00591 int handle_host_event(host *);
00592 int run_host_event_handler(host *);
00593 int run_global_host_event_handler(host *);
00594
00595
00596
00597 int check_service_notification_viability(service *,int,int);
00598 int is_valid_escalation_for_service_notification(service *,serviceescalation *,int);
00599 int should_service_notification_be_escalated(service *);
00600 int service_notification(service *,int,char *,char *,int);
00601 int check_contact_service_notification_viability(contact *,service *,int,int);
00602 int notify_contact_of_service(contact *,service *,int,char *,char *,int,int);
00603 int check_host_notification_viability(host *,int,int);
00604 int is_valid_escalation_for_host_notification(host *,hostescalation *,int);
00605 int should_host_notification_be_escalated(host *);
00606 int host_notification(host *,int,char *,char *,int);
00607 int check_contact_host_notification_viability(contact *,host *,int,int);
00608 int notify_contact_of_host(contact *,host *,int,char *,char *,int,int);
00609 int create_notification_list_from_host(host *,int,int *);
00610 int create_notification_list_from_service(service *,int,int *);
00611 int add_notification(contact *);
00612 notification *find_notification(contact *);
00613 time_t get_next_host_notification_time(host *,time_t);
00614 time_t get_next_service_notification_time(service *,time_t);
00615
00616
00617
00618 void logit(int,int,const char *, ...)
00619 __attribute__((__format__(__printf__, 3, 4)));
00620 int write_to_logs_and_console(char *,unsigned long,int);
00621 int write_to_console(char *);
00622 int write_to_all_logs(char *,unsigned long);
00623 int write_to_all_logs_with_timestamp(char *,unsigned long,time_t *);
00624 int write_to_log(char *,unsigned long,time_t *);
00625 int write_to_syslog(char *,unsigned long);
00626 int log_service_event(service *);
00627 int log_host_event(host *);
00628 int log_host_states(int,time_t *);
00629 int log_service_states(int,time_t *);
00630 int rotate_log_file(time_t);
00631 int write_log_file_info(time_t *);
00632 int open_debug_log(void);
00633 int log_debug_info(int,int,const char *,...)
00634 __attribute__((__format__(__printf__, 3, 4)));
00635 int close_debug_log(void);
00636
00637
00638
00639 void cleanup(void);
00640 void free_memory(void);
00641 int reset_variables(void);
00642 void free_notification_list(void);
00643
00644
00645
00646 int hashfunc(const char *name1, const char *name2, int hashslots);
00647 int compare_hashdata(const char *,const char *,const char *,const char *);
00648
00649
00650
00651 void sighandler(int);
00652 void service_check_sighandler(int);
00653 void host_check_sighandler(int);
00654 void my_system_sighandler(int);
00655 void file_lock_sighandler(int);
00656 void strip(char *);
00657 char *my_strtok(char *,char *);
00658 char *my_strsep(char **,const char *);
00659 #ifdef REMOVED_10182007
00660 int my_free(void **);
00661 #endif
00662 int compare_strings(char *,char *);
00663 char *escape_newlines(char *);
00664 int contains_illegal_object_chars(char *);
00665 int my_rename(char *,char *);
00666 int get_raw_command_line(command *,char *,char **,int);
00667 int check_time_against_period(time_t,timeperiod *);
00668 int is_daterange_single_day(daterange *);
00669 time_t calculate_time_from_weekday_of_month(int,int,int,int);
00670 time_t calculate_time_from_day_of_month(int,int,int);
00671 void get_next_valid_time(time_t, time_t *,timeperiod *);
00672 void get_datetime_string(time_t *,char *,int,int);
00673 void get_time_breakdown(unsigned long,int *,int *,int *, int *);
00674 time_t get_next_log_rotation_time(void);
00675 int init_embedded_perl(char **);
00676 int deinit_embedded_perl(void);
00677 int file_uses_embedded_perl(char *);
00678 int dbuf_init(dbuf *,int);
00679 int dbuf_free(dbuf *);
00680 int dbuf_strcat(dbuf *,char *);
00681 int set_environment_var(char *,char *,int);
00682
00683
00684
00685 int check_for_external_commands(void);
00686 int process_external_command1(char *);
00687 int process_external_command2(int,time_t,char *);
00688 int process_external_commands_from_file(char *,int);
00689 int process_host_command(int,time_t,char *);
00690 int process_hostgroup_command(int,time_t,char *);
00691 int process_service_command(int,time_t,char *);
00692 int process_servicegroup_command(int,time_t,char *);
00693 int process_contact_command(int,time_t,char *);
00694 int process_contactgroup_command(int,time_t,char *);
00695
00696
00697
00698 int cmd_add_comment(int,time_t,char *);
00699 int cmd_delete_comment(int,char *);
00700 int cmd_delete_all_comments(int,char *);
00701 int cmd_delay_notification(int,char *);
00702 int cmd_schedule_service_check(int,char *,int);
00703 int cmd_schedule_check(int,char *);
00704 int cmd_schedule_host_service_checks(int,char *,int);
00705 int cmd_signal_process(int,char *);
00706 int cmd_process_service_check_result(int,time_t,char *);
00707 int cmd_process_host_check_result(int,time_t,char *);
00708 int cmd_acknowledge_problem(int,char *);
00709 int cmd_remove_acknowledgement(int,char *);
00710 int cmd_schedule_downtime(int,time_t,char *);
00711 int cmd_delete_downtime(int,char *);
00712 int cmd_change_object_int_var(int,char *);
00713 int cmd_change_object_char_var(int,char *);
00714 int cmd_change_object_custom_var(int,char *);
00715 int cmd_process_external_commands_from_file(int,char *);
00716
00717 int process_passive_service_check(time_t,char *,char *,int,char *);
00718 int process_passive_host_check(time_t,char *,int,char *);
00719
00720
00721
00722 void disable_service_checks(service *);
00723 void enable_service_checks(service *);
00724 void schedule_service_check(service *,time_t,int);
00725 void schedule_host_check(host *,time_t,int);
00726 void enable_all_notifications(void);
00727 void disable_all_notifications(void);
00728 void enable_service_notifications(service *);
00729 void disable_service_notifications(service *);
00730 void enable_host_notifications(host *);
00731 void disable_host_notifications(host *);
00732 void enable_and_propagate_notifications(host *,int,int,int,int);
00733 void disable_and_propagate_notifications(host *,int,int,int,int);
00734 void schedule_and_propagate_downtime(host *,time_t,char *,char *,time_t,time_t,int,unsigned long,unsigned long);
00735 void acknowledge_host_problem(host *,char *,char *,int,int,int);
00736 void acknowledge_service_problem(service *,char *,char *,int,int,int);
00737 void remove_host_acknowledgement(host *);
00738 void remove_service_acknowledgement(service *);
00739 void start_executing_service_checks(void);
00740 void stop_executing_service_checks(void);
00741 void start_accepting_passive_service_checks(void);
00742 void stop_accepting_passive_service_checks(void);
00743 void enable_passive_service_checks(service *);
00744 void disable_passive_service_checks(service *);
00745 void start_using_event_handlers(void);
00746 void stop_using_event_handlers(void);
00747 void enable_service_event_handler(service *);
00748 void disable_service_event_handler(service *);
00749 void enable_host_event_handler(host *);
00750 void disable_host_event_handler(host *);
00751 void enable_host_checks(host *);
00752 void disable_host_checks(host *);
00753 void start_obsessing_over_service_checks(void);
00754 void stop_obsessing_over_service_checks(void);
00755 void start_obsessing_over_host_checks(void);
00756 void stop_obsessing_over_host_checks(void);
00757 void enable_service_freshness_checks(void);
00758 void disable_service_freshness_checks(void);
00759 void enable_host_freshness_checks(void);
00760 void disable_host_freshness_checks(void);
00761 void process_passive_checks(void);
00762 void enable_all_failure_prediction(void);
00763 void disable_all_failure_prediction(void);
00764 void enable_performance_data(void);
00765 void disable_performance_data(void);
00766 void start_executing_host_checks(void);
00767 void stop_executing_host_checks(void);
00768 void start_accepting_passive_host_checks(void);
00769 void stop_accepting_passive_host_checks(void);
00770 void enable_passive_host_checks(host *);
00771 void disable_passive_host_checks(host *);
00772 void start_obsessing_over_service(service *);
00773 void stop_obsessing_over_service(service *);
00774 void start_obsessing_over_host(host *);
00775 void stop_obsessing_over_host(host *);
00776 void set_host_notification_number(host *,int);
00777 void set_service_notification_number(service *,int);
00778 void enable_contact_host_notifications(contact *);
00779 void disable_contact_host_notifications(contact *);
00780 void enable_contact_service_notifications(contact *);
00781 void disable_contact_service_notifications(contact *);
00782
00783 int init_check_result_worker_thread(void);
00784 int shutdown_check_result_worker_thread(void);
00785 void * check_result_worker_thread(void *);
00786 void cleanup_check_result_worker_thread(void *);
00787
00788 int init_command_file_worker_thread(void);
00789 int shutdown_command_file_worker_thread(void);
00790 void * command_file_worker_thread(void *);
00791 void cleanup_command_file_worker_thread(void *);
00792
00793 int submit_external_command(char *,int *);
00794 int submit_raw_external_command(char *,time_t *,int *);
00795
00796 char *get_program_version(void);
00797 char *get_program_modification_date(void);
00798
00799 mmapfile *mmap_fopen(char *);
00800 int mmap_fclose(mmapfile *);
00801 char *mmap_fgets(mmapfile *);
00802 char *mmap_fgets_multiline(mmapfile *);
00803
00804
00805 #ifdef __cplusplus
00806 }
00807 #endif
00808 #endif
00809