1[% USE CSV -%]
2[% CSV.dump([ 'Device' 'Model' 'Device Location' 'PoE Module' 'Power (W)'
3              'Supply' 'Capable Ports' 'Powered Ports' 'Disabled Ports'
4              'Errored Ports' 'Committed (W)' 'Delivering (W)' ]) %]
5
6[% FOREACH row IN results %]
7  [% mydlist = [] %]
8  [% mydevice = row.dns || row.name || row.ip %]
9  [% mydlist.push(mydevice) %]
10  [% FOREACH col IN [ row.model row.location row.module row.power row.status
11                      row.poe_capable_ports row.poe_powered_ports
12                      row.poe_disabled_ports row.poe_errored_ports
13                      row.poe_power_committed row.poe_power_delivering
14                      ] %]
15    [% mydlist.push(col) %]
16  [% END %]
17  [% CSV.dump(mydlist) %]
18
19[%END%]
20