Get started Bring yourself up to speed with our introductory content.

Using Watch at the Service Console

Watch is a Service Console command that repeats another command for N times.

Watch is a Service Console command that repeats another command for N times. For example you could use it to monitor how rapidly a file is growing or for monitoring purposes (when the command produces just a one output at the time of the command being executed)

One of my common problems is when I copy large files through the MUI File Manager – is that I often “loose” the progress window when I go about clicking at other website. This leaves me in the dark about the progress of that file copy. So to get round this problem is use something like:

watch -n 1 ls -l dc1*.vmdk

This watches the file dc1.*.dsk every 1 second, watch repeats the ls command over and over again – which allows to me to see if the file is still growing during the file copy. This is what I see

Every 1s: ls -l dc1-s001.vmdk dc1-s002.vmdk dc1-s003….  Tue Apr 11 14:20:57 2006

-rw——-    1 root     root     1623261184 Apr 11 14:14 dc1-s001.vmdk
-rw——-    1 root     root     1190723584 Apr 11 14:20 dc1-s002.vmdk
-rw——-    1 root     root        65536 Apr 11 14:06 dc1-s003.vmdk
-rw——-    1 root     root          413 Apr 11 14:06 dc1.vmdk

Another use is using it for monitoring. For example we could be looking at disk-queue lengths with a using virtual machine. I would use the command

watch cat /proc/vmware/vm/146/disk/vmhba0\:1\:0

This would give an output of:

Every 2s: cat /proc/vmware/vm/146/disk/vmhba0:1:0       Tue Apr 11 14:32:17 2006

    shares       cmds      reads     KBread     writes  KBwritten   cmdsAbrt
 busRst    paeCmds  paeCopies  splitCmds  splitCopies   issueAvg   totalAvg
active     queued          virtTime
      1000       7320       6668     145830        652       7354          0
      0          0          0          0             0     104113   51902944
      0          0     2696826500000

Dig Deeper on VMware basics

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.