'blue' patches for ip_monitor

Doug Hughes (Doug.Hughes@Eng.Auburn.EDU)
Fri, 27 Sep 1996 16:05:23 -0500

I figure it's about time for another release of blue patches for
ip_monitor.tcl that comes with scotty but really works with
tkined.

What they do? When a node goes down, the node and the group it's
in flash. When it comes back up, they stop flashing. If you happen
to be away from your computer and you don't have the 'syslog' or 'write'
option checked, you wouldn't know that they were down. This patch
makes it so that when a node comes back up, it, and the group it's
in, turn blue. In the IP-Monitor pull down there is an acknowledge
button which will acknowledge that you know that the node was down
and it's now safe to go back to its regular color.

There's also a commented out 'exec' that we use to send our group
mail when any of the monitored nodes goes down. If you want it to send
you mail, uncomment this line and change the last word (actually two words
separated by a comma but no space).

This patch is known to work against 1.4.1, but should work against
1.4.2-1.4.4 as well. I don't think any major changes have happened
to ip_monitor along the way, and I just haven't gotten around to
upgrading yet.. :( It should be noted that I've been using this feature
since about 1.2 without any difficulties.

*** ip_monitor.tcl.orig Fri Sep 27 15:49:06 1996
--- ip_monitor.tcl Fri Sep 27 15:57:30 1996
***************
*** 79,84 ****
--- 79,113 ----
}

##
+ ## Once an icon has turned blue, we need to acknowledge it to
+ ## Get it back to its original color
+ ##
+
+ proc Acknowledge { list } {
+ global reachability_color
+
+ if {![info exists reachability_ids]} { set reachability_ids "" }
+
+ foreach litem $list {
+ set type [lindex $litem 0]
+ set id [lindex $litem 1]
+ if {$type == "GROUP"} {
+ ined -noupdate color $id $reachability_color($id)
+ set reachability_color($id) ""
+ foreach m [ined member $id] {
+ if {[ined type $m] != "NODE"} { continue }
+ if {[ined color $m] == "blue"} {
+ ined -noupdate color $m $reachability_color($m)
+ set reachability_color($m) ""
+ }
+ }
+ }
+ set reachability_color($id) ""
+ ined -noupdate color $id $reachability_color($id)
+ }
+ }
+
+ ##
## Restart a monitor job by calling cmd. Build the list of objects
## from tkined using ined retrieve commands.
##
***************
*** 195,200 ****
--- 224,237 ----
set reachability_color($id) [ined -noupdate color $id]
set reachability_label($id) [ined -noupdate label $id]
ined -noupdate color $id red
+ # exec echo "[ined name $id] is down - [exec date]" | /usr/ucb/mail -s "host [ined name $id] is down" admin,doug
+ set p [ined parent $id]
+ if {$p != ""} {
+ if {[ined type $p] == "GROUP"} {
+ set reachability_color($p) [ined -noupdate color $p]
+ ined -noupdate color $p red
+ }
+ }
}
ined flash $id [expr {[[job current] cget -interval] / 1000}]
ined -noupdate attribute $id \
***************
*** 204,210 ****
} else {
if {$reachability_color($id) != ""} {
ined -noupdate color $id $reachability_color($id)
! set reachability_color($id) ""
}
if {$reachability_label($id) != ""} {
ined -noupdate label $id $reachability_label($id)
--- 241,255 ----
} else {
if {$reachability_color($id) != ""} {
ined -noupdate color $id $reachability_color($id)
! ined -noupdate color $id blue
! # set reachability_color($id) ""
! set p [ined parent $id]
! if {$p != ""} {
! if {[ined type $p] == "GROUP"} {
! ined -noupdate color $p $reachability_color($p)
! ined -noupdate color $p blue
! }
! }
}
if {$reachability_label($id) != ""} {
ined -noupdate label $id $reachability_label($id)
***************
*** 1037,1043 ****
}

set menus [ ined create MENU "IP-Monitor" \
! "Check Reachability" "Round Trip Time" "" \
"NTP Offset" "" \
"System Load" "CPU Activity" \
"Disk Activity" "Interface Activity" "" \
--- 1082,1088 ----
}

set menus [ ined create MENU "IP-Monitor" \
! "Check Reachability" "Round Trip Time" "Acknowledge" "" \
"NTP Offset" "" \
"System Load" "CPU Activity" \
"Disk Activity" "Interface Activity" "" \