/**************************************************************************
*
* TRENDS.C - NetSaint State Trends CGI
*
* Copyright (c) 1999-2001 Ethan Galstad (netsaint@netsaint.org)
* Last Modified: 10-30-2001
*
* License:
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* 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 "../common/config.h"
#include "../common/locations.h"
#include "../common/common.h"
#include "../common/objects.h"
#include "../common/comments.h"
#include "../common/statusdata.h"
#include "cgiutils.h"
#include "getcgi.h"
#include "auth.h"
#include "edata.h"
#include
\n");
if(display_type==DISPLAY_HOST_TRENDS)
snprintf(temp_buffer,sizeof(temp_buffer)-1,"Host State Trends");
else if(display_type==DISPLAY_SERVICE_TRENDS)
snprintf(temp_buffer,sizeof(temp_buffer)-1,"Service State Trends");
else
snprintf(temp_buffer,sizeof(temp_buffer)-1,"Host and Service State Trends");
temp_buffer[sizeof(temp_buffer)-1]='\x0';
display_info_table(temp_buffer,FALSE,¤t_authdata);
if(display_type!=DISPLAY_NO_TRENDS && input_type==GET_INPUT_NONE){
printf("
| \n");
/* center column of top row */
printf("\n");
if(display_type!=DISPLAY_NO_TRENDS && input_type==GET_INPUT_NONE){
printf(" \n");
if(display_type==DISPLAY_HOST_TRENDS)
printf("Host '%s'",host_name);
else if(display_type==DISPLAY_SERVICE_TRENDS)
printf("Service '%s' On Host '%s'",svc_description,host_name);
printf(" \n");
printf("\n"); printf(" \n"); get_time_string(&t1,start_timestring,sizeof(start_timestring)-1,SHORT_DATE_TIME); get_time_string(&t2,end_timestring,sizeof(end_timestring)-1,SHORT_DATE_TIME); printf(" %s to %s \n",start_timestring,end_timestring);
get_time_breakdown((time_t)(t2-t1),&days,&hours,&minutes,&seconds);
printf("Duration: %dd %dh %dm %ds \n",days,hours,minutes,seconds);
}
printf(" | \n");
/* right hand column of top row */
printf("\n");
if(display_type!=DISPLAY_NO_TRENDS && input_type==GET_INPUT_NONE){
printf(" | \n");
/* end of top table */
printf("