mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-13 16:06:29 +02:00
git-svn-id: http://www.observium.org/svn/observer/trunk@2620 61d68cd4-352d-0410-923a-c4978735b2b8
60 lines
1.4 KiB
PHP
60 lines
1.4 KiB
PHP
<?php
|
|
|
|
#if(!$vars['view']) { $vars['view'] = "incoming"; }
|
|
if(!$vars['view']) { $vars['view'] = "outgoing"; }
|
|
|
|
$files = array();
|
|
|
|
if ($handle = opendir($config['smokeping']['dir'])) {
|
|
while (false !== ($file = readdir($handle))) {
|
|
if ($file != "." && $file != "..") {
|
|
if (eregi(".rrd", $file)) {
|
|
if (eregi("~", $file)) {
|
|
list($target,$slave) = explode("~", str_replace(".rrd", "", $file));
|
|
$files[$target][$slave] = $file;
|
|
$files_rev[$slave][$target] = $file;
|
|
} else {
|
|
$target = str_replace(".rrd", "", $file);
|
|
$files[$target]['observium'] = $file;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
if($vars['view'] == "incoming")
|
|
{
|
|
|
|
if(count($files_rev[$device['hostname']]))
|
|
{
|
|
|
|
$graph_array['type'] = "device_smokeping_in_all";
|
|
$graph_array['id'] = $device['device_id'];
|
|
|
|
include("includes/print-quadgraphs.inc.php");
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if(count($files[$device['hostname']]))
|
|
{
|
|
|
|
$graph_array['type'] = "device_smokeping_out_all";
|
|
$graph_array['id'] = $device['device_id'];
|
|
|
|
include("includes/print-quadgraphs.inc.php");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
echo("<pre>");
|
|
print_r($files);
|
|
echo("</pre>");
|
|
|
|
|
|
?>
|