tmsh::get_status

Description

Returns a list of Tcl objects that can be passed to the following commands that accept an $obj argument:

This command can only be used on components that accept the field-fmt option. The field-fmt option is automatically appended to the argument list The tmsh help pages identify if a component supports the field-fmt option. Note that there are very few components that have status and statistics that do not support the field-fmt option, and in those cases you can use the Tcl command tmsh::show to retrieve the object in the form of a Tcl string object.

Syntax

tmsh::get_status [component] [args...]

The arguments to this command are the same as the tmsh command show. A component must be specified, for example, tmsh::get_status ltm pool.

Examples

proc get_stats { resultsArray } {

   upvar $resultsArray results

   set idx 0
   set objs [tmsh::get_status ltm pool $::pool_ids raw]
   set count [llength $objs]

   while { $idx < $count } {

       set obj [lindex $objs $idx]
       set pool [tmsh::get_name $obj]

       lappend results($pool) bps-in
       lappend results($pool) \
           [tmsh::get_field_value $obj "serverside.bits-in"]

       lappend results($pool) bps-out
       lappend results($pool) \
           [tmsh::get_field_value $obj "serverside.bits-out"]

       lappend results($pool) cps
       lappend results($pool) \
           [tmsh::get_field_value $obj "serverside.tot-conns"]

       incr idx
   }
}