lib/reporter/default/properties_network.rb in onering-report-plugins-0.0.33 vs lib/reporter/default/properties_network.rb in onering-report-plugins-0.0.34
- old
+ new
@@ -1,7 +1,8 @@
report do
interfaces = {}
+ ips = []
Facter.value('network_interfaces').each do |iface|
iface = iface.to_sym
next if [:dummy0, :lo, :sit0].include?(iface)
interfaces[iface] ||= {}
@@ -11,10 +12,12 @@
interfaces[iface][:name] = iface
interfaces[iface][:mac] = mac if mac
interfaces[iface][:mtu] = mtu if mtu
+ ips << Facter.value("ipaddress_#{iface}")
+
addresses = [{
:ip => Facter.value("ipaddress_#{iface}"),
:netmask => Facter.value("netmask_#{iface}")
}.reject{|k,v| v === nil }]
@@ -48,8 +51,9 @@
interfaces[iface][:switch] = switch unless switch.empty?
interfaces[iface][:bonding] = bond unless bond.empty?
end
property :network, {
+ :@ip => ips,
:@interfaces => interfaces.values
}
end