Re: Logging

Juergen Schoenwaelder (schoenw@cs.utwente.nl)
Mon, 5 Aug 1996 23:43:00 +0200

Andrew Cameron <andrew@ibi.co.za> wrote:

> I would like to know how to log the utilization fiqures for each port
> to a file so that I can draw a graph of utilization against time.
>
> I currently display the info on screen but it is necessary for me to log
> the information so that I can analyze the trends over a long period
> of time.

Use the ifload script contained in the examples directory. Note, this
example is broken in scotty-2.1.[0-1] because of a bug in the file
tnm/library/ifload.tcl. Below is a patch to fix this problem.

Juergen

*** tnm/library/ifload.tcl.orig Tue Jul 16 19:31:49 1996
--- tnm/library/ifload.tcl Mon Aug 5 23:36:53 1996
***************
*** 123,136 ****
set cx(ifOperStatus) [lindex [lindex $vbl 6] 2]
set cx(fullduplex) [expr [lsearch $fullDuplex $cx(ifType)] < 0]

if {$iterations != ""} {
! set job [job create GetIfLoad [expr $interval * 1000] $iterations]
! } else {
! set job [job create GetIfLoad [expr $interval * 1000]]
}

! $job attribute status [array get cx]
! lappend result $job
}

return $result
--- 123,135 ----
set cx(ifOperStatus) [lindex [lindex $vbl 6] 2]
set cx(fullduplex) [expr [lsearch $fullDuplex $cx(ifType)] < 0]

+ set j [job create -command GetIfLoad -interval [expr $interval * 1000]]
if {$iterations != ""} {
! $j configure -iterations $iterations
}

! $j attribute status [array get cx]
! lappend result $j
}

return $result