mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Feature: selected_ports per OS. Fixed layout of example MySQL table. (#7674)
* selected_ports per OS. Fixed layout of example MySQL table. * Better table markdown.
This commit is contained in:
@@ -82,13 +82,12 @@ LibreNMS server. Something like pdns-recursor can be used and then configure `/e
|
|||||||
By default the polling ports module will walk ifXEntry + some items from ifEntry regardless of the port. So if a port is marked as deleted because you don't want to see them
|
By default the polling ports module will walk ifXEntry + some items from ifEntry regardless of the port. So if a port is marked as deleted because you don't want to see them
|
||||||
or it's disabled then we still collect data. For the most part this is fine as the walks are quite quick. However for devices with a lot of ports and good % of those are
|
or it's disabled then we still collect data. For the most part this is fine as the walks are quite quick. However for devices with a lot of ports and good % of those are
|
||||||
either deleted or disabled then this approach isn't optimal. So to counter this you can enable 'selected port polling' per device within the edit device -> misc section or by
|
either deleted or disabled then this approach isn't optimal. So to counter this you can enable 'selected port polling' per device within the edit device -> misc section or by
|
||||||
globally enabling it (not recommended): `$config['polling']['selected_ports'] = true;`.
|
globally enabling it (not recommended): `$config['polling']['selected_ports'] = true;`. You can also set it for a specific OS: `$config['os']['ios']['polling']['selected_ports'] = true;`.
|
||||||
|
|
||||||
If you would like to see if you should turn this on then run this query in MySQL: `select device_id, count(*) as total from ports where deleted=1 group by device_id order by total desc;`. You will see output like the following:
|
If you would like to see if you should turn this on then run this query in MySQL: `select device_id, count(*) as total from ports where deleted=1 group by device_id order by total desc;`. You will see output like the following:
|
||||||
|
|
||||||
+-----------+-------+
|
|
||||||
| device_id | total |
|
| device_id | total |
|
||||||
+-----------+-------+
|
| --------: | ----: |
|
||||||
| 128 | 339 |
|
| 128 | 339 |
|
||||||
| 92 | 56 |
|
| 92 | 56 |
|
||||||
| 41 | 41 |
|
| 41 | 41 |
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ $data = array();
|
|||||||
if ($device['os'] === 'f5' && (version_compare($device['version'], '11.2.0', '>=') && version_compare($device['version'], '11.7', '<'))) {
|
if ($device['os'] === 'f5' && (version_compare($device['version'], '11.2.0', '>=') && version_compare($device['version'], '11.7', '<'))) {
|
||||||
require_once 'ports/f5.inc.php';
|
require_once 'ports/f5.inc.php';
|
||||||
} else {
|
} else {
|
||||||
if ($config['polling']['selected_ports'] === true || $device['attribs']['selected_ports'] == 'true') {
|
if ($config['polling']['selected_ports'] === true || $config['os'][$device['os']]['polling']['selected_ports'] === true || $device['attribs']['selected_ports'] == 'true') {
|
||||||
echo('Select ports polling');
|
echo('Select ports polling');
|
||||||
$lports = dbFetchRows("SELECT * FROM `ports` where `device_id` = ? AND `deleted` = 0 AND `disabled` = 0", array($device['device_id']));
|
$lports = dbFetchRows("SELECT * FROM `ports` where `device_id` = ? AND `deleted` = 0 AND `disabled` = 0", array($device['device_id']));
|
||||||
foreach ($lports as $lport) {
|
foreach ($lports as $lport) {
|
||||||
|
|||||||
Reference in New Issue
Block a user