Map syncing - was: tkined <-> BONES, etc questions.

George Eddy (eddy@ISI.EDU)
Mon, 20 May 96 14:41:22 PDT

According to: Peter Polkinghorne
> Hi,
> I will attempt to answer some of your questions.
> >
> > Hi, I recently installed
> > tk4.0
> > tcl7.4
> > scotty-2.0.2
> > tkined-1.3.4
> > msql-1.0.13
> > and I'd like to ask some basic questions about them:
> >
> I have a similar set up - but have not used msql or Bones.
>
> > 2. "IP discover" FAILS to merge nodes ( sometimes ).
> > "IP discover" fails to merge nodes with multiple interface.
> > I would like to know the following:
> > a. What is the problem? -> The way DNS is set?
> > b. How can I merge them?
> >
>
> IP discover only merges nodes within a discovery session - as far as I can
> tell. Thus if you discover two networks separately, they may not get merged.
> It seems to work best on discvovering everything at once. Also how
> to tell

Perhaps this is due to the fact that everytime a scotty shell is
executed (as is the case with ip_discovery.tcl) it maintains a local
copy of the global variables, such as:

global ids nodes address name

that are used to maintain the discovered map info. If you save the
map, then run tkined later, for example, the vars have been lost and a
new (empty) copies created, this means the existing nodes (the ones
previously saved) are not known to the ip_discovery.tcl globals
above.

what could be done when ip_discovery.tcl is first loaded, it could
call a routine that reads everything in the existing map and recreate
the necessarry global vars, that will be used by subsequent
invocations of ip_discovery. Following is an _EXAMPLE_ of how this
could be done (i do a similar thing with the scripts i wrote).

WARNING, this code is not gaurenteed to work as is but should convey
the idea i hope :).

proc SyncMap {} {
global ids networks address name

catch {
unset ids
unset networks
unset address
unset name
}

foreach comp [ined retrieve] {
set type [ined type $comp]
if {[lsearch "NODE GROUP STRIPCHART BARCHART LINK NETWORK" $type] >= 0} {
set id [ined id $comp]
set name [ined name $comp]
set ip [lindex [ined address $comp] 0]
}
switch $type {
NODE {
if {[catch {dns ptr $ip} ns_name]} {
if {[catch {nslook $ip} ns_name]} {
set ns_name $ip
}
}
set ids($ip) $id
set nodes($id)
set address($id) $ip
set name($id) $ns_name
}
}
}
}

>
> Also what is a canvas?
>

A tk object. It's the main area of tkined that all the nodes, links
etc. get drawn on (the scrollable area).

-- 

- rusty

eddy@isi.edu