#include "../include/config.h"
#include "../include/common.h"
#include "../include/objects.h"
#include "../include/comments.h"
#include "../include/statusdata.h"
#include "../include/cgiutils.h"
#include "../include/cgiauth.h"
#include "../include/getcgi.h"
#define AS_CURRENT_STATE -1 |
#define AS_HARD_STATE 2 |
#define AS_HOST_DOWN 4 |
#define AS_HOST_DOWNTIME_END 13 |
#define AS_HOST_DOWNTIME_START 12 |
#define AS_HOST_UNREACHABLE 5 |
#define AS_HOST_UP 3 |
#define AS_NO_DATA 0 |
#define AS_PROGRAM_END 1 |
#define AS_PROGRAM_START 2 |
#define AS_SOFT_STATE 1 |
#define AS_SVC_CRITICAL 9 |
#define AS_SVC_DOWNTIME_END 11 |
#define AS_SVC_DOWNTIME_START 10 |
#define AS_SVC_OK 6 |
#define AS_SVC_UNKNOWN 7 |
#define AS_SVC_WARNING 8 |
#define DISPLAY_HOST_AVAIL 2 |
#define DISPLAY_HOSTGROUP_AVAIL 1 |
#define DISPLAY_NO_AVAIL 0 |
#define DISPLAY_SERVICE_AVAIL 3 |
#define DISPLAY_SERVICEGROUP_AVAIL 4 |
#define HOST_SUBJECT 0 |
#define max | ( | a, | |||
b | ) | (((a) > (b)) ? (a) : (b)) |
#define MAX_ARCHIVE 65 |
#define MAX_ARCHIVE_BACKTRACKS 60 |
#define MAX_ARCHIVE_SPREAD 65 |
#define min | ( | a, | |||
b | ) | (((a) < (b)) ? (a) : (b)) |
#define MIN_TIMESTAMP_SPACING 10 |
#define SERVICE_SUBJECT 1 |
#define TIMEPERIOD_CUSTOM 0 |
#define TIMEPERIOD_LAST24HOURS 11 |
#define TIMEPERIOD_LAST31DAYS 13 |
#define TIMEPERIOD_LAST7DAYS 12 |
#define TIMEPERIOD_LASTMONTH 6 |
#define TIMEPERIOD_LASTQUARTER 8 |
#define TIMEPERIOD_LASTWEEK 4 |
#define TIMEPERIOD_LASTYEAR 10 |
#define TIMEPERIOD_THISMONTH 5 |
#define TIMEPERIOD_THISQUARTER 7 |
#define TIMEPERIOD_THISWEEK 3 |
#define TIMEPERIOD_THISYEAR 9 |
#define TIMEPERIOD_TODAY 1 |
#define TIMEPERIOD_YESTERDAY 2 |
typedef struct archived_state_struct archived_state |
typedef struct avail_subject_struct avail_subject |
void add_archived_state | ( | int | , | |
int | , | |||
time_t | , | |||
char * | , | |||
avail_subject * | ||||
) |
void add_global_archived_state | ( | int | , | |
int | , | |||
time_t | , | |||
char * | ||||
) |
void add_scheduled_downtime | ( | int | , | |
time_t | , | |||
avail_subject * | ||||
) |
void add_subject | ( | int | , | |
char * | , | |||
char * | ||||
) |
unsigned long calculate_total_time | ( | time_t | , | |
time_t | ||||
) |
void compute_availability | ( | void | ) |
void compute_report_times | ( | void | ) |
void compute_subject_availability | ( | avail_subject * | , | |
time_t | ||||
) |
void compute_subject_availability_times | ( | int | , | |
int | , | |||
time_t | , | |||
time_t | , | |||
time_t | , | |||
avail_subject * | , | |||
archived_state * | ||||
) |
void compute_subject_downtime | ( | avail_subject * | , | |
time_t | ||||
) |
void compute_subject_downtime_part_times | ( | time_t | , | |
time_t | , | |||
int | , | |||
avail_subject * | ||||
) |
void compute_subject_downtime_times | ( | time_t | , | |
time_t | , | |||
avail_subject * | , | |||
archived_state * | ||||
) |
int convert_host_state_to_archived_state | ( | int | ) |
int convert_service_state_to_archived_state | ( | int | ) |
void convert_timeperiod_to_times | ( | int | ) |
void create_subject_list | ( | void | ) |
void display_host_availability | ( | void | ) |
void display_hostgroup_availability | ( | void | ) |
void display_service_availability | ( | void | ) |
void display_servicegroup_availability | ( | void | ) |
void display_specific_hostgroup_availability | ( | hostgroup * | ) |
void display_specific_servicegroup_availability | ( | servicegroup * | ) |
avail_subject * find_subject | ( | int | , | |
char * | , | |||
char * | ||||
) |
void free_archived_state_list | ( | archived_state * | ) |
void free_availability_data | ( | void | ) |
void get_running_average | ( | double * | , | |
double | , | |||
int | ||||
) |
void host_report_url | ( | char * | , | |
char * | ||||
) |
int main | ( | int | argc, | |
char ** | argv | |||
) |
static int process_cgivars | ( | void | ) |
void read_archived_state_data | ( | void | ) |
void scan_log_file_for_archived_state_data | ( | char * | ) |
void service_report_url | ( | char * | , | |
char * | , | |||
char * | ||||
) |
void write_log_entries | ( | avail_subject * | ) |
int assume_initial_states = TRUE |
int assume_state_retention = TRUE |
int assume_states_during_notrunning = TRUE |
int backtrack_archives = 2 |
int CGI_ID = AVAIL_CGI_ID |
int compute_time_from_parts = FALSE |
int content_type |
char* csv_data_enclosure |
char* csv_delimiter |
timeperiod* current_timeperiod = NULL |
int daemon_check |
int display_header |
int display_type = DISPLAY_NO_AVAIL |
int earliest_archive = 0 |
int embedded |
int end_day = 1 |
int end_hour = 24 |
int end_minute = 0 |
int end_month = 1 |
int end_second = 0 |
int end_year = 2000 |
int full_log_entries = FALSE |
int get_date_parts = FALSE |
char* host_name = "" |
char* hostgroup_name = "" |
int include_soft_states = FALSE |
int initial_assumed_host_state = AS_NO_DATA |
int initial_assumed_service_state = AS_NO_DATA |
char main_config_file[MAX_FILENAME_LENGTH] |
int refresh |
int select_hostgroups = FALSE |
int select_hosts = FALSE |
int select_servicegroups = FALSE |
int select_services = FALSE |
char* service_desc = "" |
char* servicegroup_name = "" |
int show_all_hostgroups = FALSE |
int show_all_hosts = FALSE |
int show_all_servicegroups = FALSE |
int show_all_services = FALSE |
int show_log_entries = FALSE |
int show_scheduled_downtime = TRUE |
int start_day = 1 |
int start_hour = 0 |
int start_minute = 0 |
int start_month = 1 |
int start_second = 0 |
int start_year = 2000 |
avail_subject* subject_list = NULL |
time_t t1 |
time_t t2 |
int timeperiod_type = TIMEPERIOD_LAST24HOURS |
char url_html_path[MAX_FILENAME_LENGTH] |
char url_images_path[MAX_FILENAME_LENGTH] |
char url_js_path[MAX_FILENAME_LENGTH] |
char url_stylesheets_path[MAX_FILENAME_LENGTH] |