Posts
49
Comments
83
Trackbacks
0
A simple version of Top or How to monitor data in a Monad session
In the cmdline, sometimes its handy to have a console open in the background just for monitoring some data. For example, in my Unix admin days, I used to use top to monitor what was going on in the system. In Monad/PowerShell, I use this little hack: param(    [scriptblock]$command=$(throw "A script block is required..."),    $timer=5 ) while ($true) {    clear-host    &$command | format-table    start-sleep $timer > $null } You can run this by doing: topit { }. For example, this is how you would use this trick to monitor how many users are logged on to the current server: topit { get-logonstatistics } -timer 10  The cool thing about this is that it works against any cmd in the world! Huzzah! (I can't believe I just said "huzzah").
posted on Wednesday, May 03, 2006 8:05 PM Print
Comments
Gravatar
# 
Lee
5/4/2006 10:05 PM
  
Cool! Here's an implementation of 'top' I wrote, if you're looking for that specific tool :) http://www.leeholmes.com/blog/AccessingPerformanceCountersInMSH.aspx

Post Comment

Title *
Name *
Email
Url
Comment *  
Please add 2 and 7 and type the answer here:
News
A little slow these days as I'm busy working on exchangelabs.com. I will try and post tidbits when I get some time. Enjoy the older posts till then!