From 2fd596e436a8713436282cf2e2f8cadd061403db Mon Sep 17 00:00:00 2001 From: Suraj Patil Date: Sun, 9 Aug 2026 22:06:30 +0530 Subject: [PATCH] [lldpd] Add plugin for the LLDP daemon lldpd is packaged for Fedora, RHEL via EPEL, Debian and Ubuntu, but sos has no plugin for it. networking.py collects /var/lib/lldpad/, which belongs to lldpad, a separate implementation; nothing in the tree covers lldpd itself. Paths are taken from upstream. src/daemon/lldpd.c passes SYSCONFDIR "/lldpd.conf" and SYSCONFDIR "/lldpd.d" on resume, and src/daemon/lldpd.service.in sources both /etc/default/lldpd and /etc/sysconfig/lldpd as optional environment files, so both are collected rather than assuming which one a distribution ships. The lldpcli subcommands are those registered in src/client/show.c. "show neighbors details" is the useful one for support: it records which switch and port each interface is attached to, which cannot otherwise be recovered from an sosreport. The daemon holds no credentials, so no forbidden paths are needed. Signed-off-by: Suraj Patil --- sos/report/plugins/lldpd.py | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 sos/report/plugins/lldpd.py diff --git a/sos/report/plugins/lldpd.py b/sos/report/plugins/lldpd.py new file mode 100644 index 0000000000..6236e051d5 --- /dev/null +++ b/sos/report/plugins/lldpd.py @@ -0,0 +1,44 @@ +# Copyright (C) 2026 Suraj Patil + +# This file is part of the sos project: https://github.com/sosreport/sos +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions of +# version 2 of the GNU General Public License. +# +# See the LICENSE file in the source distribution for further information. + +from sos.report.plugins import Plugin, IndependentPlugin + + +class Lldpd(Plugin, IndependentPlugin): + + short_desc = 'LLDP daemon' + + plugin_name = 'lldpd' + profiles = ('network', 'hardware') + + packages = ('lldpd',) + services = ('lldpd',) + + def setup(self): + # The unit sources its arguments from whichever of the two + # conventional environment files the distribution ships. + self.add_copy_spec([ + '/etc/lldpd.conf', + '/etc/lldpd.d/', + '/etc/default/lldpd', + '/etc/sysconfig/lldpd', + ]) + + self.add_cmd_output([ + 'lldpcli show chassis', + 'lldpcli show configuration', + 'lldpcli show interfaces details', + 'lldpcli show neighbors details', + 'lldpcli show statistics', + ], tags='lldpcli_show') + + self.add_journal(units='lldpd') + +# vim: set et ts=4 sw=4 :