How to use Cisco TCL
set cmd [lindex $argv 0]
if {[string equal $cmd ""]} { puts "Usage: wc command"; return; }
set result [ llength [split [exec $cmd] "\n" ] ]
puts -nonewline "OK | count=$result"
alias exec wc tclsh flash:wc.tcl
For Zenoss: https://gist.github.com/7526240