mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 16:04:35 +02:00
Initial Import
git-svn-id: http://www.observium.org/svn/observer/trunk@2 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
function callsgraphSNOM ($rrd, $graph, $from, $to, $width, $height, $title, $vertical) {
|
||||
global $rrdtool; global $installdir;
|
||||
$database = "rrd/" . $rrd;
|
||||
$imgfile = "graphs/" . "$graph";
|
||||
$optsa = array( "--start", $from, "--end", $to, "--width", $width, "--height", $height, "--vertical-label", $vertical ,"--alt-autoscale-max",
|
||||
"-l 0",
|
||||
"-E",
|
||||
"--title", $title,
|
||||
"DEF:call=$database:CALLS:AVERAGE",
|
||||
"CDEF:calls=call,360,*",
|
||||
"LINE1.25:calls#FF9900:Calls",
|
||||
"GPRINT:calls:LAST:Cu\: %2.0lf/min",
|
||||
"GPRINT:calls:AVERAGE:Av\: %2.0lf/min",
|
||||
"GPRINT:calls:MAX:Mx\: %2.0lf/min\\n");
|
||||
if($width <= "300") {$optsb = array("--font", "LEGEND:7:$installdir/DejaVuSansMono.ttf",
|
||||
"--font", "AXIS:6:$installdir/DejaVuSansMono.ttf",
|
||||
"--font-render-mode", "normal");}
|
||||
|
||||
$opts = array_merge($optsa, $optsb);
|
||||
|
||||
$ret = rrd_graph("$imgfile", $opts, count($opts));
|
||||
|
||||
if( !is_array($ret) ) {
|
||||
$err = rrd_error();
|
||||
echo "rrd_graph() ERROR: $err\n";
|
||||
return FALSE;
|
||||
} else {
|
||||
return $imgfile;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user