* * @package observium * @subpackage graphing * @author T. Lechat , Manuel Kasper , Jonathan Watt * @copyright 2004-2006 T. Lechat , Manuel Kasper , Jonathan Watt * @license BSD * */ include_once("../includes/defaults.inc.php"); include_once("../config.php"); include_once("../includes/definitions.inc.php"); include_once("../includes/common.php"); include_once("../includes/dbFacile.php"); include_once("../includes/rewrites.php"); include_once("includes/functions.inc.php"); include_once("includes/authenticate.inc.php"); include_once("../includes/snmp.inc.php"); if (is_numeric($_GET['id']) && ($config['allow_unauth_graphs'] || port_permitted($_GET['id']))) { $port = get_port_by_id($_GET['id']); $device = device_by_id_cache($port['device_id']); $title = generate_device_link($device); $title .= " :: Port ".generate_port_link($port); $auth = TRUE; } else { echo("Unauthenticad"); die; } header("Content-type: image/svg+xml"); /********** HTTP GET Based Conf ***********/ $ifnum=@$port['ifIndex']; // BSD / SNMP interface name / number $ifname=@$port['ifDescr']; //Interface name that will be showed on top right of graph $hostname=shorthost($device['hostname']); if($_GET['title']) { $ifname = $_GET['title']; } /********* Other conf *******/ $scale_type="follow"; //Autoscale default setup : "up" = only increase scale; "follow" = increase and decrease scale according to current graphed datas $nb_plot=240; //NB plot in graph if(is_numeric($_GET['interval'])) { $time_interval=$_GET['interval']; } else { $time_interval=1; //Refresh time Interval } $fetch_link = "data.php?id=".$_GET[id]; //SVG attributes $attribs['axis']='fill="black" stroke="black"'; $attribs['in']='fill="green" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="7"'; $attribs['out']='fill="blue" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="7"'; $attribs['graph_in']='fill="none" stroke="green" stroke-opacity="0.8"'; $attribs['graph_out']='fill="none" stroke="blue" stroke-opacity="0.8"'; $attribs['legend']='fill="black" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="4"'; $attribs['graphname']='fill="#435370" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="9"'; $attribs['hostname']='fill="#435370" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="6"'; $attribs['grid_txt']='fill="gray" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="6"'; $attribs['grid']='stroke="gray" stroke-opacity="0.5"'; $attribs['switch_unit']='fill="#435370" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="4" text-decoration="underline"'; $attribs['switch_scale']='fill="#435370" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="4" text-decoration="underline"'; $attribs['error']='fill="blue" font-family="Arial" font-size="4"'; $attribs['collect_initial']='fill="gray" font-family="Tahoma, Verdana, Arial, Helvetica, sans-serif" font-size="4"'; //Error text if we cannot fetch data : depends on which method is used $error_text = "Cannot get data about interface $ifnum"; $height=125; //SVG internal height : do not modify $width=300; //SVG internal width : do not modify /********* Graph DATA **************/ print('' . "\n");?> " preserveAspectRatio="none" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" onload="init(evt)"> /> /> /> /> /> text-anchor="end"> text-anchor="end"> text-anchor="end"> >In >Out > > text-anchor="end"> text-anchor="end"> >Switch to bytes/s >AutoScale () > >Graph shows last seconds points=" "/> text-anchor="middle"> text-anchor="middle">Collecting initial data, please wait...