Icinga-core 1.4.0
next gen monitoring
cgi/histogram.c File Reference
#include "../include/config.h"
#include "../include/common.h"
#include "../include/objects.h"
#include "../include/statusdata.h"
#include "../include/readlogs.h"
#include "../include/cgiutils.h"
#include "../include/getcgi.h"
#include "../include/cgiauth.h"
#include <gd.h>
#include <gdfonts.h>

Go to the source code of this file.

Data Structures

struct  timeslice_data_struct

Defines

#define HISTOGRAM_IMAGE   "histogram.png"
#define AS_NO_DATA   0
#define AS_PROGRAM_START   1
#define AS_PROGRAM_END   2
#define AS_HOST_UP   3
#define AS_HOST_DOWN   4
#define AS_HOST_UNREACHABLE   5
#define AS_SVC_OK   6
#define AS_SVC_UNKNOWN   7
#define AS_SVC_WARNING   8
#define AS_SVC_CRITICAL   9
#define DISPLAY_HOST_HISTOGRAM   0
#define DISPLAY_SERVICE_HISTOGRAM   1
#define DISPLAY_NO_HISTOGRAM   2
#define GET_INPUT_NONE   0
#define GET_INPUT_TARGET_TYPE   1
#define GET_INPUT_HOST_TARGET   2
#define GET_INPUT_SERVICE_TARGET   3
#define GET_INPUT_OPTIONS   4
#define BREAKDOWN_MONTHLY   0
#define BREAKDOWN_DAY_OF_MONTH   1
#define BREAKDOWN_DAY_OF_WEEK   2
#define BREAKDOWN_HOURLY   3
#define MAX_ARCHIVE_SPREAD   65
#define MAX_ARCHIVE   65
#define MAX_ARCHIVE_BACKTRACKS   60
#define DRAWING_WIDTH   550
#define DRAWING_HEIGHT   195
#define DRAWING_X_OFFSET   60
#define DRAWING_Y_OFFSET   235
#define GRAPH_HOST_UP   1
#define GRAPH_HOST_DOWN   2
#define GRAPH_HOST_UNREACHABLE   4
#define GRAPH_SERVICE_OK   8
#define GRAPH_SERVICE_WARNING   16
#define GRAPH_SERVICE_UNKNOWN   32
#define GRAPH_SERVICE_CRITICAL   64
#define GRAPH_HOST_PROBLEMS   6
#define GRAPH_HOST_ALL   7
#define GRAPH_SERVICE_PROBLEMS   112
#define GRAPH_SERVICE_ALL   120
#define GRAPH_EVERYTHING   255
#define GRAPH_SOFT_STATETYPES   1
#define GRAPH_HARD_STATETYPES   2
#define GRAPH_ALL_STATETYPES   3

Typedefs

typedef struct
timeslice_data_struct 
timeslice_data

Functions

void compute_report_times (void)
void graph_all_histogram_data (void)
void add_archived_state (int, time_t)
void read_archived_state_data (void)
void scan_log_file_for_archived_state_data (char *)
void draw_line (int, int, int, int, int)
void draw_dashed_line (int, int, int, int, int)
int process_cgivars (void)
int main (int argc, char **argv)

Variables

char main_config_file [MAX_FILENAME_LENGTH]
char url_html_path [MAX_FILENAME_LENGTH]
char url_images_path [MAX_FILENAME_LENGTH]
char url_stylesheets_path [MAX_FILENAME_LENGTH]
char url_js_path [MAX_FILENAME_LENGTH]
char physical_images_path [MAX_FILENAME_LENGTH]
int log_rotation_method
hosthost_list
serviceservice_list
logentryentry_list
authdata current_authdata
timeslice_datatsdata
time_t t1
time_t t2
int start_second = 0
int start_minute = 0
int start_hour = 0
int start_day = 1
int start_month = 1
int start_year = 2000
int end_second = 0
int end_minute = 0
int end_hour = 24
int end_day = 1
int end_month = 1
int end_year = 2000
int content_type
int input_type = GET_INPUT_NONE
int timeperiod_type = TIMEPERIOD_LAST24HOURS
int breakdown_type = BREAKDOWN_HOURLY
int compute_time_from_parts = FALSE
int initial_states_logged = FALSE
int assume_state_retention = TRUE
int new_states_only = FALSE
int last_state = AS_NO_DATA
int program_restart_has_occurred = FALSE
int graph_events = GRAPH_EVERYTHING
int graph_statetypes = GRAPH_HARD_STATETYPES
int embedded
int display_header
int daemon_check
gdImagePtr histogram_image = 0
int color_white = 0
int color_black = 0
int color_red = 0
int color_darkred = 0
int color_green = 0
int color_yellow = 0
int color_orange = 0
int color_lightgray = 0
FILE * image_file = NULL
int backtrack_archives = 0
int earliest_archive = 0
time_t earliest_time
time_t latest_time
int image_width = 900
int image_height = 320
int total_buckets = 96
int display_type = DISPLAY_NO_HISTOGRAM
int show_all_hosts = TRUE
int show_all_hostgroups = TRUE
int show_all_servicegroups = TRUE
char * host_name = ""
char * host_filter = NULL
char * hostgroup_name = NULL
char * servicegroup_name = NULL
char * service_desc = ""
char * service_filter = NULL
int CGI_ID = HISTOGRAM_CGI_ID

Define Documentation

#define AS_HOST_DOWN   4

Definition at line 49 of file histogram.c.

#define AS_HOST_UNREACHABLE   5

Definition at line 50 of file histogram.c.

#define AS_HOST_UP   3

Definition at line 48 of file histogram.c.

#define AS_NO_DATA   0

Definition at line 45 of file histogram.c.

#define AS_PROGRAM_END   2

Definition at line 47 of file histogram.c.

#define AS_PROGRAM_START   1

Definition at line 46 of file histogram.c.

#define AS_SVC_CRITICAL   9

Definition at line 54 of file histogram.c.

#define AS_SVC_OK   6

Definition at line 51 of file histogram.c.

#define AS_SVC_UNKNOWN   7

Definition at line 52 of file histogram.c.

#define AS_SVC_WARNING   8

Definition at line 53 of file histogram.c.

#define BREAKDOWN_DAY_OF_MONTH   1

Definition at line 71 of file histogram.c.

#define BREAKDOWN_DAY_OF_WEEK   2

Definition at line 72 of file histogram.c.

#define BREAKDOWN_HOURLY   3

Definition at line 73 of file histogram.c.

#define BREAKDOWN_MONTHLY   0

Definition at line 70 of file histogram.c.

#define DISPLAY_HOST_HISTOGRAM   0

Definition at line 58 of file histogram.c.

#define DISPLAY_NO_HISTOGRAM   2

Definition at line 60 of file histogram.c.

#define DISPLAY_SERVICE_HISTOGRAM   1

Definition at line 59 of file histogram.c.

#define DRAWING_HEIGHT   195

Definition at line 81 of file histogram.c.

#define DRAWING_WIDTH   550

Definition at line 80 of file histogram.c.

#define DRAWING_X_OFFSET   60

Definition at line 82 of file histogram.c.

#define DRAWING_Y_OFFSET   235

Definition at line 83 of file histogram.c.

#define GET_INPUT_HOST_TARGET   2

Definition at line 65 of file histogram.c.

#define GET_INPUT_NONE   0

Definition at line 63 of file histogram.c.

#define GET_INPUT_OPTIONS   4

Definition at line 67 of file histogram.c.

#define GET_INPUT_SERVICE_TARGET   3

Definition at line 66 of file histogram.c.

#define GET_INPUT_TARGET_TYPE   1

Definition at line 64 of file histogram.c.

#define GRAPH_ALL_STATETYPES   3

Definition at line 104 of file histogram.c.

#define GRAPH_EVERYTHING   255

Definition at line 99 of file histogram.c.

#define GRAPH_HARD_STATETYPES   2

Definition at line 103 of file histogram.c.

#define GRAPH_HOST_ALL   7

Definition at line 94 of file histogram.c.

#define GRAPH_HOST_DOWN   2

Definition at line 86 of file histogram.c.

#define GRAPH_HOST_PROBLEMS   6

Definition at line 93 of file histogram.c.

#define GRAPH_HOST_UNREACHABLE   4

Definition at line 87 of file histogram.c.

#define GRAPH_HOST_UP   1

Definition at line 85 of file histogram.c.

#define GRAPH_SERVICE_ALL   120

Definition at line 97 of file histogram.c.

#define GRAPH_SERVICE_CRITICAL   64

Definition at line 91 of file histogram.c.

#define GRAPH_SERVICE_OK   8

Definition at line 88 of file histogram.c.

#define GRAPH_SERVICE_PROBLEMS   112

Definition at line 96 of file histogram.c.

#define GRAPH_SERVICE_UNKNOWN   32

Definition at line 90 of file histogram.c.

#define GRAPH_SERVICE_WARNING   16

Definition at line 89 of file histogram.c.

#define GRAPH_SOFT_STATETYPES   1

Definition at line 102 of file histogram.c.

#define HISTOGRAM_IMAGE   "histogram.png"

Definition at line 42 of file histogram.c.

#define MAX_ARCHIVE   65

Definition at line 77 of file histogram.c.

#define MAX_ARCHIVE_BACKTRACKS   60

Definition at line 78 of file histogram.c.

#define MAX_ARCHIVE_SPREAD   65

Definition at line 76 of file histogram.c.


Typedef Documentation


Function Documentation

void add_archived_state ( int  state_type,
time_t  time_stamp 
)

Definition at line 1958 of file histogram.c.

void compute_report_times ( void  )
void draw_dashed_line ( int  x1,
int  y1,
int  x2,
int  y2,
int  color 
)

Definition at line 2327 of file histogram.c.

void draw_line ( int  x1,
int  y1,
int  x2,
int  y2,
int  color 
)

Definition at line 2311 of file histogram.c.

void graph_all_histogram_data ( void  )

Definition at line 1428 of file histogram.c.

int main ( int  argc,
char **  argv 
)

Definition at line 221 of file histogram.c.

int process_cgivars ( void  )
void read_archived_state_data ( void  )
void scan_log_file_for_archived_state_data ( char *  filename)

Variable Documentation

Definition at line 173 of file histogram.c.

Definition at line 197 of file histogram.c.

int breakdown_type = BREAKDOWN_HOURLY

Definition at line 169 of file histogram.c.

int CGI_ID = HISTOGRAM_CGI_ID

ID to identify the cgi for functions in cgiutils.c

Definition at line 219 of file histogram.c.

int color_black = 0

Definition at line 188 of file histogram.c.

int color_darkred = 0

Definition at line 190 of file histogram.c.

int color_green = 0

Definition at line 191 of file histogram.c.

int color_lightgray = 0

Definition at line 194 of file histogram.c.

int color_orange = 0

Definition at line 193 of file histogram.c.

int color_red = 0

Definition at line 189 of file histogram.c.

int color_white = 0

Definition at line 187 of file histogram.c.

int color_yellow = 0

Definition at line 192 of file histogram.c.

Definition at line 170 of file histogram.c.

Definition at line 165 of file cgiutils.c.

Definition at line 123 of file histogram.c.

Definition at line 169 of file cgiutils.c.

Definition at line 167 of file cgiutils.c.

int display_type = DISPLAY_NO_HISTOGRAM

Definition at line 207 of file histogram.c.

Definition at line 198 of file histogram.c.

time_t earliest_time

Definition at line 199 of file histogram.c.

int embedded

Definition at line 166 of file cgiutils.c.

int end_day = 1

Definition at line 162 of file histogram.c.

int end_hour = 24

Definition at line 161 of file histogram.c.

int end_minute = 0

Definition at line 160 of file histogram.c.

int end_month = 1

Definition at line 163 of file histogram.c.

int end_second = 0

Definition at line 159 of file histogram.c.

int end_year = 2000

Definition at line 164 of file histogram.c.

the list with all current logentries

Definition at line 36 of file readlogs.c.

int graph_events = GRAPH_EVERYTHING

Definition at line 179 of file histogram.c.

int graph_statetypes = GRAPH_HARD_STATETYPES

Definition at line 180 of file histogram.c.

gdImagePtr histogram_image = 0

Definition at line 186 of file histogram.c.

char* host_filter = NULL

Definition at line 213 of file histogram.c.

Definition at line 52 of file objects.c.

char* host_name = ""

requested host name

Definition at line 212 of file histogram.c.

char* hostgroup_name = NULL

requested hostgroup name

Definition at line 214 of file histogram.c.

FILE* image_file = NULL

Definition at line 195 of file histogram.c.

int image_height = 320

Definition at line 203 of file histogram.c.

int image_width = 900

Definition at line 202 of file histogram.c.

int initial_states_logged = FALSE

Definition at line 172 of file histogram.c.

int input_type = GET_INPUT_NONE

Definition at line 167 of file histogram.c.

int last_state = AS_NO_DATA

Definition at line 176 of file histogram.c.

time_t latest_time

Definition at line 200 of file histogram.c.

readlogs.c

Definition at line 174 of file icinga.c.

char main_config_file[MAX_FILENAME_LENGTH]

Definition at line 50 of file icingastats.c.

int new_states_only = FALSE

Definition at line 174 of file histogram.c.

char physical_images_path[MAX_FILENAME_LENGTH]

Definition at line 36 of file cgiutils.c.

Definition at line 177 of file histogram.c.

char* service_desc = ""

requested service name

Definition at line 216 of file histogram.c.

char* service_filter = NULL

Definition at line 217 of file histogram.c.

Definition at line 53 of file objects.c.

char* servicegroup_name = NULL

requested servicegroup name

Definition at line 215 of file histogram.c.

int show_all_hostgroups = TRUE

Definition at line 209 of file histogram.c.

int show_all_hosts = TRUE

Definition at line 208 of file histogram.c.

Definition at line 210 of file histogram.c.

int start_day = 1

Definition at line 156 of file histogram.c.

int start_hour = 0

Definition at line 155 of file histogram.c.

int start_minute = 0

Definition at line 154 of file histogram.c.

int start_month = 1

Definition at line 157 of file histogram.c.

int start_second = 0

Definition at line 153 of file histogram.c.

int start_year = 2000

Definition at line 158 of file histogram.c.

time_t t1

Definition at line 150 of file histogram.c.

time_t t2

Definition at line 151 of file histogram.c.

int timeperiod_type = TIMEPERIOD_LAST24HOURS

Definition at line 168 of file histogram.c.

int total_buckets = 96

Definition at line 205 of file histogram.c.

Definition at line 137 of file histogram.c.

char url_html_path[MAX_FILENAME_LENGTH]

Definition at line 38 of file cgiutils.c.

char url_images_path[MAX_FILENAME_LENGTH]

Definition at line 41 of file cgiutils.c.

char url_js_path[MAX_FILENAME_LENGTH]

Definition at line 44 of file cgiutils.c.

char url_stylesheets_path[MAX_FILENAME_LENGTH]

Definition at line 43 of file cgiutils.c.

 All Data Structures Files Functions Variables Typedefs Defines