proc StartCapture {} { puts "Starting capture ..." ixNet execute startCapture } d on the $viewName stat that you want to retrieve. # Stats will be returned in a keyed list. # # viewName options (Not case sensitive): # NOTE: Not all statistics are listed here. # You could get the statistic viewName directly from the IxNetwork GUI in the statistics. # # 'Port Statistics' # 'Tx-Rx Frame Rate Statistics' # 'Port CPU Statistics' # 'Global Protocol Statistics' # 'Protocols Summary' # 'Port Summary' # 'OSPFv2-RTR Drill Down' # 'OSPFv2-RTR Per Port' # 'IPv4 Drill Down' # 'L2-L3 Test Summary Statistics' # 'Flow Statistics' # 'Traffic Item Statistics' # 'IGMP Host Drill Down' # 'IGMP Host Per Port' # 'IPv6 Drill Down' # 'MLD Host Drill Down' # 'MLD Host Per Port' # 'PIMv6 IF Drill Down' # 'PIMv6 IF Per Port' set root [ixNet getRoot] set viewList [ixNet getList $root/statistics view] set statViewIndex [lsearch -nocase -regexp $viewList $viewName] set view [lindex $viewList $statViewIndex] puts "\nview: $view" # Flow Statistics set caption [ixNet getAttribute $view -caption] ixNet setAttribute $view -enabled true ixNet commit set columnList [ixNet getAttribute ${view}/page -columnCaptions] #puts "\n$columnList\n" set startTime 1 set stopTime 30 while {$startTime < $stopTime} { set totalPages [ixNet getAttribute $view/page -totalPages] if {[regexp -nocase "null" $totalPages]} { puts "\nGetStatView: Getting total pages for $view is not ready. $startTime/$stopTime" after 2000 } else { break } } #puts "\ntotal Pages: $totalPages" # Iterrate through each page set row 0 for {set currentPage 1} {$currentPage <= $totalPages} {incr currentPage} { puts "\nGetStatView: Getting statistics on page: $currentPage/$totalPages. Please wait ..." catch {ixNet setAttribute $view/page -currentPage $currentPage} errMsg if {$errMsg != "::ixNet::OK"} { puts "\nGetStatView: Failed to get statistic for current page.\n" return 1 } ixNet commit # Wait for statistics to populate on current page set whileLoopStopCounter 0 while {[ixNet getAttribute $view/page -isReady] != "true"} { if {$whileLoopStopCounter == "5"} { puts "\nGetStatView: Could not get stats" return 1 } if {$whileLoopStopCounter < 5} { puts "\nGetStatView: Not ready yet. Waiting $whileLoopStopCounter/5 seconds ..." after 1000 } incr whileLoopStopCounter } set pageList [ixNet getAttribute $view/page -rowValues] ;# first list of all rows in the page set totalFlowStatistics [llength $pageList] # totalPageList == The total amount of flow statistics for {set pageListIndex 0} {$pageListIndex <= $totalFlowStatistics} {incr pageListIndex} { set rowList [lindex $pageList $pageListIndex] ;# second list of 1 ingress and x egress rows for {set rowIndex 0} {$rowIndex < [llength $rowList]} {incr rowIndex} { # Increment the row number incr row # cellList: 1/1/1 1/1/2 TI0-Flow_1 1.1.1.1-1.1.2.1 4000 4000 0 0 0 0 256000 0 0 0 0 0 0 0 0 0 0 0 00:00:00.684 00:00:00.700 set cellList [lindex $rowList $rowIndex] ;# third list of cell values puts "\n $row:" for {set index 0} {$index <[llength $cellList]} {incr index} { keylset getStats flow.$row.[join [lindex $columnList $index] _] [lindex $cellList $index] puts "\t[join [lindex $columnList $index] _]: [lindex $cellList $index]" } } } } ixNet setAttribute $view -enabled false ixNet commit return $getStats }