Icinga-core 1.4.0
next gen monitoring
cgi/showlog.c File Reference

cgi to browse through Icinga log data More...

#include "../include/config.h"
#include "../include/common.h"
#include "../include/objects.h"
#include "../include/getcgi.h"
#include "../include/cgiutils.h"
#include "../include/cgiauth.h"
#include "../include/readlogs.h"

Go to the source code of this file.

Functions

int process_cgivars (void)
 Parses the requested GET/POST variables.
void display_logentries (void)
 displays the requested log entries
void show_filter (void)
 displays the little filter list in the top right corner
void display_own_nav_table (void)
 displays the navigation in the top center of the page
int main (void)
 Yes we need a main function.

Variables

External vars
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 * csv_delimiter
char * csv_data_enclosure
int log_rotation_method
int enable_splunk_integration
int showlog_initial_states
int showlog_current_states
int escape_html_tags
int embedded
int display_header
int daemon_check
int date_format
int content_type
int refresh
logentryentry_list
Vars which are imported for cgiutils
Warning:
these wars should be all extern,
then they could get deleted, because they aren't used here.
cgiutils.c , needs them
int display_type = DISPLAY_HOSTS
int show_all_hosts = TRUE
int show_all_hostgroups = TRUE
int show_all_servicegroups = TRUE
char * host_name = NULL
char * hostgroup_name = NULL
char * servicegroup_name = NULL
char * service_desc = NULL
Internal vars
int display_frills = TRUE
int display_timebreaks = TRUE
int reverse = FALSE
int timeperiod_type = TIMEPERIOD_SINGLE_DAY
int show_notifications = TRUE
int show_host_status = TRUE
int show_service_status = TRUE
int show_external_commands = TRUE
int show_system_messages = TRUE
int show_event_handler = TRUE
int show_flapping = TRUE
int show_downtime = TRUE
char * query_string = NULL
char * start_time_string = ""
char * end_time_string = ""
time_t ts_start = 0L
time_t ts_end = 0L
time_t ts_midnight = 0L
authdata current_authdata
int CGI_ID = SHOWLOG_CGI_ID

Detailed Description

cgi to browse through Icinga log data

Definition in file showlog.c.


Function Documentation

void display_logentries ( void  )

displays the requested log entries

Applies the requested filters, reads in all necessary log files and afterwards showing each log entry.

Definition at line 540 of file showlog.c.

void display_own_nav_table ( void  )

displays the navigation in the top center of the page

This is a remake of the display_nav_table function from cgiutils.c But this one works with timestamps instead of archive numbers.

Definition at line 1011 of file showlog.c.

int main ( void  )

Yes we need a main function.

Definition at line 140 of file showlog.c.

int process_cgivars ( void  )

Parses the requested GET/POST variables.

Returns:
wether parsing was successful or not
Return values:
TRUE
FALSE
This function parses the request and set's the necessary variables
void show_filter ( void  )

displays the little filter list in the top right corner

Just to show the filter in an own function. Get's called in main

Definition at line 933 of file showlog.c.


Variable Documentation

int CGI_ID = SHOWLOG_CGI_ID

ID to identify the cgi for functions in cgiutils.c

Definition at line 107 of file showlog.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.

struct to hold current authentication data

Definition at line 105 of file showlog.c.

Definition at line 169 of file cgiutils.c.

Definition at line 243 of file icinga.c.

int display_frills = TRUE

determine if icons should be shown in listing

Definition at line 83 of file showlog.c.

Definition at line 167 of file cgiutils.c.

int display_timebreaks = TRUE

determine if time breaks should be shown

Definition at line 84 of file showlog.c.

int display_type = DISPLAY_HOSTS

determine the view (host/service)

Definition at line 71 of file showlog.c.

int embedded

Definition at line 166 of file cgiutils.c.

Definition at line 72 of file cgiutils.c.

char* end_time_string = ""

the requested end time

Definition at line 99 of file showlog.c.

the list with all current logentries

Definition at line 36 of file readlogs.c.

Definition at line 119 of file cgiutils.c.

char* host_name = NULL

requested host name

the requested host name

Definition at line 75 of file showlog.c.

char* hostgroup_name = NULL

requested hostgroup name

Definition at line 76 of file showlog.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.

char* query_string = NULL

the request query string

Definition at line 97 of file showlog.c.

int refresh

Definition at line 168 of file cgiutils.c.

int reverse = FALSE

determine if log should be viewed in reverse order

Definition at line 85 of file showlog.c.

char* service_desc = NULL

requested service name

the requested service name

Definition at line 78 of file showlog.c.

char* servicegroup_name = NULL

requested servicegroup name

Definition at line 77 of file showlog.c.

int show_all_hostgroups = TRUE

Definition at line 73 of file showlog.c.

int show_all_hosts = TRUE

if historical data is requested for all hosts

Definition at line 72 of file showlog.c.

Definition at line 74 of file showlog.c.

void show_downtime = TRUE

filter option

Definition at line 95 of file showlog.c.

int show_event_handler = TRUE

filter option

Definition at line 93 of file showlog.c.

filter option

Definition at line 91 of file showlog.c.

int show_flapping = TRUE

filter option

Definition at line 94 of file showlog.c.

int show_host_status = TRUE

filter option

Definition at line 89 of file showlog.c.

int show_notifications = TRUE

filter option

Definition at line 88 of file showlog.c.

int show_service_status = TRUE

filter option

Definition at line 90 of file showlog.c.

filter option

Definition at line 92 of file showlog.c.

Definition at line 136 of file cgiutils.c.

Definition at line 135 of file cgiutils.c.

char* start_time_string = ""

the requested start time

Definition at line 98 of file showlog.c.

int timeperiod_type = TIMEPERIOD_SINGLE_DAY

determines the time period to view see cgiutils.h

Definition at line 86 of file showlog.c.

time_t ts_end = 0L

end time as unix timestamp

Definition at line 102 of file showlog.c.

time_t ts_midnight = 0L

current midnight unix timestamp

Definition at line 103 of file showlog.c.

time_t ts_start = 0L

start time as unix timestamp

Definition at line 101 of file showlog.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