mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 16:06:25 +02:00
smokeping basic working
git-svn-id: http://www.observium.org/svn/observer/trunk@2622 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -75,7 +75,7 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
</li>');
|
||||
}
|
||||
|
||||
if (is_dir($config['collectd_dir'] . "/" . $device['hostname'] ."/"))
|
||||
if (isset($config['collectd_dir']) && is_dir($config['collectd_dir'] . "/" . $device['hostname'] ."/"))
|
||||
{
|
||||
echo('<li class="' . $select['collectd'] . '">
|
||||
<a href="'.generate_device_url($device, array('tab' => 'collectd')).'">
|
||||
@@ -93,6 +93,37 @@ if (device_permitted($vars['device']) || $check_device == $vars['device'])
|
||||
</li>');
|
||||
}
|
||||
|
||||
if(isset($config['smokeping']['dir'])) {
|
||||
$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));
|
||||
$smokeping_files['in'][$target][$slave] = $file;
|
||||
$smokeping_files['out'][$slave][$target] = $file;
|
||||
} else {
|
||||
$target = str_replace(".rrd", "", $file);
|
||||
$smokeping_files['in'][$target][$config['own_hostname']] = $file;
|
||||
$smokeping_files['out'][$config['own_hostname']][$target] = $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (count($smokeping_files))
|
||||
{
|
||||
echo('<li class="' . $select['latency'] . '">
|
||||
<a href="'.generate_device_url($device, array('tab' => 'latency')).'">
|
||||
<img src="images/16/arrow_undo.png" align="absmiddle" border="0" /> Latency
|
||||
</a>
|
||||
</li>');
|
||||
}
|
||||
|
||||
if (@dbFetchCell("SELECT COUNT(vlan_id) FROM vlans WHERE device_id = '" . $device['device_id'] . "'") > '0')
|
||||
{
|
||||
echo('<li class="' . $select['vlans'] . '">
|
||||
|
||||
Reference in New Issue
Block a user