ProTip: Use “watch” to monitor or troubleshoot ESXi

Just thought I should do a quick post about a command that is extremely useful but often forgotten and that command is “watch”. Syntax of this command is:

watch

[-n SEC] [-t] PROG ARGS

where “n” is the interval in seconds (2 by default).

This command is used as a wrapper, to constantly update results from another command, at a particular frequency. That makes it very useful for monitoring a particular activity for troubleshooting/investigations.

A few months back, I used this command during an investigation into a NTP-related question from a customer. The command used in that case was:

watch “ntpq -p localhost”

Time Query with four individual VMware NTP

If I want to constantly monitor NIC statistics, I can use:

watch “ethtool -S vmnic5”

Watch - Ethtool

Another example is while copying large files between datastores. If you want to keep an eye on datastore usage, just in case it fills up, you can use:

watch “df -h”

Watch - df

while the files copy across. This is much more accurate and real-time than the GUI.

I am sure there will be many other uses that you can find for it. This post is just a quick reminder to those who might have forgotten, how useful this command is.

Hope this helps!

Like this:

By | 2016-12-11T15:25:01+00:00 April 29th, 2015|ESX, VMware, vSphere|2 Comments

Share This Story, Choose Your Platform!

About the Author:

Ather Beg is a technology and virtualisation blogger and is Chief Virtualogist at Virtualogists Ltd, which is a consultancy focusing on virtualised solutions. Ather has worked in IT for over 20 years and contributes his findings on this blog. In addition to holding several industry-related certifications, he has also been awarded vExpert status by VMware.

2 Comments

  1. richdowling April 29, 2015 at 10:35 AM - Reply

    Fab! I’ve been using Unix/Linux for 20+ years and I’d either never come across this one, or completely forgotten about it. Very useful!

    • Ather Beg April 29, 2015 at 11:15 AM - Reply

      Means time on the post was well-spent :-). Cheers!

Leave a comment

%d bloggers like this: