Icinga-core 1.4.0
next gen monitoring
cgi/summary.c File Reference
#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/getcgi.h"
#include "../include/cgiauth.h"

Go to the source code of this file.

Data Structures

struct  archived_event_struct
struct  alert_producer_struct

Defines

#define REPORT_NONE   0
#define REPORT_RECENT_ALERTS   1
#define REPORT_ALERT_TOTALS   2
#define REPORT_TOP_ALERTS   3
#define REPORT_HOSTGROUP_ALERT_TOTALS   4
#define REPORT_HOST_ALERT_TOTALS   5
#define REPORT_SERVICE_ALERT_TOTALS   6
#define REPORT_SERVICEGROUP_ALERT_TOTALS   7
#define SREPORT_NONE   0
#define SREPORT_RECENT_ALERTS   1
#define SREPORT_RECENT_HOST_ALERTS   2
#define SREPORT_RECENT_SERVICE_ALERTS   3
#define SREPORT_TOP_HOST_ALERTS   4
#define SREPORT_TOP_SERVICE_ALERTS   5
#define AE_SOFT_STATE   1
#define AE_HARD_STATE   2
#define AE_HOST_ALERT   1
#define AE_SERVICE_ALERT   2
#define AE_HOST_PRODUCER   1
#define AE_SERVICE_PRODUCER   2
#define AE_HOST_DOWN   1
#define AE_HOST_UNREACHABLE   2
#define AE_HOST_UP   4
#define AE_SERVICE_WARNING   8
#define AE_SERVICE_UNKNOWN   16
#define AE_SERVICE_CRITICAL   32
#define AE_SERVICE_OK   64

Typedefs

typedef struct
archived_event_struct 
archived_event
typedef struct
alert_producer_struct 
alert_producer

Functions

void read_archived_event_data (void)
void scan_log_file_for_archived_event_data (char *)
void compute_report_times (void)
void determine_standard_report_options (void)
void add_archived_event (int, time_t, int, int, char *, char *, char *)
alert_producerfind_producer (int, char *, char *)
alert_produceradd_producer (int, char *, char *)
void free_event_list (void)
void free_producer_list (void)
void sort_archive_states (void)
void display_report (void)
void display_recent_alerts (void)
void display_top_alerts (void)
void display_alerts (void)
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]
hosthost_list
hostgrouphostgroup_list
serviceservice_list
servicegroupservicegroup_list
logentryentry_list
int log_rotation_method
archived_eventevent_list = NULL
alert_producerproducer_list = NULL
authdata current_authdata
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 compute_time_from_parts = FALSE
int timeperiod_type = TIMEPERIOD_CUSTOM
int state_types = AE_HARD_STATE+AE_SOFT_STATE
int alert_types = AE_HOST_ALERT+AE_SERVICE_ALERT
int host_states = AE_HOST_UP+AE_HOST_DOWN+AE_HOST_UNREACHABLE
int service_states = AE_SERVICE_OK+AE_SERVICE_WARNING+AE_SERVICE_UNKNOWN+AE_SERVICE_CRITICAL
char * target_hostgroup_name = ""
char * target_servicegroup_name = ""
char * target_host_name = ""
hosttarget_host = NULL
hostgrouptarget_hostgroup = NULL
servicetarget_service = NULL
servicegrouptarget_servicegroup = NULL
int earliest_archive = 0
int item_limit = 25
int total_items = 0
int embedded
int display_header
int daemon_check
int content_type
char * csv_delimiter
char * csv_data_enclosure
int json_list_start = TRUE
int display_type = REPORT_RECENT_ALERTS
int show_all_hosts = TRUE
int show_all_hostgroups = TRUE
int show_all_servicegroups = TRUE
char * host_name = NULL
char * host_filter = NULL
char * hostgroup_name = NULL
char * servicegroup_name = NULL
char * service_desc = NULL
char * service_filter = NULL
int standard_report = SREPORT_NONE
int generate_report = FALSE
int CGI_ID = SUMMARY_CGI_ID

Define Documentation

#define AE_HARD_STATE   2

Definition at line 69 of file summary.c.

#define AE_HOST_ALERT   1

Definition at line 71 of file summary.c.

#define AE_HOST_DOWN   1

Definition at line 77 of file summary.c.

#define AE_HOST_PRODUCER   1

Definition at line 74 of file summary.c.

#define AE_HOST_UNREACHABLE   2

Definition at line 78 of file summary.c.

#define AE_HOST_UP   4

Definition at line 79 of file summary.c.

#define AE_SERVICE_ALERT   2

Definition at line 72 of file summary.c.

#define AE_SERVICE_CRITICAL   32

Definition at line 82 of file summary.c.

#define AE_SERVICE_OK   64

Definition at line 83 of file summary.c.

#define AE_SERVICE_PRODUCER   2

Definition at line 75 of file summary.c.

#define AE_SERVICE_UNKNOWN   16

Definition at line 81 of file summary.c.

#define AE_SERVICE_WARNING   8

Definition at line 80 of file summary.c.

#define AE_SOFT_STATE   1

Definition at line 68 of file summary.c.

#define REPORT_ALERT_TOTALS   2

Definition at line 53 of file summary.c.

#define REPORT_HOST_ALERT_TOTALS   5

Definition at line 56 of file summary.c.

#define REPORT_HOSTGROUP_ALERT_TOTALS   4

Definition at line 55 of file summary.c.

#define REPORT_NONE   0

Definition at line 51 of file summary.c.

#define REPORT_RECENT_ALERTS   1

Definition at line 52 of file summary.c.

#define REPORT_SERVICE_ALERT_TOTALS   6

Definition at line 57 of file summary.c.

#define REPORT_SERVICEGROUP_ALERT_TOTALS   7

Definition at line 58 of file summary.c.

#define REPORT_TOP_ALERTS   3

Definition at line 54 of file summary.c.

#define SREPORT_NONE   0

Definition at line 61 of file summary.c.

#define SREPORT_RECENT_ALERTS   1

Definition at line 62 of file summary.c.

#define SREPORT_RECENT_HOST_ALERTS   2

Definition at line 63 of file summary.c.

#define SREPORT_RECENT_SERVICE_ALERTS   3

Definition at line 64 of file summary.c.

#define SREPORT_TOP_HOST_ALERTS   4

Definition at line 65 of file summary.c.

#define SREPORT_TOP_SERVICE_ALERTS   5

Definition at line 66 of file summary.c.


Typedef Documentation


Function Documentation

void add_archived_event ( int  event_type,
time_t  time_stamp,
int  entry_type,
int  state_type,
char *  host_name,
char *  svc_description,
char *  event_info 
)

Definition at line 1342 of file summary.c.

alert_producer * add_producer ( int  producer_type,
char *  host_name,
char *  service_description 
)

Definition at line 1877 of file summary.c.

void compute_report_times ( void  )
void determine_standard_report_options ( void  )

Definition at line 1497 of file summary.c.

void display_alerts ( void  )

Definition at line 2094 of file summary.c.

void display_recent_alerts ( void  )

Definition at line 1699 of file summary.c.

void display_report ( void  )

Definition at line 1549 of file summary.c.

void display_top_alerts ( void  )

Definition at line 1933 of file summary.c.

alert_producer * find_producer ( int  type,
char *  hname,
char *  sdesc 
)

Definition at line 1858 of file summary.c.

void free_event_list ( void  )

Definition at line 1320 of file summary.c.

void free_producer_list ( void  )

Definition at line 1913 of file summary.c.

int main ( int  argc,
char **  argv 
)

Definition at line 192 of file summary.c.

int process_cgivars ( void  )
void read_archived_event_data ( void  )

Definition at line 1125 of file summary.c.

void scan_log_file_for_archived_event_data ( char *  filename)

Definition at line 1169 of file summary.c.

void sort_archive_states ( void  )

Definition at line 1455 of file summary.c.


Variable Documentation

int alert_types = AE_HOST_ALERT+AE_SERVICE_ALERT

Definition at line 149 of file summary.c.

int CGI_ID = SUMMARY_CGI_ID

ID to identify the cgi for functions in cgiutils.c

Definition at line 190 of file summary.c.

Definition at line 145 of file summary.c.

Definition at line 165 of file cgiutils.c.

Definition at line 66 of file cgiutils.c.

Definition at line 65 of file cgiutils.c.

Definition at line 127 of file summary.c.

Definition at line 169 of file cgiutils.c.

Definition at line 167 of file cgiutils.c.

int display_type = REPORT_RECENT_ALERTS

determine the view (host/service)

Definition at line 175 of file summary.c.

Definition at line 161 of file summary.c.

int embedded

Definition at line 166 of file cgiutils.c.

int end_day = 1

Definition at line 141 of file summary.c.

int end_hour = 24

Definition at line 140 of file summary.c.

int end_minute = 0

Definition at line 139 of file summary.c.

int end_month = 1

Definition at line 142 of file summary.c.

int end_second = 0

Definition at line 138 of file summary.c.

int end_year = 2000

Definition at line 143 of file summary.c.

the list with all current logentries

Definition at line 36 of file readlogs.c.

Definition at line 124 of file summary.c.

int generate_report = FALSE

Definition at line 188 of file summary.c.

char* host_filter = NULL

Definition at line 181 of file summary.c.

Definition at line 52 of file objects.c.

char* host_name = NULL

requested host name

the requested host name

Definition at line 180 of file summary.c.

int host_states = AE_HOST_UP+AE_HOST_DOWN+AE_HOST_UNREACHABLE

Definition at line 150 of file summary.c.

Definition at line 56 of file objects.c.

char* hostgroup_name = NULL

requested hostgroup name

Definition at line 182 of file summary.c.

int item_limit = 25

Definition at line 162 of file summary.c.

int json_list_start = TRUE

Definition at line 173 of file summary.c.

the log rotation method of the main Icinga log file see common.h

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.

Definition at line 125 of file summary.c.

char* service_desc = NULL

requested service name

the requested service name

Definition at line 184 of file summary.c.

char* service_filter = NULL

Definition at line 185 of file summary.c.

Definition at line 53 of file objects.c.

int service_states = AE_SERVICE_OK+AE_SERVICE_WARNING+AE_SERVICE_UNKNOWN+AE_SERVICE_CRITICAL

Definition at line 151 of file summary.c.

Definition at line 57 of file objects.c.

char* servicegroup_name = NULL

requested servicegroup name

Definition at line 183 of file summary.c.

int show_all_hostgroups = TRUE

Definition at line 177 of file summary.c.

int show_all_hosts = TRUE

if historical data is requested for all hosts

Definition at line 176 of file summary.c.

Definition at line 178 of file summary.c.

int standard_report = SREPORT_NONE

Definition at line 187 of file summary.c.

int start_day = 1

Definition at line 135 of file summary.c.

int start_hour = 0

Definition at line 134 of file summary.c.

int start_minute = 0

Definition at line 133 of file summary.c.

int start_month = 1

Definition at line 136 of file summary.c.

int start_second = 0

Definition at line 132 of file summary.c.

int start_year = 2000

Definition at line 137 of file summary.c.

int state_types = AE_HARD_STATE+AE_SOFT_STATE

Definition at line 148 of file summary.c.

time_t t1

Definition at line 129 of file summary.c.

time_t t2

Definition at line 130 of file summary.c.

host* target_host = NULL

Definition at line 156 of file summary.c.

char* target_host_name = ""

Definition at line 155 of file summary.c.

Definition at line 157 of file summary.c.

Definition at line 153 of file summary.c.

Definition at line 158 of file summary.c.

Definition at line 159 of file summary.c.

Definition at line 154 of file summary.c.

int timeperiod_type = TIMEPERIOD_CUSTOM

Definition at line 146 of file summary.c.

int total_items = 0

Definition at line 163 of file summary.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