mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
Adding total traffic per device graph generation
git-svn-id: http://www.observium.org/svn/observer/trunk@57 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
+13
-8
@@ -11,12 +11,14 @@
|
||||
include("includes/authenticate.inc");
|
||||
|
||||
if($_GET['host']) {
|
||||
$hostid = $_GET['host'];
|
||||
$device = $_GET['host'];
|
||||
} elseif($_GET['device']) {
|
||||
$device = $_GET['device'];
|
||||
} else {
|
||||
$hostid = getifhost($_GET['if']);
|
||||
$device = getifhost($_GET['if']);
|
||||
$ifIndex = getifindexbyid($_GET['if']);
|
||||
}
|
||||
$hostname = gethostbyid($hostid);
|
||||
$hostname = gethostbyid($device);
|
||||
$from = $_GET['from'];
|
||||
$to = $_GET['to'];
|
||||
$width = $_GET['width'];
|
||||
@@ -28,10 +30,13 @@
|
||||
|
||||
$graphfile = $hostname . ".". $ifIndex . "-" . $type . ".png";
|
||||
|
||||
$os = gethostosbyid($hostid);
|
||||
$os = gethostosbyid($device);
|
||||
|
||||
switch ($type) {
|
||||
|
||||
|
||||
case 'device_bits':
|
||||
$graph = graph_device_bits ($device, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
case 'bits':
|
||||
$graph = trafgraph ($hostname . ".". $ifIndex . ".rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
@@ -48,7 +53,7 @@
|
||||
$graph = uptimegraph ($hostname . "-uptime.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
case 'unixfs':
|
||||
$graph = unixfsgraph ($hostid, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = unixfsgraph ($device, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
case 'calls':
|
||||
$graph = callsgraphSNOM ($hostname . "-data.rrd", $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
@@ -79,7 +84,7 @@
|
||||
}
|
||||
break;
|
||||
case 'temp':
|
||||
$graph = temp_graph ($hostid, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = temp_graph ($device, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
break;
|
||||
case 'mem':
|
||||
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
|
||||
@@ -116,7 +121,7 @@
|
||||
break;
|
||||
case 'unixfs':
|
||||
if($os == "Linux" || $os == "FreeBSD" || $os == "DragonFly" || $os == "OpenBSD" || $os == "NetBSD" ) {
|
||||
$graph = unixfsgraph ($hostid, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
$graph = unixfsgraph ($device, $graphfile, $from, $to, $width, $height, $title, $vertical);
|
||||
}
|
||||
break;
|
||||
case 'postfix':
|
||||
|
||||
Reference in New Issue
Block a user