#!./tclnm
#
# This is another classical "tell me" application, dumps the Interfaces
# table takes a hostname as argument...
#

if {$argc == 1} {
   set host fls-gw1
} else {
   set host [lindex $argv 1]
}

set s0 [snmp open $host]

snmp default $s0 prefix .1.3.6.1.4.1.33.13.1.17.1

set fmt {
    "%2s "
    "%8s/"
    "%-8s "
    "%-10s "
    }

set hdr {
    "Nr"
    "User"
    "User"
    "State"
    }

set j 0
puts stdout "------------------------------------------------------------------------------"
foreach i $hdr {
    puts stdout [format [lindex $fmt $j] $i] nonewline
    incr j
}
puts stdout "\n------------------------------------------------------------------------------"
snmp getbulk $s0 -l -v {
    1
    17
    26
    23
    } x {
    set j 0
    #puts stdout "<$x>\n"
    foreach i "$x" {
	puts stdout [format [lindex $fmt $j] "$i"] nonewline
	incr j
    }
    puts stdout ""
    }
puts stdout "------------------------------------------------------------------------------"
