/***********************************************************************
*
* HISTORY.C - Nagios History CGI
*
* Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org)
* Last Modified: 04-10-2007
*
* This CGI program will display the history for the specified host.
* If no host is specified, the history for all hosts will be displayed.
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
***********************************************************************/
#include "../include/config.h"
#include "../include/common.h"
#include "../include/objects.h"
#include "../include/getcgi.h"
#include "../include/cgiutils.h"
#include "../include/cgiauth.h"
#define DISPLAY_HOSTS 0
#define DISPLAY_SERVICES 1
#define SERVICE_HISTORY 0
#define HOST_HISTORY 1
#define SERVICE_FLAPPING_HISTORY 2
#define HOST_FLAPPING_HISTORY 3
#define SERVICE_DOWNTIME_HISTORY 4
#define HOST_DOWNTIME_HISTORY 5
#define STATE_ALL 0
#define STATE_SOFT 1
#define STATE_HARD 2
void get_history(void);
void document_header(int);
void document_footer(void);
int process_cgivars(void);
extern char main_config_file[MAX_FILENAME_LENGTH];
extern char url_images_path[MAX_FILENAME_LENGTH];
extern char url_stylesheets_path[MAX_FILENAME_LENGTH];
extern int log_rotation_method;
authdata current_authdata;
char log_file_to_use[MAX_FILENAME_LENGTH];
int log_archive=0;
int show_all_hosts=TRUE;
char *host_name="all";
char *svc_description="";
int display_type=DISPLAY_HOSTS;
int use_lifo=TRUE;
int history_options=HISTORY_ALL;
int state_options=STATE_ALL;
int embedded=FALSE;
int display_header=TRUE;
int display_frills=TRUE;
int display_timebreaks=TRUE;
int display_system_messages=TRUE;
int display_flapping_alerts=TRUE;
int display_downtime_alerts=TRUE;
int main(void){
int result=OK;
char temp_buffer[MAX_INPUT_BUFFER];
char temp_buffer2[MAX_INPUT_BUFFER];
/* get the variables passed to us */
process_cgivars();
/* reset internal CGI variables */
reset_cgi_vars();
/* read the CGI configuration file */
result=read_cgi_config_file(get_cgi_config_location());
if(result==ERROR){
document_header(FALSE);
cgi_config_file_error(get_cgi_config_location());
document_footer();
=1= |