Quantcast
Channel: VMware Communities : Blog List - All Communities
Viewing all articles
Browse latest Browse all 3135

Scripting in the ESXi command line

$
0
0

Hello,

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:

 

#!/bin/sh

 

NUM=0

 

while [ $NUM -lt 3 ]

do

 

DATE=`date +"%Y%m%d_%H-%M-%S"`

esxtop -b -d 2 -n 3 > esxtopcapture-$DATE.csv

NUM=`expr $NUM + 1`

 

done

 

# EOF

 

- 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

 

 

Best regards,

Pablo


Viewing all articles
Browse latest Browse all 3135

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>