Files
librenms-librenms/includes/html/pages/device/nfsen.inc.php

53 lines
1.4 KiB
PHP
Raw Normal View History

<?php
feature: Updated Nfsen integration support (#6003) * add single pool based poller for php-fpm * add the page for php-fpm * add graph for php-fpm * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * use named OID as suggest by @laf * document PHP-FPM monitoring * link it in the index * clean up the named oid * add how to grab the script in question * add f2b poller * add f2b app page * add f2b graph * add fail2ban notes * minor formatting cleanup * ...more formatting cleanup * rename it so it can be called via the app page * Revert "rename it so it can be called via the app page" This reverts commit 0bde88a03840138fa28b75606e3cd269ce023f67. * *rename it so it can be called via the apps page *setup the apps page to call it * renamed the graph * now include fail2ban in the apps properly * correct the wget command so it does not stomp on phpfpm-sp * update the fail2ban poller for the newest fail2ban script and now build multiple RRDs * update for now graphing firewalled and banned * update fail2ban docs to match the newest snmpd extend method * search automatically for jails and graph them * graphs the currently banned for a fail2ban jail * change the tital of the graph for the total banned to make it more descriptive * Add a explanation of the two variables in the total graph. * misc. white space cleans ups * misc. white space cleanup * minor white space cleanup * correct descr lenght * correct descr lenght * Update fail2ban.inc.php * Use rrd_name properly * note the cache file bits * make caching optional and note why * Update to new RrdDefinition class * And the use statement ;/ * Messed the second rrd_def * correct two minor errors that did not seem to be causing issues * don't use $vars as per pull #5994 * don't use $vars as per pull #5994 * fix jails graphs * Remove loops and temp variables * whitespace * Change graph so we don't get fractions * add the common nfsen channel include * add nfsen channel flows graph * add nfsen channel packet graph * add nfsen channel traffic graph * update nfsen for channel support * the nfsen general page * add the nfsen channel page * update the docs on nfsen to be more clear about configuring it * white space cleanup * white space cleanup * misc code cleanup * now consistently uses all the same quotes * minor code cleanups * Update nfsen_channel_common.inc.php * minor white space cleanup
2017-03-02 09:03:45 -06:00
print_optionbar_start();
2020-09-21 15:40:17 +02:00
$link_array = [
feature: Updated Nfsen integration support (#6003) * add single pool based poller for php-fpm * add the page for php-fpm * add graph for php-fpm * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * use named OID as suggest by @laf * document PHP-FPM monitoring * link it in the index * clean up the named oid * add how to grab the script in question * add f2b poller * add f2b app page * add f2b graph * add fail2ban notes * minor formatting cleanup * ...more formatting cleanup * rename it so it can be called via the app page * Revert "rename it so it can be called via the app page" This reverts commit 0bde88a03840138fa28b75606e3cd269ce023f67. * *rename it so it can be called via the apps page *setup the apps page to call it * renamed the graph * now include fail2ban in the apps properly * correct the wget command so it does not stomp on phpfpm-sp * update the fail2ban poller for the newest fail2ban script and now build multiple RRDs * update for now graphing firewalled and banned * update fail2ban docs to match the newest snmpd extend method * search automatically for jails and graph them * graphs the currently banned for a fail2ban jail * change the tital of the graph for the total banned to make it more descriptive * Add a explanation of the two variables in the total graph. * misc. white space cleans ups * misc. white space cleanup * minor white space cleanup * correct descr lenght * correct descr lenght * Update fail2ban.inc.php * Use rrd_name properly * note the cache file bits * make caching optional and note why * Update to new RrdDefinition class * And the use statement ;/ * Messed the second rrd_def * correct two minor errors that did not seem to be causing issues * don't use $vars as per pull #5994 * don't use $vars as per pull #5994 * fix jails graphs * Remove loops and temp variables * whitespace * Change graph so we don't get fractions * add the common nfsen channel include * add nfsen channel flows graph * add nfsen channel packet graph * add nfsen channel traffic graph * update nfsen for channel support * the nfsen general page * add the nfsen channel page * update the docs on nfsen to be more clear about configuring it * white space cleanup * white space cleanup * misc code cleanup * now consistently uses all the same quotes * minor code cleanups * Update nfsen_channel_common.inc.php * minor white space cleanup
2017-03-02 09:03:45 -06:00
'page' => 'device',
'device' => $device['device_id'],
2020-07-29 07:53:26 -05:00
'tab' => 'netflow',
2020-09-21 15:40:17 +02:00
];
2020-09-21 15:40:17 +02:00
echo generate_link('General', $link_array, ['nfsen' => 'general']);
echo '|';
2020-09-21 15:40:17 +02:00
echo generate_link('Stats', $link_array, ['nfsen' => 'stats']);
feature: Updated Nfsen integration support (#6003) * add single pool based poller for php-fpm * add the page for php-fpm * add graph for php-fpm * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * use named OID as suggest by @laf * document PHP-FPM monitoring * link it in the index * clean up the named oid * add how to grab the script in question * add f2b poller * add f2b app page * add f2b graph * add fail2ban notes * minor formatting cleanup * ...more formatting cleanup * rename it so it can be called via the app page * Revert "rename it so it can be called via the app page" This reverts commit 0bde88a03840138fa28b75606e3cd269ce023f67. * *rename it so it can be called via the apps page *setup the apps page to call it * renamed the graph * now include fail2ban in the apps properly * correct the wget command so it does not stomp on phpfpm-sp * update the fail2ban poller for the newest fail2ban script and now build multiple RRDs * update for now graphing firewalled and banned * update fail2ban docs to match the newest snmpd extend method * search automatically for jails and graph them * graphs the currently banned for a fail2ban jail * change the tital of the graph for the total banned to make it more descriptive * Add a explanation of the two variables in the total graph. * misc. white space cleans ups * misc. white space cleanup * minor white space cleanup * correct descr lenght * correct descr lenght * Update fail2ban.inc.php * Use rrd_name properly * note the cache file bits * make caching optional and note why * Update to new RrdDefinition class * And the use statement ;/ * Messed the second rrd_def * correct two minor errors that did not seem to be causing issues * don't use $vars as per pull #5994 * don't use $vars as per pull #5994 * fix jails graphs * Remove loops and temp variables * whitespace * Change graph so we don't get fractions * add the common nfsen channel include * add nfsen channel flows graph * add nfsen channel packet graph * add nfsen channel traffic graph * update nfsen for channel support * the nfsen general page * add the nfsen channel page * update the docs on nfsen to be more clear about configuring it * white space cleanup * white space cleanup * misc code cleanup * now consistently uses all the same quotes * minor code cleanups * Update nfsen_channel_common.inc.php * minor white space cleanup
2017-03-02 09:03:45 -06: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 . '/';
feature: Updated Nfsen integration support (#6003) * add single pool based poller for php-fpm * add the page for php-fpm * add graph for php-fpm * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * use named OID as suggest by @laf * document PHP-FPM monitoring * link it in the index * clean up the named oid * add how to grab the script in question * add f2b poller * add f2b app page * add f2b graph * add fail2ban notes * minor formatting cleanup * ...more formatting cleanup * rename it so it can be called via the app page * Revert "rename it so it can be called via the app page" This reverts commit 0bde88a03840138fa28b75606e3cd269ce023f67. * *rename it so it can be called via the apps page *setup the apps page to call it * renamed the graph * now include fail2ban in the apps properly * correct the wget command so it does not stomp on phpfpm-sp * update the fail2ban poller for the newest fail2ban script and now build multiple RRDs * update for now graphing firewalled and banned * update fail2ban docs to match the newest snmpd extend method * search automatically for jails and graph them * graphs the currently banned for a fail2ban jail * change the tital of the graph for the total banned to make it more descriptive * Add a explanation of the two variables in the total graph. * misc. white space cleans ups * misc. white space cleanup * minor white space cleanup * correct descr lenght * correct descr lenght * Update fail2ban.inc.php * Use rrd_name properly * note the cache file bits * make caching optional and note why * Update to new RrdDefinition class * And the use statement ;/ * Messed the second rrd_def * correct two minor errors that did not seem to be causing issues * don't use $vars as per pull #5994 * don't use $vars as per pull #5994 * fix jails graphs * Remove loops and temp variables * whitespace * Change graph so we don't get fractions * add the common nfsen channel include * add nfsen channel flows graph * add nfsen channel packet graph * add nfsen channel traffic graph * update nfsen for channel support * the nfsen general page * add the nfsen channel page * update the docs on nfsen to be more clear about configuring it * white space cleanup * white space cleanup * misc code cleanup * now consistently uses all the same quotes * minor code cleanups * Update nfsen_channel_common.inc.php * minor white space cleanup
2017-03-02 09:03:45 -06:00
if (is_dir($hostDir)) {
2020-09-21 15:40:17 +02:00
$nfsenRRDchannelGlob = $hostDir . '*.rrd';
feature: Updated Nfsen integration support (#6003) * add single pool based poller for php-fpm * add the page for php-fpm * add graph for php-fpm * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * use named OID as suggest by @laf * document PHP-FPM monitoring * link it in the index * clean up the named oid * add how to grab the script in question * add f2b poller * add f2b app page * add f2b graph * add fail2ban notes * minor formatting cleanup * ...more formatting cleanup * rename it so it can be called via the app page * Revert "rename it so it can be called via the app page" This reverts commit 0bde88a03840138fa28b75606e3cd269ce023f67. * *rename it so it can be called via the apps page *setup the apps page to call it * renamed the graph * now include fail2ban in the apps properly * correct the wget command so it does not stomp on phpfpm-sp * update the fail2ban poller for the newest fail2ban script and now build multiple RRDs * update for now graphing firewalled and banned * update fail2ban docs to match the newest snmpd extend method * search automatically for jails and graph them * graphs the currently banned for a fail2ban jail * change the tital of the graph for the total banned to make it more descriptive * Add a explanation of the two variables in the total graph. * misc. white space cleans ups * misc. white space cleanup * minor white space cleanup * correct descr lenght * correct descr lenght * Update fail2ban.inc.php * Use rrd_name properly * note the cache file bits * make caching optional and note why * Update to new RrdDefinition class * And the use statement ;/ * Messed the second rrd_def * correct two minor errors that did not seem to be causing issues * don't use $vars as per pull #5994 * don't use $vars as per pull #5994 * fix jails graphs * Remove loops and temp variables * whitespace * Change graph so we don't get fractions * add the common nfsen channel include * add nfsen channel flows graph * add nfsen channel packet graph * add nfsen channel traffic graph * update nfsen for channel support * the nfsen general page * add the nfsen channel page * update the docs on nfsen to be more clear about configuring it * white space cleanup * white space cleanup * misc code cleanup * now consistently uses all the same quotes * minor code cleanups * Update nfsen_channel_common.inc.php * minor white space cleanup
2017-03-02 09:03:45 -06:00
foreach (glob($nfsenRRDchannelGlob) as $nfsenRRD) {
2020-09-21 15:40:17 +02:00
$channel = str_replace([$hostDir, '.rrd'], '', $nfsenRRD);
feature: Updated Nfsen integration support (#6003) * add single pool based poller for php-fpm * add the page for php-fpm * add graph for php-fpm * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * use named OID as suggest by @laf * document PHP-FPM monitoring * link it in the index * clean up the named oid * add how to grab the script in question * add f2b poller * add f2b app page * add f2b graph * add fail2ban notes * minor formatting cleanup * ...more formatting cleanup * rename it so it can be called via the app page * Revert "rename it so it can be called via the app page" This reverts commit 0bde88a03840138fa28b75606e3cd269ce023f67. * *rename it so it can be called via the apps page *setup the apps page to call it * renamed the graph * now include fail2ban in the apps properly * correct the wget command so it does not stomp on phpfpm-sp * update the fail2ban poller for the newest fail2ban script and now build multiple RRDs * update for now graphing firewalled and banned * update fail2ban docs to match the newest snmpd extend method * search automatically for jails and graph them * graphs the currently banned for a fail2ban jail * change the tital of the graph for the total banned to make it more descriptive * Add a explanation of the two variables in the total graph. * misc. white space cleans ups * misc. white space cleanup * minor white space cleanup * correct descr lenght * correct descr lenght * Update fail2ban.inc.php * Use rrd_name properly * note the cache file bits * make caching optional and note why * Update to new RrdDefinition class * And the use statement ;/ * Messed the second rrd_def * correct two minor errors that did not seem to be causing issues * don't use $vars as per pull #5994 * don't use $vars as per pull #5994 * fix jails graphs * Remove loops and temp variables * whitespace * Change graph so we don't get fractions * add the common nfsen channel include * add nfsen channel flows graph * add nfsen channel packet graph * add nfsen channel traffic graph * update nfsen for channel support * the nfsen general page * add the nfsen channel page * update the docs on nfsen to be more clear about configuring it * white space cleanup * white space cleanup * misc code cleanup * now consistently uses all the same quotes * minor code cleanups * Update nfsen_channel_common.inc.php * minor white space cleanup
2017-03-02 09:03:45 -06:00
2020-09-21 15:40:17 +02:00
if (! $printedChannel) {
feature: Updated Nfsen integration support (#6003) * add single pool based poller for php-fpm * add the page for php-fpm * add graph for php-fpm * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * use named OID as suggest by @laf * document PHP-FPM monitoring * link it in the index * clean up the named oid * add how to grab the script in question * add f2b poller * add f2b app page * add f2b graph * add fail2ban notes * minor formatting cleanup * ...more formatting cleanup * rename it so it can be called via the app page * Revert "rename it so it can be called via the app page" This reverts commit 0bde88a03840138fa28b75606e3cd269ce023f67. * *rename it so it can be called via the apps page *setup the apps page to call it * renamed the graph * now include fail2ban in the apps properly * correct the wget command so it does not stomp on phpfpm-sp * update the fail2ban poller for the newest fail2ban script and now build multiple RRDs * update for now graphing firewalled and banned * update fail2ban docs to match the newest snmpd extend method * search automatically for jails and graph them * graphs the currently banned for a fail2ban jail * change the tital of the graph for the total banned to make it more descriptive * Add a explanation of the two variables in the total graph. * misc. white space cleans ups * misc. white space cleanup * minor white space cleanup * correct descr lenght * correct descr lenght * Update fail2ban.inc.php * Use rrd_name properly * note the cache file bits * make caching optional and note why * Update to new RrdDefinition class * And the use statement ;/ * Messed the second rrd_def * correct two minor errors that did not seem to be causing issues * don't use $vars as per pull #5994 * don't use $vars as per pull #5994 * fix jails graphs * Remove loops and temp variables * whitespace * Change graph so we don't get fractions * add the common nfsen channel include * add nfsen channel flows graph * add nfsen channel packet graph * add nfsen channel traffic graph * update nfsen for channel support * the nfsen general page * add the nfsen channel page * update the docs on nfsen to be more clear about configuring it * white space cleanup * white space cleanup * misc code cleanup * now consistently uses all the same quotes * minor code cleanups * Update nfsen_channel_common.inc.php * minor white space cleanup
2017-03-02 09:03:45 -06:00
echo '|Channels:';
$printedChannel = true;
feature: Updated Nfsen integration support (#6003) * add single pool based poller for php-fpm * add the page for php-fpm * add graph for php-fpm * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * use named OID as suggest by @laf * document PHP-FPM monitoring * link it in the index * clean up the named oid * add how to grab the script in question * add f2b poller * add f2b app page * add f2b graph * add fail2ban notes * minor formatting cleanup * ...more formatting cleanup * rename it so it can be called via the app page * Revert "rename it so it can be called via the app page" This reverts commit 0bde88a03840138fa28b75606e3cd269ce023f67. * *rename it so it can be called via the apps page *setup the apps page to call it * renamed the graph * now include fail2ban in the apps properly * correct the wget command so it does not stomp on phpfpm-sp * update the fail2ban poller for the newest fail2ban script and now build multiple RRDs * update for now graphing firewalled and banned * update fail2ban docs to match the newest snmpd extend method * search automatically for jails and graph them * graphs the currently banned for a fail2ban jail * change the tital of the graph for the total banned to make it more descriptive * Add a explanation of the two variables in the total graph. * misc. white space cleans ups * misc. white space cleanup * minor white space cleanup * correct descr lenght * correct descr lenght * Update fail2ban.inc.php * Use rrd_name properly * note the cache file bits * make caching optional and note why * Update to new RrdDefinition class * And the use statement ;/ * Messed the second rrd_def * correct two minor errors that did not seem to be causing issues * don't use $vars as per pull #5994 * don't use $vars as per pull #5994 * fix jails graphs * Remove loops and temp variables * whitespace * Change graph so we don't get fractions * add the common nfsen channel include * add nfsen channel flows graph * add nfsen channel packet graph * add nfsen channel traffic graph * update nfsen for channel support * the nfsen general page * add the nfsen channel page * update the docs on nfsen to be more clear about configuring it * white space cleanup * white space cleanup * misc code cleanup * now consistently uses all the same quotes * minor code cleanups * Update nfsen_channel_common.inc.php * minor white space cleanup
2017-03-02 09:03:45 -06:00
} else {
echo ',';
}
if ($vars['channel'] == $channel) {
2020-09-21 15:40:17 +02:00
$channelFilter = $hostDir . $channel . '-filter.txt';
feature: Updated Nfsen integration support (#6003) * add single pool based poller for php-fpm * add the page for php-fpm * add graph for php-fpm * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * use named OID as suggest by @laf * document PHP-FPM monitoring * link it in the index * clean up the named oid * add how to grab the script in question * add f2b poller * add f2b app page * add f2b graph * add fail2ban notes * minor formatting cleanup * ...more formatting cleanup * rename it so it can be called via the app page * Revert "rename it so it can be called via the app page" This reverts commit 0bde88a03840138fa28b75606e3cd269ce023f67. * *rename it so it can be called via the apps page *setup the apps page to call it * renamed the graph * now include fail2ban in the apps properly * correct the wget command so it does not stomp on phpfpm-sp * update the fail2ban poller for the newest fail2ban script and now build multiple RRDs * update for now graphing firewalled and banned * update fail2ban docs to match the newest snmpd extend method * search automatically for jails and graph them * graphs the currently banned for a fail2ban jail * change the tital of the graph for the total banned to make it more descriptive * Add a explanation of the two variables in the total graph. * misc. white space cleans ups * misc. white space cleanup * minor white space cleanup * correct descr lenght * correct descr lenght * Update fail2ban.inc.php * Use rrd_name properly * note the cache file bits * make caching optional and note why * Update to new RrdDefinition class * And the use statement ;/ * Messed the second rrd_def * correct two minor errors that did not seem to be causing issues * don't use $vars as per pull #5994 * don't use $vars as per pull #5994 * fix jails graphs * Remove loops and temp variables * whitespace * Change graph so we don't get fractions * add the common nfsen channel include * add nfsen channel flows graph * add nfsen channel packet graph * add nfsen channel traffic graph * update nfsen for channel support * the nfsen general page * add the nfsen channel page * update the docs on nfsen to be more clear about configuring it * white space cleanup * white space cleanup * misc code cleanup * now consistently uses all the same quotes * minor code cleanups * Update nfsen_channel_common.inc.php * minor white space cleanup
2017-03-02 09:03:45 -06:00
}
2020-09-21 15:40:17 +02:00
echo generate_link($channel, $link_array, ['nfsen' => 'channel', 'channel' => $channel]);
feature: Updated Nfsen integration support (#6003) * add single pool based poller for php-fpm * add the page for php-fpm * add graph for php-fpm * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * use named OID as suggest by @laf * document PHP-FPM monitoring * link it in the index * clean up the named oid * add how to grab the script in question * add f2b poller * add f2b app page * add f2b graph * add fail2ban notes * minor formatting cleanup * ...more formatting cleanup * rename it so it can be called via the app page * Revert "rename it so it can be called via the app page" This reverts commit 0bde88a03840138fa28b75606e3cd269ce023f67. * *rename it so it can be called via the apps page *setup the apps page to call it * renamed the graph * now include fail2ban in the apps properly * correct the wget command so it does not stomp on phpfpm-sp * update the fail2ban poller for the newest fail2ban script and now build multiple RRDs * update for now graphing firewalled and banned * update fail2ban docs to match the newest snmpd extend method * search automatically for jails and graph them * graphs the currently banned for a fail2ban jail * change the tital of the graph for the total banned to make it more descriptive * Add a explanation of the two variables in the total graph. * misc. white space cleans ups * misc. white space cleanup * minor white space cleanup * correct descr lenght * correct descr lenght * Update fail2ban.inc.php * Use rrd_name properly * note the cache file bits * make caching optional and note why * Update to new RrdDefinition class * And the use statement ;/ * Messed the second rrd_def * correct two minor errors that did not seem to be causing issues * don't use $vars as per pull #5994 * don't use $vars as per pull #5994 * fix jails graphs * Remove loops and temp variables * whitespace * Change graph so we don't get fractions * add the common nfsen channel include * add nfsen channel flows graph * add nfsen channel packet graph * add nfsen channel traffic graph * update nfsen for channel support * the nfsen general page * add the nfsen channel page * update the docs on nfsen to be more clear about configuring it * white space cleanup * white space cleanup * misc code cleanup * now consistently uses all the same quotes * minor code cleanups * Update nfsen_channel_common.inc.php * minor white space cleanup
2017-03-02 09:03:45 -06:00
}
}
}
print_optionbar_end();
2020-09-21 15:40:17 +02:00
if (! $vars['nfsen']) {
$vars['nfsen'] = 'general';
}
if (is_file('includes/html/pages/device/nfsen/' . $vars['nfsen'] . '.inc.php')) {
include 'includes/html/pages/device/nfsen/' . $vars['nfsen'] . '.inc.php';
feature: Updated Nfsen integration support (#6003) * add single pool based poller for php-fpm * add the page for php-fpm * add graph for php-fpm * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * use named OID as suggest by @laf * document PHP-FPM monitoring * link it in the index * clean up the named oid * add how to grab the script in question * add f2b poller * add f2b app page * add f2b graph * add fail2ban notes * minor formatting cleanup * ...more formatting cleanup * rename it so it can be called via the app page * Revert "rename it so it can be called via the app page" This reverts commit 0bde88a03840138fa28b75606e3cd269ce023f67. * *rename it so it can be called via the apps page *setup the apps page to call it * renamed the graph * now include fail2ban in the apps properly * correct the wget command so it does not stomp on phpfpm-sp * update the fail2ban poller for the newest fail2ban script and now build multiple RRDs * update for now graphing firewalled and banned * update fail2ban docs to match the newest snmpd extend method * search automatically for jails and graph them * graphs the currently banned for a fail2ban jail * change the tital of the graph for the total banned to make it more descriptive * Add a explanation of the two variables in the total graph. * misc. white space cleans ups * misc. white space cleanup * minor white space cleanup * correct descr lenght * correct descr lenght * Update fail2ban.inc.php * Use rrd_name properly * note the cache file bits * make caching optional and note why * Update to new RrdDefinition class * And the use statement ;/ * Messed the second rrd_def * correct two minor errors that did not seem to be causing issues * don't use $vars as per pull #5994 * don't use $vars as per pull #5994 * fix jails graphs * Remove loops and temp variables * whitespace * Change graph so we don't get fractions * add the common nfsen channel include * add nfsen channel flows graph * add nfsen channel packet graph * add nfsen channel traffic graph * update nfsen for channel support * the nfsen general page * add the nfsen channel page * update the docs on nfsen to be more clear about configuring it * white space cleanup * white space cleanup * misc code cleanup * now consistently uses all the same quotes * minor code cleanups * Update nfsen_channel_common.inc.php * minor white space cleanup
2017-03-02 09:03:45 -06:00
} else {
include 'includes/html/pages/device/nfsen/general.inc.php';
}
$pagetitle[] = 'Netflow';