cacti制作类mrtg流量图

老总一直看mrtg。相对与我们维护cacti维护起来更容易些。本来就有了cacti,为什么还要去弄mrtg,所以就弄了cacti的流量这个

首先把这段php代码放到根目录下

<?php ob_start(); ?>


<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


<?php


if(empty($_REQUEST["key"])) die(':) missing key');

if($_REQUEST["key"] != 'longxi') die(':) error key');


$guest_account = true;


include_once("./lib/rrd.php");

include("./include/global.php");


header("Content-type: p_w_picpath/png");


/* flush the headers now */

ob_end_clean();


session_write_close();


$graph_data_array = array();


print @rrdtool_function_graph($_GET["local_graph_id"], (array_key_exists("rra_id", $_GET) ? $_GET["rra_id"] : null), $graph_data_array);



?>

第二就是这个链接2.

http://aaa.com/view_p_w_picpaths.php?action=view&local_graph_id=200&rra_id=5&key=guest

local_graph_id=200

rra_id=5

key=guest

这些是我们要填写的

然后就是一个链接就是一张图了

备注:html文件加入这个<meta http-equiv="refresh" content="跳转时间" url="链接地址"> 将它放在<head></head>之间就行了。 有自动刷新的功能




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章