Files

53 lines
1.4 KiB
PHP
Raw Permalink Normal View History

<?php
print_optionbar_start();
2020-09-21 15:40:17 +02:00
$link_array = [
'page' => 'device',
'device' => $device['device_id'],
2020-07-29 07:53:26 -05:00
'tab' => 'netflow',
2020-09-21 15:40:17 +02:00
];
2012-04-06 13:56:23 +00:00
2020-09-21 15:40:17 +02:00
echo generate_link('General', $link_array, ['nfsen' => 'general']);
2019-08-06 19:16:34 -05:00
echo '|';
2020-09-21 15:40:17 +02:00
echo generate_link('Stats', $link_array, ['nfsen' => 'stats']);
2019-08-06 19:16:34 -05:00
$printedChannel = false;
$nfsen_hostname = nfsen_hostname($device['hostname']);
foreach (\LibreNMS\Config::get('nfsen_rrds') as $nfsenDir) {
2020-09-21 15:40:17 +02:00
$hostDir = $nfsenDir . '/' . $nfsen_hostname . '/';
if (is_dir($hostDir)) {
2020-09-21 15:40:17 +02:00
$nfsenRRDchannelGlob = $hostDir . '*.rrd';
foreach (glob($nfsenRRDchannelGlob) as $nfsenRRD) {
2020-09-21 15:40:17 +02:00
$channel = str_replace([$hostDir, '.rrd'], '', $nfsenRRD);
2020-09-21 15:40:17 +02:00
if (! $printedChannel) {
echo '|Channels:';
2019-08-06 19:16:34 -05:00
$printedChannel = true;
} else {
echo ',';
}
if ($vars['channel'] == $channel) {
2020-09-21 15:40:17 +02:00
$channelFilter = $hostDir . $channel . '-filter.txt';
}
2020-09-21 15:40:17 +02:00
echo generate_link($channel, $link_array, ['nfsen' => 'channel', 'channel' => $channel]);
}
}
}
print_optionbar_end();
2020-09-21 15:40:17 +02:00
if (! $vars['nfsen']) {
2019-08-06 19:16:34 -05:00
$vars['nfsen'] = 'general';
}
2020-09-21 15:40:17 +02:00
if (is_file('includes/html/pages/device/nfsen/' . mres($vars['nfsen']) . '.inc.php')) {
include 'includes/html/pages/device/nfsen/' . mres($vars['nfsen']) . '.inc.php';
} else {
2019-04-11 23:26:42 -05:00
include 'includes/html/pages/device/nfsen/general.inc.php';
}
$pagetitle[] = 'Netflow';