Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.4 KiB
PHP
Raw Permalink Normal View History

<?php
print_optionbar_start();
$link_array = [
'page' => 'device',
'device' => $device['device_id'],
2020-07-29 07:53:26 -05:00
'tab' => 'netflow',
];
2012-04-06 13:56:23 +00:00
echo generate_link('General', $link_array, ['nfsen' => 'general']);
2019-08-06 19:16:34 -05:00
echo '|';
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) {
$hostDir = $nfsenDir . '/' . $nfsen_hostname . '/';
if (is_dir($hostDir)) {
2019-08-06 19:16:34 -05:00
$nfsenRRDchannelGlob = $hostDir . '*.rrd';
foreach (glob($nfsenRRDchannelGlob) as $nfsenRRD) {
$channel = str_replace([$hostDir, '.rrd'], '', $nfsenRRD);
if (! $printedChannel) {
echo '|Channels:';
2019-08-06 19:16:34 -05:00
$printedChannel = true;
} else {
echo ',';
}
if ($vars['channel'] == $channel) {
2019-08-06 19:16:34 -05:00
$channelFilter = $hostDir . $channel . '-filter.txt';
}
echo generate_link($channel, $link_array, ['nfsen' => 'channel', 'channel' => $channel]);
}
}
}
print_optionbar_end();
2019-08-06 19:16:34 -05:00
if (! $vars['nfsen']) {
$vars['nfsen'] = 'general';
}
2021-03-28 17:25:30 -05:00
if (is_file('includes/html/pages/device/nfsen/' . $vars['nfsen'] . '.inc.php')) {
include 'includes/html/pages/device/nfsen/' . $vars['nfsen'] . '.inc.php';
} else {
2019-04-11 23:26:42 -05:00
include 'includes/html/pages/device/nfsen/general.inc.php';
}
$pagetitle[] = 'Netflow';