Closed chathurag closed 6 years ago
Hi, what browser do you use? In Chrome and Firefox works fine by dafault on any graphs.
Chrome - Version 63.0.3239.132 (Official Build) (64-bit)
Firefox - 42.0
On both browsers I can see scroll bars.
You see graph size problems on this link? http://lg.hsdn.org/?command=graph&protocol=ipv4&query=8.8.8.8&router=test
No Its fine.
Use the following link to check. http://lg.lankabell.com/index.php.bak
UN - test PWD - test
For fine working the pages, you need to use the html doctype of original version of LG script. Also, you need use latest version of script with changes in html. Please update to latest version.
I have used the Latest one. Still same. Is this because of graphviz tool?
I see the following html on your LG site:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
This is not a latest version of html part. For correct working, you need all code from the current version of script.
And, the graphviz tool (svg document) does not affect this. The problem on rendering an html page. I guess this is related to the doctype and the order of loading html tags. In the latest version, there are no such problems, you see this on our LG website.
Please use the following config for tests (the "AT&T example" not working now):
'test5' => array
(
'url' => 'telnet://route-server.eastlink.ca:23',
'pingtraceurl' => FALSE,
'description' => 'TEST5',
'group' => 'TEST',
'ipv6' => TRUE,
'os' => 'ios',
),
More Telnet route-servers for tests you can find on this site: http://traceroute.org/#Route%20Servers
I have added our own router.
However I still get the graph in same way.
Can be this be because of PHP version, Apache version.
http://lg.lankabell.com/?command=graph&protocol=ipv4&query=8.8.8.8&router=SLIC-LG-001
UN = test PWD=test
I found the problem. Your server sends an svg document as text/html, but should send it as image/svg+xml. Probably, your server disables the header() php function in the Image_GraphViz library. This function needed for set the correct Content-Type. See your server settings, maybe it's security settings php.
The same problem with the rendering of png, the link does not show: http://lg.lankabell.com/?command=graph&protocol=ipv4&query=8.8.8.8&router=SLIC-LG-001&render=png
And should works fine like this: http://lg.hsdn.org/?command=graph&protocol=ipv4&query=8.8.8.8&router=test5&render=png
In any case, this is not a LG script error.
Also, please check your php.ini, you need to enable a Output Buffering by setting:
output_buffering = 4096
If you use nginx server as front-end, you need set the following settings in the nginx config for disable buffering and gzip compression in the proxying:
gzip off;
proxy_buffering off;
Output buffering is set to 4096,
However could you please let me know how to set content type?
The Image_GraphViz library does this in these lines of code (see GraphViz.php in your Pear include dir):
...
case 'gif':
case 'png':
case 'bmp':
case 'jpeg':
case 'tiff':
header('Content-Type: image/' . $format);
break;
...
case 'svg':
header('Content-Type: image/svg+xml');
break;
...
You do not need to set the Content-Type manually in script.
I need to know how can I enable this with php?
By default, it is not disabled. Probably, this is some kind of problem with the server.
Check the work of the headers by creating a simple script:
<?php
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
header('Content-Type: image/jpeg');
imagejpeg($im);
imagedestroy($im);
And open it in your browser. If works, you should see the image with text, like this http://dev.hsdn.org/gd_test.php
It works.
however graph is still same
I do not know how to solve this problem. this is a server problem, not a bug in the script.
Try to add a following lines to LG script (for tests):
switch ($format)
{
case 'png':
header('Content-Type: image/png');
break;
case 'svg':
header('Content-Type: image/svg+xml');
break;
}
before the lines:
$graph->image($format);
exit;
Fixed by upgrading php from 5.3 to 5.4
Ok, thanks for this information.
Used given configurations to display bgp graph, however it displays as follows with scroll bars. Unable to get size automatically.