require "json"

Ohai.plugin(:Lldp) do
  provides "lldp"

  collect_data(:default) do
    lldp Mash.new

    json = JSON.parse(%x(/sbin/lldpctl -f json))

    json["lldp"].each do |key, value|
      lldp[key] = value
    end

    lldp
  end
end

require "json"

Ohai.plugin(:Lldp) do
  provides "lldp"

  collect_data(:default) do
    lldp Mash.new

    json = JSON.parse(%x(/sbin/lldpctl -f json))

    json["lldp"]["interface"].each do |interface|
      interface.each do |name, details|
        lldp[name] = details
      end
    end

    lldp
  end
end

Improve layout of LLDP data
Improve layout of LLDP data
