/**************************************************************************
*
* STATUS.C - Nagios Status CGI
*
* Copyright (c) 1999-2007 Ethan Galstad (nagios@nagios.org)
* Last Modified: 04-10-2007
*
* 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/comments.h"
#include "../include/statusdata.h"
#include "../include/cgiutils.h"
#include "../include/getcgi.h"
#include "../include/cgiauth.h"
extern int refresh_rate;
extern time_t program_start;
extern char main_config_file[MAX_FILENAME_LENGTH];
extern char url_html_path[MAX_FILENAME_LENGTH];
extern char url_docs_path[MAX_FILENAME_LENGTH];
extern char url_images_path[MAX_FILENAME_LENGTH];
extern char url_stylesheets_path[MAX_FILENAME_LENGTH];
extern char url_logo_images_path[MAX_FILENAME_LENGTH];
extern char url_media_path[MAX_FILENAME_LENGTH];
extern char log_file[MAX_FILENAME_LENGTH];
extern char *service_critical_sound;
extern char *service_warning_sound;
extern char *service_unknown_sound;
extern char *host_down_sound;
extern char *host_unreachable_sound;
extern char *normal_sound;
extern int suppress_alert_window;
extern host *host_list;
extern service *service_list;
extern hostgroup *hostgroup_list;
extern servicegroup *servicegroup_list;
extern hoststatus *hoststatus_list;
extern servicestatus *servicestatus_list;
#define MAX_MESSAGE_BUFFER 4096
#define DISPLAY_HOSTS 0
#define DISPLAY_HOSTGROUPS 1
#define DISPLAY_SERVICEGROUPS 2
#define STYLE_OVERVIEW 0
#define STYLE_DETAIL 1
#define STYLE_SUMMARY 2
#define STYLE_GRID 3
#define STYLE_HOST_DETAIL 4
/* HOSTSORT structure */
typedef struct hostsort_struct{
hoststatus *hststatus;
struct hostsort_struct *next;
}hostsort;
/* SERVICESORT structure */
typedef struct servicesort_struct{
servicestatus *svcstatus;
struct servicesort_struct *next;
}servicesort;
hostsort *hostsort_list=NULL;
servicesort *servicesort_list=NULL;
int sort_services(int,int); /* sorts services */
int sort_hosts(int,int); /* sorts hosts */
int compare_servicesort_entries(int,int,servicesort *,servicesort *); /* compares service sort entries */
int compare_hostsort_entries(int,int,hostsort *,hostsort *); /* compares host sort entries */
void free_servicesort_list(void);
void free_hostsort_list(void);
void show_host_status_totals(void);
void show_service_status_totals(void);
void show_service_detail(void);
void show_host_detail(void);
=1= |