/*****************************************************************************
*
* STATUSWRL.C - Nagios 3-D (VRML) Network Status View
*
* Copyright (c) 1999-2006 Ethan Galstad (nagios@nagios.org)
* Last Modified: 03-27-2006
*
* Description:
*
* This CGI will dynamically create a 3-D VRML model of all hosts that are
* being monitored on your network.
*
* 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/statusdata.h"
#include "../include/cgiutils.h"
#include "../include/getcgi.h"
#include "../include/cgiauth.h"
extern char main_config_file[MAX_FILENAME_LENGTH];
extern char url_html_path[MAX_FILENAME_LENGTH];
extern char url_images_path[MAX_FILENAME_LENGTH];
extern char url_logo_images_path[MAX_FILENAME_LENGTH];
extern char *statuswrl_include;
extern host *host_list;
extern service *service_list;
extern hostextinfo *hostextinfo_list;
extern int default_statuswrl_layout_method;
#define NAGIOS_VRML_IMAGE "nagiosvrml.png"
#define DEFAULT_NODE_WIDTH 0.5
#define DEFAULT_HORIZONTAL_SPACING 1.0
#define DEFAULT_VERTICAL_SPACING 1.0
/* needed for auto-layout modes */
#define DEFAULT_NODE_HEIGHT 0.5
#define DEFAULT_NODE_HSPACING 1.0
#define DEFAULT_NODE_VSPACING 1.0
#define CIRCULAR_DRAWING_RADIUS 5.0
#define LAYOUT_USER_SUPPLIED 0
#define LAYOUT_COLLAPSED_TREE 2
#define LAYOUT_BALANCED_TREE 3
#define LAYOUT_CIRCULAR 4
void calculate_host_coords(void);
void calculate_world_bounds(void);
void display_world(void);
void write_global_vrml_data(void);
void draw_process_icon(void);
void draw_host(hostextinfo *);
void draw_host_links(void);
void draw_host_link(host *,double,double,double,double,double,double);
void document_header(void);
int process_cgivars(void);
int number_of_host_layer_members(host *,int);
int max_child_host_layer_members(host *);
int host_child_depth_separation(host *, host *);
int max_child_host_drawing_width(host *);
void calculate_balanced_tree_coords(host *,int,int);
void calculate_circular_coords(void);
void calculate_circular_layer_coords(host *,double,double,int,int);
authdata current_authdata;
float link_radius=0.016;
float floor_width=0.0;
float floor_depth=0.0;
double min_z_coord=0.0;
double min_x_coord=0.0;
=1= |