This can be the steps in order to execute one small script in the ESXi command line (SSH).
- Connect to the command line by ssh
- Change directory to some datastore
- Generate the script, this can be one example:
while [ $NUM -lt 3 ]
esxtop -b -d 2 -n 3 > esxtopcapture-$DATE.csv
NUM=`expr $NUM + 1`
- Finally, give execution permission to the script:
busybox chmod 755 script.sh
In this case, the script iterates the "while" loop three time. Every time a esxtop output file is generated.
Hope this can be helpful to someone