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