Sun Ray Bandwidth Monitoring Scripts
Kent Peacock, one of our illustrious Senior Engineers who helped give birth the to Sun Rays almost 10 years ago in Sun Labs has some great scripts that we use internally for watching how much bandwidth Sun Rays use. I asked him if it would be OK to share these scripts with our user community and he said "Please do!". You can grab a copy the scripts here. (Right click, Save Target/Link As...)
There are two scripts, utbwlist2 and utbw. The utbwlist2 script is for looking at all the Sun Ray devices on a server or host group and utbw is for looking at a single Sun Ray, typically ran by the user of the session from a terminal.
UTBWLIST2
utbwlist2 takes the following options:
-a get information from all members of the failover group
-h <server> target the given server
-f <filter> apply this regular expression filter to the IP addresses of the Sun Rays (useful for selecting subnets)
The output is as follows:
IP Address Token/Name Pkts/s Mbps KBytes DTCPU
129.146.225.93 OpenPlatform.4090009c24a5d7061e1 91 21.310 2291 21%
129.146.97.135 auth.mk228279 866 7.839 20067 9%
129.146.127.177 OpenPlatform.4090009c24a1890c091 1288 6.716 34384 14%
129.144.70.192 auth.shinseki 536 6.033 15444 33%
129.146.55.170 OpenPlatform.4090009c24a5d704360 702 5.951 15234 9%
129.144.71.225 auth.de161882 595 5.901 15105 18%
129.144.88.26 JavaBadgeNP.4090009c22b1e70d0d10 654 3.202 16392 9%
129.146.39.45 OpenPlatform.4090009c24a18c121f0 254 2.422 6200 9%
129.146.62.218 auth.tt8301 242 2.376 6083 23%
129.146.35.155 auth.cb201937 219 1.928 4935 7%
129.146.53.121 JavaBadgeNP.4090009c22b1e70f300c 189 1.801 4610 6%
129.146.39.49 OpenPlatform.4090614573162716094 189 1.709 4375 9%
129.146.32.47 OpenPlatform.4090009c243f2109191 159 1.634 4184 5%
129.144.89.119 OpenPlatform.4090614573162716105 163 1.550 3966 7%
129.144.89.125 OpenPlatform.4090009c24ac6116081 158 1.525 3904 6%
DTUS: Packets: Bandwidth Mbps DTU CPU
Active 844 28% Lost 1748 Total 154.610 1%
Total 2971 Total 515771 Average 0.182
Idle 1972 RActive 999 Ravg 0.154
The top block shows bandwidth use of the top Sun Rays, in decreasing order, where:
IP Address is the IP address of one of the top bandwidth consumers
The summary at the end gives totals for either the current server or the server listed using -h, and either just the server or the whole group if -a is present.
Token/Name is the token presented by the Sun Ray
Pkts/s average packets received per second over the last 20 seconds
Mbps average bandwidth over 20 seconds
KBytes total KBytes received
DTCPU average CPU used on the Sun Ray.
The summary block fields are defined as follows:
DTUS: UTBW
Active DTUs that have exceeded a small threshhold (1Kbps) of traffic over the last 20 seconds.
Total Total DTUs connected
Idle Number of DTUs that have not exceeded the traffic threshhold in the last minute
Packets:
Lost Total lost packets in last 20 seconds
Total Total packets received by DTUs
RActive "Real" active DTUS (Total - Idle)
Bandwidth Mbps:
Total Total average bandwidth across all Sun Rays in last 20 seconds
Average Average bandwidth per active Sun Ray
Ravg Average bandwidth per RActive Sun Ray
DTU CPU Total per-DTU average CPU use.
The output of the utbw program applies to a single Sun Ray. It is usually run it in a shell window on the Sun Ray that you want to get the information about. It can also take a token as an argument, and it will monitor the Sun Ray bound to that token. The output contains the following fields (all measurements over the last 20 seconds):
lost 0/00% pkts 278697 cpu 0% kbytes 249436 0.145 Mbps 1.6(1.6) ms
Output decoded as follows:
lost/pct Lost packets and percent of total
pkts Total packets received
cpu DTU cpu used in last 20 seconds
kbytes Kbytes received
Mbps Average bandwidth
xx(yy) Instantaneous latency in milliseconds (xx) and smoothed average (yy)


This is awesome :)
I would be very nice to have the same kind of scripts for SSGD ;)
Posted by Remold on September 08, 2008 at 12:52 PM PDT #
One small typo:
RAvg is the average bandwidth per RActive Sun Ray.
Posted by Kent Peacock on September 08, 2008 at 02:02 PM PDT #
Is the download complete? Seems missing both scripts utbwlist2 and utbw. Only the main file utbwscripts is included.
Thanks for sharing!
Posted by Jeroen on September 10, 2008 at 03:39 AM PDT #
utbwscripts is tar archive.. just unpack it and u'll get both scripts
Posted by n1p on September 10, 2008 at 04:03 AM PDT #
Tnx, got them now, workes perfect!
Posted by Jeroen on September 10, 2008 at 04:50 AM PDT #
I downloaded and gunzipped the file, however when I attempt to unpack it using tar xvf i get the following error
tar: blocksize = 18
tar: utbw - cannot create
tar: utbwlist2 - cannot create
please advise
Posted by billy on October 21, 2008 at 11:36 AM PDT #
Billy
If you haven't solved this rename the tar file to .tar. The problem occurs as the tar archive is the same name as the directory it is trying to create.
Cheers
Posted by Bob on November 29, 2008 at 03:53 AM PST #