View | Details | Raw Unified | Return to bug 10806
Collapse All | Expand All

(-)scotty/Makefile (-4 / +4 lines)
Lines 6-16 Link Here
6
# $Id: Makefile,v 1.36 1999/02/03 23:31:07 steve Exp $
6
# $Id: Makefile,v 1.36 1999/02/03 23:31:07 steve Exp $
7
#
7
#
8
8
9
DISTNAME=	scotty-2.1.9
9
DISTNAME=	scotty-2.1.10
10
CATEGORIES=	net tk80
10
CATEGORIES=	net tk80
11
MASTER_SITES=	ftp://ftp.ibr.cs.tu-bs.de/pub/local/tkined/
11
MASTER_SITES=	ftp://ftp.ibr.cs.tu-bs.de/pub/local/tkined/
12
12
13
MAINTAINER=	phk@freebsd.org
13
MAINTAINER=	dima@Chg.RU
14
14
15
LIB_DEPENDS=	tk80.1:${PORTSDIR}/x11-toolkits/tk80
15
LIB_DEPENDS=	tk80.1:${PORTSDIR}/x11-toolkits/tk80
16
16
Lines 23-32 Link Here
23
MAN1=		tkined.1 scotty.1
23
MAN1=		tkined.1 scotty.1
24
MAN8=		ntping.8 straps.8
24
MAN8=		ntping.8 straps.8
25
MANN=		Tnm.n cmip.n dns.n gdmo.n http.n icmp.n ined.n job.n \
25
MANN=		Tnm.n cmip.n dns.n gdmo.n http.n icmp.n ined.n job.n \
26
		mib.n msqltcl.n netdb.n ntp.n rpc.n snmp.n sunrpc.n \
26
		mib.n netdb.n ntp.n rpc.n snmp.n sunrpc.n \
27
		syslog.n udp.n
27
		syslog.n udp.n
28
PLIST_SUB=	FREEBSD_VERSION=${FREEBSD_VERSION} \
28
PLIST_SUB=	FREEBSD_VERSION=${FREEBSD_VERSION} \
29
		SCOTTY_VERSION=2.1.9 TKINED_VERSION=1.4.9
29
		SCOTTY_VERSION=2.1.10 TKINED_VERSION=1.4.10
30
FREEBSD_VERSION!=	echo `uname -m`-`uname`-`uname -r`
30
FREEBSD_VERSION!=	echo `uname -m`-`uname`-`uname -r`
31
31
32
pre-install:
32
pre-install:
(-)scotty/files/md5 (-1 / +1 lines)
Line 1 Link Here
1
MD5 (scotty-2.1.6.tar.gz) = 1c6f28dc959250508bb3323aba401560
1
MD5 (scotty-2.1.10.tar.gz) = e885c33ac4ba9cf17ca09886ca4046b1
(-)scotty/patches/patch-aa (-4 / +4 lines)
Lines 2-12 Link Here
2
+++ tkined.sh.in	Fri Sep 13 09:26:21 1996
2
+++ tkined.sh.in	Fri Sep 13 09:26:21 1996
3
@@ -0,0 +1,3 @@
3
@@ -0,0 +1,3 @@
4
+#!/bin/sh
4
+#!/bin/sh
5
+export TCLLIBPATH="@PREFIX@/lib/tkined1.4.9 @PREFIX@/lib/tnm2.1.9"
5
+export TCLLIBPATH="@PREFIX@/lib/tkined1.4.10 @PREFIX@/lib/tnm2.1.10"
6
+exec @PREFIX@/bin/tkined1.4.9 $*
6
+exec @PREFIX@/bin/tkined1.4.10 $*
7
--- scotty.sh.in~	Fri Sep 13 09:30:41 1996
7
--- scotty.sh.in~	Fri Sep 13 09:30:41 1996
8
+++ scotty.sh.in	Fri Sep 13 09:26:21 1996
8
+++ scotty.sh.in	Fri Sep 13 09:26:21 1996
9
@@ -0,0 +1,3 @@
9
@@ -0,0 +1,3 @@
10
+#!/bin/sh
10
+#!/bin/sh
11
+export TCLLIBPATH="@PREFIX@/lib/tnm2.1.9"
11
+export TCLLIBPATH="@PREFIX@/lib/tnm2.1.10"
12
+exec @PREFIX@/bin/scotty2.1.9
12
+exec @PREFIX@/bin/scotty2.1.10
(-)scotty/patches/patch-ac (-7 / +5 lines)
Lines 1-6 Link Here
1
--- Makefile.in.orig	Thu Jun  4 12:15:55 1998
1
--- Makefile.in.orig	Fri Mar 26 20:12:11 1999
2
+++ Makefile.in	Thu Jun  4 12:22:39 1998
2
+++ Makefile.in	Fri Mar 26 20:20:58 1999
3
@@ -490,7 +490,7 @@
3
@@ -509,7 +509,7 @@
4
 	@$(INSTALL_PROGRAM) scotty $(BIN_INSTALL_DIR)/scotty$(TNM_VERSION)
4
 	@$(INSTALL_PROGRAM) scotty $(BIN_INSTALL_DIR)/scotty$(TNM_VERSION)
5
 	@$(INSTALL_DATA) tnm$(SHLIB_SUFFIX) $(LIB_RUNTIME_DIR)/tnm$(TNM_VERSION)$(SHLIB_SUFFIX)
5
 	@$(INSTALL_DATA) tnm$(SHLIB_SUFFIX) $(LIB_RUNTIME_DIR)/tnm$(TNM_VERSION)$(SHLIB_SUFFIX)
6
 	@chmod 555 $(LIB_RUNTIME_DIR)/tnm$(TNM_VERSION)$(SHLIB_SUFFIX)
6
 	@chmod 555 $(LIB_RUNTIME_DIR)/tnm$(TNM_VERSION)$(SHLIB_SUFFIX)
Lines 9-21 Link Here
9
 
9
 
10
 tnm-install-mibs:
10
 tnm-install-mibs:
11
 	@for i in $(TNM_INSTALL_DIR)/mibs ; \
11
 	@for i in $(TNM_INSTALL_DIR)/mibs ; \
12
@@ -589,11 +590,15 @@
12
@@ -608,10 +608,14 @@
13
 		else true; \
14
 		fi; \
13
 		fi; \
15
 	    done;
14
 	    done;
16
-	@echo "Installing tkined$(TNM_VERSION) and tkined$(TNM_VERSION)$(SHLIB_SUFFIX)"
15
 	@echo "Installing tkined$(TKI_VERSION) and tkined$(TKI_VERSION)$(SHLIB_SUFFIX)"
17
-	@$(INSTALL_PROGRAM) tkined $(BIN_INSTALL_DIR)/tkined$(TKI_VERSION)
16
-	@$(INSTALL_PROGRAM) tkined $(BIN_INSTALL_DIR)/tkined$(TKI_VERSION)
18
+	@echo "Installing tkined$(TKI_VERSION) and tkined$(TKI_VERSION)$(SHLIB_SUFFIX)"
19
+	@$(INSTALL_DATA) -m 555 tkined $(BIN_INSTALL_DIR)/tkined$(TKI_VERSION)
17
+	@$(INSTALL_DATA) -m 555 tkined $(BIN_INSTALL_DIR)/tkined$(TKI_VERSION)
20
+	@sed s,@PREFIX@,${prefix},g tkined.sh.in >tkined.sh
18
+	@sed s,@PREFIX@,${prefix},g tkined.sh.in >tkined.sh
21
+	@sed s,@PREFIX@,${prefix},g scotty.sh.in >scotty.sh
19
+	@sed s,@PREFIX@,${prefix},g scotty.sh.in >scotty.sh
(-)scotty/patches/patch-ad (-640 lines)
Lines 1-640 Link Here
1
--- ../tkined/apps/ip_discover.tcl	Thu Sep 12 22:01:03 1996
2
+++ ../tkined/apps/ip_discover.tcl	Thu Mar  6 17:11:38 1997
3
@@ -21,6 +21,17 @@
4
 IpInit IP-Discover
5
 
6
 ##
7
+## Mapping sysObjectID to icons
8
+##
9
+
10
+set sysid2icon(1.3.6.1.4.1.311.1.1.3.1) pc.xbm
11
+set sysid2icon(1.3.6.1.4.1.9.1) cisco.xbm
12
+set sysid2icon(1.3.6.1.4.1.11.2.3.9.1) laser.xbm
13
+set sysid2icon(1.3.6.1.4.1.75.5.80.1.1) concent.xbm
14
+set sysid2icon(1.3.6.1.4.10.250.8) unixpc.xbm
15
+set sysid2icon(1.3.6.1.4.1.42.2) SUN-Server.xbm
16
+
17
+##
18
 ## These are the global parameters that control the discovering
19
 ## process. They are manipulated by the "Discover Parameter" proc.
20
 ##
21
@@ -30,7 +41,15 @@
22
 set columns 16
23
 set report true
24
 set debug false
25
-
26
+set communities {public private}
27
+set suppresdomain {.foo.bar.com}
28
+set parallel 10
29
+
30
+for {set i 1} {$i < 32} {incr i} {
31
+        set a [expr 0xffffffff << $i]
32
+        set b [expr ($a >> 24) & 0xff].[expr ($a >> 16) & 0xff].[expr ($a >> 8) & 0xff].[expr ($a) & 0xff]
33
+        set subnetbits($b) /[expr 32-$i]
34
+}
35
 
36
 ##
37
 ## During our icmp fire, we build up the following tables.
38
@@ -48,13 +67,30 @@
39
 ##
40
 
41
 ##
42
+## We want to do things in parallel, so this procedure comes handy
43
+##
44
+
45
+proc forsome {var count list code} {
46
+    upvar 1 $var sublist
47
+    set rel [expr $count - 1]
48
+    while {[llength $list]} {
49
+	set sublist [lrange $list 0 $rel]
50
+	uplevel 1 "$code"
51
+	set list [lrange $list $count end]
52
+    }
53
+}
54
+
55
+##
56
 ## Reset the global tables. This is now called before we start anything
57
 ## else to recover from abnormal terminated runs.
58
 ##
59
 
60
 proc reset {} {
61
-    catch {
62
-	unset nodes networks links ids trace mask fip name address gateways
63
+    foreach i {
64
+	nodes networks links ids trace mask fip name address gateways snmp
65
+	icon } {
66
+	global $i
67
+	catch "unset $i"
68
     }
69
 }
70
 
71
@@ -146,20 +182,23 @@
72
 ##
73
 
74
 proc netping { network } {
75
+    global parallel
76
     set result ""
77
+    set res ""
78
     if {[regexp "^\[0-9\]+\.\[0-9\]+\.\[0-9\]+$" $network] > 0} {
79
 	set hosts ""
80
 	for {set a4 1} {$a4<255} {incr a4} {
81
-	    append hosts " $network.$a4"
82
+	    lappend hosts "$network.$a4"
83
 	}
84
-	set result [icmp echo $hosts]
85
-    }
86
-    set res ""
87
-    foreach pr $result {
88
-	set pr_ip [lindex $pr 0]
89
-	set pr_time [lindex $pr 1]
90
-	if {$pr_time>=0} {
91
-	    lappend res $pr_ip
92
+	forsome lst $parallel $hosts {
93
+	    debug "** ping $lst"
94
+	    foreach pr [icmp echo $lst] {
95
+		set pr_ip [lindex $pr 0]
96
+		set pr_time [lindex $pr 1]
97
+		if {$pr_time>=0} {
98
+		    lappend res $pr_ip
99
+		}
100
+	    }
101
 	}
102
     }
103
     return $res
104
@@ -246,13 +285,13 @@
105
 }
106
 
107
 ##
108
-## Get a trace of the routes to very node. Store them in the global
109
+## Get a trace of the routes to every node. Store them in the global
110
 ## array trace. If we find nodes that were not discovered using the
111
 ## icmp fire, put them in the global table.
112
 ##
113
 
114
 proc discover_traces {} {
115
-    global ids nodes trace address
116
+    global ids nodes trace address parallel
117
     set count 0
118
     set start [clock seconds]
119
 
120
@@ -260,19 +299,14 @@
121
     foreach id [array names nodes] {
122
 	set ip $address($id)
123
 	lappend addrs $ip
124
-	if {[llength $addrs] > 255} {
125
-	    foreach route [trace_route $addrs] {
126
-		set id $ids([lindex $route 0])
127
-		set trace($id) [lindex $route 1]
128
-		incr count
129
-	    }
130
-	    set addrs ""
131
-	}
132
     }
133
-    foreach route [trace_route $addrs] {
134
-	set id $ids([lindex $route 0])
135
-	set trace($id) [lindex $route 1]
136
-	incr count
137
+    forsome lst $parallel $addrs {
138
+	debug "** trace $lst"
139
+	foreach route [trace_route $lst] {
140
+	    set id $ids([lindex $route 0])
141
+	    set trace($id) [lindex $route 1]
142
+	    incr count
143
+	}
144
     }
145
 
146
     # add new discovered nodes to the global tables
147
@@ -301,26 +335,22 @@
148
 ##
149
 
150
 proc discover_masks {} {
151
-    global nodes ids mask address
152
+    global nodes ids mask address parallel
153
     set count 0
154
     set start [clock seconds]
155
 
156
     set addrs ""
157
     foreach id [array names nodes] {
158
+	if {[info exists mask($id)]} continue
159
 	lappend addrs $address($id)
160
-	if {[llength $addrs] > 255} {
161
-	    foreach ipmask [icmp mask $addrs] {
162
-		set id $ids([lindex $ipmask 0])
163
-		set mask($id) [lindex $ipmask 1]
164
-		incr count
165
-	    }
166
-	    set addrs ""
167
-	}
168
     }
169
-    foreach ipmask [icmp mask $addrs] {
170
-	set id $ids([lindex $ipmask 0])
171
-	set mask($id) [lindex $ipmask 1]
172
-	incr count
173
+    forsome lst $parallel $addrs {
174
+	debug "** masks $lst"
175
+	foreach ipmask [icmp mask $lst] {
176
+	    set id $ids([lindex $ipmask 0])
177
+	    set mask($id) [lindex $ipmask 1]
178
+	    incr count
179
+	}
180
     }
181
     writeln "$count netmasks queried in [expr {[clock seconds]-$start}] seconds."
182
     flush stdout
183
@@ -334,31 +364,101 @@
184
 ## ===========================================================================
185
 ##
186
 
187
-proc discover_snmp_callback {id s e} {
188
-    global snmp
189
+proc discover_snmp_callback {id s e {v ""}} {
190
+    global snmp icon sysid2icon
191
     if {$e == "noError"} {
192
 	set snmp($id) [$s configure]
193
+	foreach i [array names sysid2icon] {
194
+		if {[string first $i [lindex $v 2]] == 0} {
195
+			set icon($id) $sysid2icon($i)
196
+		}
197
+	}
198
+	debug $v
199
     }
200
     $s destroy
201
 }
202
 
203
 proc discover_snmp {} {
204
-    global nodes address snmp
205
-    global icmp_retries icmp_timeout
206
+    global nodes address snmp communities ids parallel
207
+    global icmp_retries icmp_timeout mask gateways icon
208
+
209
     set start [clock seconds]
210
     mib load rfc1213.mib
211
-    foreach id [array names nodes] {
212
-        set ip $address($id)
213
-	if {[catch {snmp session -address $ip \
214
-		-retries $icmp_retries -timeout $icmp_timeout} s]} continue
215
+    foreach com $communities {
216
+	debug "** Looking for community $com"
217
+	set ips ""
218
+	foreach id [array names nodes] {
219
+	    if {[info exists snmp($id)]} continue
220
+	    lappend ips $address($id)
221
+	}
222
+	forsome ipl $parallel $ips {
223
+	    debug "** snmp community $com $ipl"
224
+	    foreach ip $ipl {
225
+		if {[catch {snmp session -address $ip -community $com \
226
+		    -retries $icmp_retries -timeout $icmp_timeout} s]} continue
227
+		if {[catch {
228
+		    $s get sysObjectID.0 "discover_snmp_callback $ids($ip) %S %E %V"
229
+		} msg]} {
230
+		    writeln "Oops: $ip get sysObjectID.0: $msg"
231
+		}
232
+		update
233
+		snmp wait
234
+	    }
235
+	}
236
+    }
237
+    foreach i [array names snmp] {
238
+	set s [eval snmp session $snmp($i)]
239
+	set l ""
240
+	catch {unset ifstate}
241
+	debug "** Walk [$s configure]"
242
+	if {[catch {$s walk x "ifIndex ifAdminStatus" {
243
+		set ifstate([lindex [lindex $x 0] 2]) [lindex [lindex $x 1] 2]
244
+	    } } msg]} {
245
+	    writeln "Oops: $msg from $s"
246
+	    continue
247
+	}
248
 	if {[catch {
249
-	    $s get sysObjectID.0 [list discover_snmp_callback $id "%S" "%E"]
250
-	} msg]} {
251
-	    writeln "Oops: $ip get sysObjectID.0: $msg"
252
+	    $s walk x "ipAdEntAddr ipAdEntNetMask ipAdEntIfIndex" { 
253
+		set a [lindex [lindex $x 0] 2]
254
+		if {$a == "0.0.0.0"} continue
255
+		if {$a == "1.1.1.1"} continue
256
+		if {$a == "127.0.0.1"} continue
257
+		set if [lindex [lindex $x 2] 2]
258
+		if {$ifstate($if) != "up"} continue
259
+		lappend l $a
260
+		set m [lindex [lindex $x 1] 2]
261
+		if {$a == $address($i)} { 
262
+		    set mask($i) $m 
263
+		} elseif {![info exists ids($a)]} {
264
+		    create_node $a
265
+		    set j $ids($a)
266
+		    set mask($j) $m
267
+		    set snmp($j) $snmp($i)
268
+		    if {[info exists icon($i)]} {
269
+debug "** id $j $a/$m icon $icon($i)"
270
+			set icon($j) $icon($i)
271
+		    }
272
+		    debug "** New interface: $j $a $m"
273
+		}
274
+	    } } msg]} {
275
+	    writeln "Oops: $msg from $s"
276
+	    continue
277
+	}
278
+		
279
+	if {[llength $l] > 1} {
280
+	    foreach j $l {
281
+		set ll "$j"
282
+		foreach k $l {
283
+		    if {$k != $j} {
284
+			lappend ll "$k"
285
+		    }
286
+		}
287
+		set gateways($ids($j)) $ll
288
+	    }
289
 	}
290
-        update
291
+	$s destroy
292
     }
293
-    snmp wait
294
+    
295
     set count [llength [array names snmp]]
296
     writeln "$count snmp agents queried in [expr {[clock seconds]-$start}] seconds."
297
     flush stdout
298
@@ -380,33 +480,26 @@
299
 ##
300
 
301
 proc discover_fips {} {
302
-    global nodes ids fip address
303
+    global nodes ids fip address parallel
304
     set count 0
305
     set start [clock seconds]
306
 
307
     set addrs ""
308
-    set idlist ""
309
+    set idx 0
310
     foreach id [array names nodes] {
311
 	lappend addrs $address($id)
312
-	lappend idlist $id
313
-	if {[llength $addrs] > 255} {
314
-	    set idx 0
315
-	    foreach ipfip [icmp ttl 32 $addrs] {
316
-		set id [lindex $idlist $idx]
317
-		set fip($id) [lindex $ipfip 0]
318
-		incr count
319
-		incr idx
320
-	    }
321
-	    set addrs ""
322
-	    set idlist ""
323
-	}
324
+	set idlist($idx) $id
325
+	incr idx
326
     }
327
     set idx 0
328
-    foreach ipfip [icmp ttl 32 $addrs] {
329
-	set id [lindex $idlist $idx]
330
-	set fip($id) [lindex $ipfip 0]
331
-	incr count
332
-	incr idx
333
+    forsome lst $parallel $addrs {
334
+	debug "** fips $lst"
335
+	foreach ipfip [icmp ttl 32 $lst] {
336
+	    set id $idlist($idx)
337
+	    set fip($id) [lindex $ipfip 0]
338
+	    incr count
339
+	    incr idx
340
+	}
341
     }
342
     writeln "$count ip addresses queried in [expr {[clock seconds]-$start}] seconds."
343
     flush stdout
344
@@ -513,6 +606,7 @@
345
     foreach id [array names nodes] {
346
 	set ip $address($id)
347
 	set netmask $mask($id)
348
+	if {$netmask == "0.0.0.0"} continue;
349
 
350
 	# Get the official network for this node.
351
 
352
@@ -526,22 +620,25 @@
353
 	    D { set bytes "" }
354
 	}
355
 	set net [join $bytes .]
356
-	if {![info exists table($net)]} { set table($net) $mmm }
357
+
358
+debug ">> $ip $netmask $net $mmm"
359
+
360
+	#if {![info exists table($net)]} { set table($net) $mmm }
361
 
362
 	# Sanity check for incorrect netmasks. Netmasks wider than
363
 	# the official network type don't make any sense. Ignore
364
 	# problems that are due to the loopback mask of the localhost.
365
 	
366
-	if {$netmask == "0.0.0.0"} continue;
367
 	if { [ip_network $net $netmask] != $net } {
368
 	    if {![catch {nslook [exec hostname]} localhost]} {
369
 		if {[string trim $localhost] == $ip} continue
370
 	    }
371
-	    set txt "Please check the netmask $netmask for $ip on class $class network $net."
372
+	    set txt "Please check the netmask $netmask for $ip on network $net."
373
 	    ined acknowledge $txt
374
 	    if {$report == "true"} {
375
 		writeln $txt
376
 	    }
377
+	    set mask($id) "0.0.0.0"
378
 	    continue
379
 	}
380
 
381
@@ -550,6 +647,21 @@
382
 	set subnet [ip_network $ip $netmask]
383
 	if {![info exists table($subnet)]} { set table($subnet) $netmask }
384
     }
385
+    foreach id [array names nodes] {
386
+	set ip $address($id)
387
+	set netmask $mask($id)
388
+	if {$netmask != "0.0.0.0"} continue;
389
+
390
+debug "))) $ip $netmask $mmm"
391
+	foreach net [array names table] {
392
+	    if {[ip_ismember $ip $net [lindex $table($net) 0]]} {
393
+		set mask($id) $table($net)
394
+debug "=== $ip $mask($id) $net "
395
+		break
396
+	    }
397
+	}
398
+
399
+    }
400
 
401
     if {[info exist table]} {
402
 
403
@@ -618,6 +730,7 @@
404
 		incr cons
405
 	    }
406
 	}
407
+        writeln "Network $net ($pros, $cons, $unk)." 
408
 	if {$cons > $pros} {
409
 	    set res [ined confirm \
410
   "The majority ($cons : $pros) of nodes on network $net have wide netmasks." \
411
@@ -745,6 +858,7 @@
412
 
413
     writeln "$count gateways discovered in [expr {[clock seconds]-$start}] seconds."
414
     flush stdout
415
+
416
 }
417
 
418
 
419
@@ -863,7 +977,7 @@
420
 ##
421
 
422
 proc merge_gateways {} {
423
-    global ids nodes networks links gateways address name
424
+    global ids nodes networks links gateways address name snmp
425
     set count 0
426
     set start [clock seconds]
427
 
428
@@ -871,7 +985,10 @@
429
 
430
     debug "** entering merge_gateways"
431
     foreach id [array names gateways] {
432
-	if {[llength $gateways($id)] < 2} continue
433
+	if {[llength $gateways($id)] < 2} {
434
+		unset gateways($id)
435
+		continue
436
+	}
437
 	debug "** gateways ($id) :\t $gateways($id)"
438
     }
439
 
440
@@ -888,8 +1005,6 @@
441
 
442
     foreach id [array names gateways] {
443
 
444
-	if {[llength $gateways($id)] < 2} continue
445
-
446
 	set myip [lindex $gateways($id) 0]
447
 	if {[info exists done($myip)]} {
448
 	    debug "** $myip skipped - $myip is already done"
449
@@ -952,12 +1067,16 @@
450
 	    # addresses for which there is no id. We get such beasts
451
 	    # when checking the returned udp address.
452
 	    
453
-	    if {![info exists ids($ip)]} continue
454
-	    
455
+	    if {![info exists ids($ip)]} {
456
+		writeln "skipping $ip for reasons we don't understand"
457
+		continue
458
+	    }
459
+
460
 	    set rid $ids($ip)
461
 	    catch {unset nodes($rid)}
462
 	    catch {unset address($rid)}
463
 	    catch {unset name($rid)}
464
+	    catch {unset snmp($rid)}
465
 	    
466
 	    # Adjust the links pointing to rid.
467
 	    
468
@@ -997,7 +1116,8 @@
469
 ##
470
 
471
 proc talk_to_ined {} {
472
-    global nodes networks links address snmp name
473
+    global nodes networks links address snmp name gateways subnetbits
474
+    global suppresdomain icon
475
     set count 0
476
     set start [clock seconds]
477
 
478
@@ -1018,6 +1138,9 @@
479
 		NODE {
480
 		    set addr [GetIpAddress $comp]
481
 		    set id_by_addr($addr) $id
482
+		    foreach a [ined attribute $id "allIP"] {
483
+			    set id_by_addr($a) $id
484
+		    }
485
 		}
486
 		NETWORK {
487
 		    set id_by_addr([ined address $comp]) $id
488
@@ -1045,13 +1168,22 @@
489
 	if {[info exists id_by_addr($ip)]} {
490
 	    set ined_id($id) $id_by_addr($ip)
491
 	} else {
492
+	    set nm "[lindex $name($id) 0]" 
493
+	    regsub "\(.*\)$suppresdomain\$" "$nm" {\1} nm
494
 	    set ined_id($id) [ined -noupdate create NODE]
495
 	    ined -noupdate address $ined_id($id) $ip
496
-	    ined -noupdate name $ined_id($id) "[lindex $name($id) 0]"
497
+	    ined -noupdate name $ined_id($id) "$nm"
498
 	    ined -noupdate label $ined_id($id) name
499
 	    ined -noupdate move $ined_id($id) [nextx] [nexty]
500
 	    if {[info exists snmp($id)]} {
501
 		ined -noupdate attribute $ined_id($id) "SNMP:Config" $snmp($id)
502
+		ined -noupdate color $ined_id($id) brown
503
+	    }
504
+	    if {[info exists icon($id)]} {
505
+		ined -noupdate icon $ined_id($id) $icon($id)
506
+	    }
507
+	    if {[info exists gateways($id)]} {
508
+		ined -noupdate attribute $ined_id($id) "allIP" $gateways($id)
509
 	    }
510
 	    set id_by_addr($ip) $ined_id($id)
511
 	    incr count
512
@@ -1074,11 +1206,12 @@
513
 	if {[info exists id_by_addr($ip)]} {
514
 	    set ined_id($id) $id_by_addr($ip) 
515
 	} else {
516
-	    set ined_id($id) [ined -noupdate create NETWORK 0 0 300 0]
517
-	    ined -noupdate name $ined_id($id) "$ip $type"
518
+	    set ined_id($id) [ined -noupdate create NETWORK 0 0 100 0]
519
+	    ined -noupdate name $ined_id($id) "$ip$subnetbits($networks($id))"
520
 	    ined -noupdate address $ined_id($id) $ip
521
 	    ined -noupdate label $ined_id($id) name
522
 	    ined -noupdate move $ined_id($id) [nextx] [nexty]
523
+	    ined -noupdate attribute $ined_id($id) "netmask" $networks($id)
524
 	    set id_by_addr($ip) $ined_id($id)
525
 	    incr count
526
 	}
527
@@ -1125,7 +1258,7 @@
528
 
529
 proc "Discover IP Network" {list} {
530
 
531
-    global nodes networks links ids trace mask fip name address gateways
532
+    global nodes networks links ids trace mask fip name address gateways snmp
533
     static nets
534
 
535
     reset
536
@@ -1171,15 +1304,16 @@
537
     foreach network $nets { discover_nodes $network }
538
     if {[info exists nodes]} {
539
 	discover_traces
540
-	discover_masks
541
 	discover_snmp
542
+	discover_masks
543
 	discover_fips
544
 	discover_networks
545
 	discover_gateways
546
 	discover_links
547
 	merge_gateways
548
 	talk_to_ined
549
-	unset nodes networks links ids trace mask fip name address
550
+	catch {unset nodes networks links ids trace mask fip name address}
551
+	catch {unset snmp}
552
 	catch {unset gateways}
553
     }
554
 
555
@@ -1195,7 +1329,7 @@
556
 
557
 proc "Discover Route" {list} {
558
 
559
-    global nodes networks links ids trace mask fip name address gateways
560
+    global nodes networks links ids trace mask fip name address gateways snmp
561
     static ips
562
 
563
     reset
564
@@ -1249,8 +1383,8 @@
565
 
566
     if {[info exists nodes]} {
567
 	discover_traces
568
-	discover_masks
569
 	discover_snmp
570
+	discover_masks
571
 	discover_fips
572
 	discover_networks
573
 	discover_gateways
574
@@ -1259,6 +1393,7 @@
575
 	talk_to_ined
576
 	unset nodes networks links ids trace mask fip name address
577
 	catch {unset gateways}
578
+	catch {unset snmp}
579
 	
580
     }
581
 
582
@@ -1276,6 +1411,9 @@
583
     global email_trace
584
     global report
585
     global debug
586
+    global communities
587
+    global suppresdomain
588
+    global parallel
589
 
590
     set result [ined request "IP-Discover Parameter" \
591
 	[list [list "# of ICMP retries:" $icmp_retries scale 1 10] \
592
@@ -1287,7 +1425,10 @@
593
           [list "Nodes per row:" $columns scale 10 40] \
594
           [list "Email Discover Routes:" $email_trace radio true false] \
595
           [list "Write Report:" $report radio true false] \
596
-          [list "Debug Mode:" $debug radio true false] ] \
597
+          [list "Debug Mode:" $debug radio true false]  \
598
+          [list "SNMP Communities:" $communities entry 10]  \
599
+          [list "Suppress Domain:" $suppresdomain entry 10]  \
600
+          [list "Parallelism:" $parallel scale 1 255] ] \
601
         [list "set values" cancel] ]
602
 
603
     if {[lindex $result 0] == "cancel"} return
604
@@ -1302,6 +1443,9 @@
605
     set email_trace      [lindex $result  8]
606
     set report           [lindex $result  9]
607
     set debug            [lindex $result 10]
608
+    set communities      [lindex $result 11]
609
+    set suppresdomain    [lindex $result 12]
610
+    set parallel	 [lindex $result 13]
611
 
612
     icmp -retries $icmp_retries
613
     icmp -timeout $icmp_timeout
614
@@ -1408,7 +1552,7 @@
615
 
616
 proc ined_create {host user} {
617
     global nodes networks links ids trace mask fip name address gateways
618
-    global hosts email_trace
619
+    global hosts email_trace snmp
620
 
621
     if {![info exists hosts($host)]} {
622
 	set hosts($host) $host
623
@@ -1425,8 +1569,8 @@
624
 	
625
 	if {[info exists nodes]} {
626
 	    discover_traces
627
-	    discover_masks
628
 	    discover_snmp
629
+	    discover_masks
630
 	    discover_fips
631
 	    discover_networks
632
 	    discover_gateways
633
@@ -1435,6 +1579,7 @@
634
 	    talk_to_ined
635
 	    unset nodes networks links ids trace mask fip name address
636
 	    catch {unset gateways}
637
+	    catch {unset snmp}
638
 	}
639
 	
640
 	writeln "discover finished in [expr {[clock seconds]-$start}] seconds"
(-)scotty/scripts/untrue (-5 lines)
Lines 1-5 Link Here
1
#!/bin/sh
2
# untrue $1: convert /bin/true -> true
3
# also mask CFLAGS
4
mv -f $1 $1.true
5
sed -e 's./bin/true.true.;s.^CFLAGS.#CFLAGS.' $1.true > $1

Return to bug 10806