add csv download to duplex mismatch, half duplex, and port utilization reports

This commit is contained in:
Eric A. Miller
2013-09-19 22:30:27 -04:00
parent 5d4df72a24
commit d3553d2623
9 changed files with 113 additions and 16 deletions

View File

@@ -0,0 +1,13 @@
[% USE CSV -%]
[% CSV.dump([ 'Left Device' 'Port' 'Duplex' 'Right Device' 'Port' 'Duplex' ]) %]
[% WHILE (row = results.next) %]
[% mylist = [] %]
[% device_left = row.left_dns || row.left_ip %]
[% device_right = row.right_dns || row.right_ip %]
[% FOREACH col IN [ device_left row.left_port row.left_duplex.ucfirst device_right row.right_port row.right_duplex.ucfirst ] %]
[% mylist.push(col) %]
[% END %]
[% CSV.dump(mylist) %]
[% END %]