2011-04-07 19:07:47 +00:00
|
|
|
<?php
|
|
|
|
|
|
2017-03-02 09:03:45 -06:00
|
|
|
print_optionbar_start();
|
2011-04-07 19:07:47 +00:00
|
|
|
|
2017-03-02 09:03:45 -06:00
|
|
|
$link_array = [
|
|
|
|
|
'page' => 'device',
|
|
|
|
|
'device' => $device['device_id'],
|
2020-07-29 07:53:26 -05:00
|
|
|
'tab' => 'netflow',
|
2017-03-02 09:03:45 -06:00
|
|
|
];
|
2012-04-06 13:56:23 +00:00
|
|
|
|
2017-03-02 09:03:45 -06: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']);
|
2017-03-02 09:03:45 -06:00
|
|
|
|
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 . '/';
|
2017-03-02 09:03:45 -06:00
|
|
|
if (is_dir($hostDir)) {
|
2019-08-06 19:16:34 -05:00
|
|
|
$nfsenRRDchannelGlob = $hostDir . '*.rrd';
|
2017-03-02 09:03:45 -06:00
|
|
|
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;
|
2017-03-02 09:03:45 -06:00
|
|
|
} else {
|
|
|
|
|
echo ',';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($vars['channel'] == $channel) {
|
2019-08-06 19:16:34 -05:00
|
|
|
$channelFilter = $hostDir . $channel . '-filter.txt';
|
2017-03-02 09:03:45 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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';
|
2017-03-02 09:03:45 -06:00
|
|
|
} else {
|
2019-04-11 23:26:42 -05:00
|
|
|
include 'includes/html/pages/device/nfsen/general.inc.php';
|
2011-04-07 19:07:47 +00:00
|
|
|
}
|
|
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
$pagetitle[] = 'Netflow';
|