diff --git a/html/includes/graphs/multi_bits.inc.php b/html/includes/graphs/multi_bits.inc.php index a07e35693..6cb0dcbf7 100644 --- a/html/includes/graphs/multi_bits.inc.php +++ b/html/includes/graphs/multi_bits.inc.php @@ -26,7 +26,7 @@ function graph_multi_bits ($args) { $options .= " CDEF:inbits=inoctets,8,*"; $options .= " CDEF:outbits=outoctets,8,*"; $options .= " CDEF:doutbits=doutoctets,8,*"; - if($args['legend'] == '0') { + if($args['legend'] == 'no' || $args['legend'] == '1') { $options .= " AREA:inbits#CDEB8B:"; $options .= " LINE1.25:inbits#006600:"; $options .= " AREA:doutbits#C3D9FF:"; @@ -57,7 +57,9 @@ $args['from'] = $from; $args['to'] = $to; $args['width'] = $width; $args['height'] = $height; - +if($_GET['legend']) { + $args['legend'] = $_GET['legend']; +} $graph = graph_multi_bits ($args); ?> diff --git a/includes/graphing.php b/includes/graphing.php index fb47a669d..5c7026f7f 100644 --- a/includes/graphing.php +++ b/includes/graphing.php @@ -493,22 +493,6 @@ function temp_graph_dev ($device, $graph, $from, $to, $width, $height, $title, $ return $imgfile; } -function graph_device_bits ($device, $graph, $from, $to, $width, $height, $title, $vertical, $inverse, $legend = '1') { - global $config; - $hostname = gethostbyid($device); - $query = mysql_query("SELECT `ifIndex`,`interface_id` FROM `interfaces` WHERE `device_id` = '$device' AND `ifType` NOT LIKE '%oopback%' AND `ifType` NOT LIKE '%SVI%' AND `ifType` != 'l2vlan'"); - if($width <= "300") { $options .= "--font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal "; } - $pluses = ""; - while($int = mysql_fetch_row($query)) { - if(is_file($config['rrd_dir'] . "/" . $hostname . "/" . $int[0] . ".rrd")) { - $interfaces .= $seperator . $int[1]; - $seperator = ","; - } - } - $imgfile = graph_multi_bits($interfaces, $graph, $from, $to, $width, $height, $title, $vertical, $inverse, $legend); - return $imgfile; -} - function graph_mac_acc ($id, $graph, $from, $to, $width, $height) { global $config; $imgfile = $config['install_dir'] . "/graphs/" . "$graph"; diff --git a/update-interface.php b/update-interface.php index 1e4f2b6ad..4358f7302 100755 --- a/update-interface.php +++ b/update-interface.php @@ -79,27 +79,29 @@ while ($interface = mysql_fetch_array($interface_query)) { $ifPhysAddress = strtolower(str_replace("\"", "", $ifPhysAddress)); $ifPhysAddress = str_replace(" ", ":", $ifPhysAddress); - if ( $interface['ifDescr'] != $ifDescr && $ifDescr != "" ) { - $update .= $seperator . "`ifDescr` = '$ifDescr'"; - $seperator = ", "; - mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Name -> " . $ifDescr . "')"); - } - if ( $interface['ifAlias'] != $ifAlias ) { - $update .= $seperator . "`ifAlias` = '$ifAlias'"; - $seperator = ", "; - mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Desc -> $ifAlias')"); - } - if ( $interface['ifOperStatus'] != $ifOperStatus && $ifOperStatus != "" ) { - $update .= $seperator . "`ifOperStatus` = '$ifOperStatus'"; - $seperator = ", "; - mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Interface went $ifOperStatus')"); - } - if ( $interface['ifAdminStatus'] != $ifAdminStatus && $ifAdminStatus != "" ) { - $update .= $seperator . "`ifAdminStatus` = '$ifAdminStatus'"; - $seperator = ", "; - if($ifAdminStatus == "up") { $admin = "enabled"; } else { $admin = "disabled"; } - mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Interface $admin')"); - } +# if ( $interface['ifDescr'] != $ifDescr && $ifDescr != "" ) { +# $update .= $seperator . "`ifDescr` = '$ifDescr'"; +# $seperator = ", "; +# mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Name -> " . $ifDescr . "')"); +# } +# if ( $interface['ifAlias'] != $ifAlias ) { +# $update .= $seperator . "`ifAlias` = '$ifAlias'"; +# $seperator = ", "; +# mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Desc -> $ifAlias')"); +# } + +# if ( $interface['ifOperStatus'] != $ifOperStatus && $ifOperStatus != "" ) { +# $update .= $seperator . "`ifOperStatus` = '$ifOperStatus'"; +# $seperator = ", "; +# mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Interface went $ifOperStatus')"); +# } +# if ( $interface['ifAdminStatus'] != $ifAdminStatus && $ifAdminStatus != "" ) { +# $update .= $seperator . "`ifAdminStatus` = '$ifAdminStatus'"; +# $seperator = ", "; +# if($ifAdminStatus == "up") { $admin = "enabled"; } else { $admin = "disabled"; } +# mysql_query("INSERT INTO eventlog (`host`, `interface`, `datetime`, `message`) VALUES ('" . $interface['device_id'] . "', '" . $interface['interface_id'] . "', NOW(), 'Interface $admin')"); +# } + if ( $interface['ifDuplex'] != $ifDuplex && $ifDuplex != "" ) { $update .= $seperator . "`ifDuplex` = '$ifDuplex'"; $seperator = ", ";