示例#1
0
        if ($v == 'yes') {
            $exclude_ds[$ds] = 1;
        }
    }
}
$ds_colors = array();
if (isset($_GET['ds_colors'])) {
    // build array of datasources to and color code
    foreach ($_GET['ds_colors'] as $ds => $v) {
        $ds_colors[$ds] = $v;
    }
}
// Ok now we have all info.
// Lets create the graph we want.
$rrd = new RRD("{$rrd_dir}/{$file}", $rrdtool);
if ($rrd->get_error()) {
    //print $rrd->get_error();
    //exit;
    // This will render a nice img
}
if ($type == "traffic") {
    $graph_params = array('type' => 'traffic', 'title' => $title, 'legend' => $legend, 'width' => $width, 'height' => $height, 'start' => $from, 'end' => $to);
    $graphfile = $rrd->get_graph($graph_params);
} elseif ($type == "errors") {
    $graph_params = array('type' => 'errors', 'title' => $title, 'legend' => $legend, 'width' => $width, 'height' => $height, 'start' => $from, 'end' => $to);
    $graphfile = $rrd->get_graph($graph_params);
} elseif ($type == "unicastpkts") {
    $graph_params = array('type' => 'unicastpkts', 'title' => $title, 'legend' => $legend, 'width' => $width, 'height' => $height, 'start' => $from, 'end' => $to);
    $graphfile = $rrd->get_graph($graph_params);
} elseif ($type == "nonunicastpkts") {
    $graph_params = array('type' => 'nonunicastpkts', 'title' => $title, 'legend' => $legend, 'width' => $width, 'height' => $height, 'start' => $from, 'end' => $to);