Project

General

Profile

Feature #8574

Enable AgentX-support in lldpd using GUI

Added by Nicklas Björk almost 2 years ago. Updated 3 months ago.

Status:
Feedback
Priority:
Normal
Category:
lldpd
Target version:
-
Start date:
06/14/2018
Due date:
% Done:

100%

Estimated time:

Description

The lldpd-package provided by the package manager seems to be compiled with AgentX-support, but there is nowhere to activate it using the GUI. An AgentX sub-agent can connect to Net-SNMP and would in this case make LLDP-information available over SNMP.

In the Net-SNMP configuration, AgentX has to be enabled. I suppose this could also be added as a GUI option in the Net-SNMP package, but can for now be added to the Custom Options.

master agentx

I made the following changes, which will add the flag -x to the lldpd command line:

--- /usr/local/www/lldpd_settings.php.orig      2018-06-14 11:06:34.932043000 +0200
+++ /usr/local/www/lldpd_settings.php   2018-06-14 11:22:26.464359000 +0200
@@ -63,6 +63,7 @@
                $lldpd = array();
                $lldpd['enable'] = $pconfig['enable'];
                $lldpd['receiveonly'] = $pconfig['receiveonly'];
+               $lldpd['agentx'] = $pconfig['agentx'];
                $lldpd['interfaces'] = $pconfig['interfaces'];
                $lldpd['chassis'] = $pconfig['chassis'];
                $lldpd['management'] = $pconfig['management'];
@@ -150,6 +151,13 @@
        $pconfig['receiveonly']
 ));

+$section->addInput(new Form_Checkbox(
+       'agentx',
+       'Enable AgentX',
+       'With this option, lldpd will enable an SNMP subagent using AgentX protocol',
+       $pconfig['agentx']
+));
+
 $section->addInput(new Form_Select(
        'interfaces_a',
        'Interfaces',

--- /usr/local/pkg/lldpd/lldpd.inc.orig 2018-06-14 11:10:58.582840000 +0200
+++ /usr/local/pkg/lldpd/lldpd.inc      2018-06-14 11:11:41.649295000 +0200
@@ -155,6 +155,10 @@
                }
        }

+       if ($lldpd_config['agentx'] == 'yes') {
+               $cmd .= ' -x';
+       }
+
        /* Write the rc script */
        $start = "      $cmd";
        $stop = "       /usr/bin/killall -q lldpd";

LLDP information can then be queried using the LLDP-MIB tree at .1.0.8802.1.1.2.

History

#1 Updated by Jon Gerdes over 1 year ago

The above patch works for me. The Net-SNMP package already adds "master agentx" to /var/etc/netsnmpd.conf by default.

(Edit) - Applied the above patches by hand to three pfSense boxes (all 2.4.something) now. Netdisco (http://netdisco.org/) is happy with the results and shows links. To be honest, the net-snmp package is far better than the built in SNMP GUI and might be worth considering becoming the default or ditch the built in package.

#2 Updated by Jim Pingle 10 months ago

  • Category set to lldpd

Can you submit those patches as a PR?

#4 Updated by Jim Pingle 3 months ago

  • Status changed from New to Pull Request Review

#5 Updated by Renato Botelho 3 months ago

  • Status changed from Pull Request Review to Feedback
  • Assignee set to Renato Botelho
  • % Done changed from 0 to 100

PR has been merged. Thanks!

Also available in: Atom PDF