mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 16:08:55 +02:00
basic smokeping
git-svn-id: http://www.observium.org/svn/observer/trunk@2620 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
$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));
|
||||
if($target == $device['hostname'])
|
||||
{
|
||||
$files[$slave] = $file;
|
||||
}
|
||||
} else {
|
||||
$target = str_replace(".rrd", "", $file);
|
||||
if($target == $device['hostname'])
|
||||
{
|
||||
$files['observium'] = $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$i=0;
|
||||
foreach($files as $source => $filename)
|
||||
{
|
||||
$i++;
|
||||
$rrd_list[$i]['filename'] = $config['smokeping']['dir'] . $filename;
|
||||
$rrd_list[$i]['descr'] = $source;
|
||||
$rrd_list[$i]['ds'] = "median";
|
||||
}
|
||||
|
||||
$colours='mixed';
|
||||
|
||||
$nototal = 1;
|
||||
$simple_rrd = 1;
|
||||
|
||||
include("includes/graphs/generic_multi_line.inc.php");
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
$config['smokeping']['dir'] = "/var/lib/smokeping/";
|
||||
$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));
|
||||
if($slave == $device['hostname'])
|
||||
{
|
||||
$files[$target] = $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$i=0;
|
||||
foreach($files as $source => $filename)
|
||||
{
|
||||
$i++;
|
||||
$rrd_list[$i]['filename'] = $config['smokeping']['dir'] . $filename;
|
||||
$rrd_list[$i]['descr'] = $source;
|
||||
$rrd_list[$i]['ds'] = "median";
|
||||
}
|
||||
|
||||
$colours='mixed';
|
||||
|
||||
$nototal = 1;
|
||||
$simple_rrd = 1;
|
||||
|
||||
include("includes/graphs/generic_multi_line.inc.php");
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user