#!/local/bin/wishnm -f

set s0 [snmp open fls-gw1]

set pd0 [snmp mkpdu -l {
	system.sysUpTime.0
        .1.3.6.1.4.1.9.2.1.56.0
        .1.3.6.1.4.1.9.2.1.57.0
        .1.3.6.1.4.1.9.2.1.58.0
        .1.3.6.1.4.1.9.2.1.78.0 .1.3.6.1.4.1.9.2.1.79.0
        .1.3.6.1.4.1.9.2.1.80.0 .1.3.6.1.4.1.9.2.1.81.0
        .1.3.6.1.4.1.9.2.1.82.0 .1.3.6.1.4.1.9.2.1.83.0
        .1.3.6.1.4.1.9.2.1.84.0 .1.3.6.1.4.1.9.2.1.85.0
        .1.3.6.1.4.1.9.2.1.86.0 .1.3.6.1.4.1.9.2.1.87.0
        .1.3.6.1.4.1.9.2.1.88.0 .1.3.6.1.4.1.9.2.1.89.0
	}]

proc upd {} {
    global s0 pd0
    snmp send $s0 -P get $pd0
    after 10000 upd
    }

snmp callback $s0 -v a1 {
    .ut configure -text "[lindex $a1 0]"
    .s5 configure -text [format "%-10s %7d %%" "5 sec Avg:" [lindex $a1 1]]
    .m1 configure -text [format "%-10s %7d %%" "1 min Avg:" [lindex $a1 2]]
    .m5 configure -text [format "%-10s %7d %%" "5 min Avg:" [lindex $a1 3]]
    .t1 configure -text [format "%-10s %7d C" \
	[lindex $a1 4]: [lindex $a1 5]]
    .t2 configure -text [format "%-10s %7d C" \
	[lindex $a1 6]: [lindex $a1 7]]
    .t3 configure -text [format "%-10s %7d mV" \
	[lindex $a1 8]: [lindex $a1 9]]
    .t4 configure -text [format "%-10s %7d mV" \
	[lindex $a1 10]: [lindex $a1 11]]
    .t5 configure -text [format "%-10s %7d mV" \
	[lindex $a1 12]: [expr [lindex $a1 13]-65536]]
    } 

pack append . \
	 [label .l1 -text "FLS-GW1" -fg gray85 -bg maroon\
	     -font "-*-times-medium-r-*-*-*-180-*-*-*-*-*-*" ] {top fillx} \
	[label .ut -bg "#43d088" -font 5x7 ] { top fillx } \
	[label .s5 -anchor w -font 5x7 ] { top fillx } \
	[label .m1 -anchor w -font 5x7 ] { top fillx } \
	[label .m5 -anchor w -font 5x7 ] { top fillx } \
	[label .t1 -anchor w -font 5x7 ] { top fillx } \
	[label .t2 -anchor w -font 5x7 ] { top fillx } \
	[label .t3 -anchor w -font 5x7 ] { top fillx } \
	[label .t4 -anchor w -font 5x7 ] { top fillx } \
	[label .t5 -anchor w -font 5x7 ] { top fillx } 

update
upd

wm title . TK
