mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
basic smokeping
git-svn-id: http://www.observium.org/svn/observer/trunk@2620 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
59
html/pages/device/latency.inc.php
Normal file
59
html/pages/device/latency.inc.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?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>");
|
||||
|
||||
|
||||
?>
|
Reference in New Issue
Block a user