add csv output to access point radios channel and power report

This commit is contained in:
Eric A. Miller
2013-09-22 11:56:53 -04:00
parent 8bec4ed8b0
commit 5165451c52
2 changed files with 31 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
[% USE CSV -%]
[% CSV.dump([ 'Device' 'Model' 'Device Location' 'Port' ' Port Name'
'Port Description' 'Channel' 'Tx Power mW' 'Tx Power dBm' ]) %]
[% FOREACH row IN results.keys.sort %]
[% mydlist = [] %]
[% mydevice = results.$row.device.dns || results.$row.device.name %]
[% mydlist.push(mydevice) %]
[% mydlist.push(results.$row.device.model) %]
[% mydlist.push(results.$row.device.location) %]
[% FOREACH p IN results.$row.ports %]
[% myplist = [] %]
[% NEXT UNLESS p.channel # No channel port is admin down %]
[% FOREACH col IN [ p.port p.name p.descr p.channel p.power
p.power2 ] %]
[% myplist.push(col) %]
[% END %]
[% CALL mydlist.splice(3, 6, myplist ) %]
[% CSV.dump(mydlist) %]
[% END %]
[%END%]