VMware Cloud Community
clockvm
Contributor
Contributor
Jump to solution

PowerCLI script to list df -hl on all ESX host?

Hi Expert,

I have more than 100 esx hosts, and I need to list all the df -hl output for my report. Instead of login to each esx host to obtain below output, is there powercli script that I can use to pull out similar information?

Filesystem            Size  Used Avail Use% Mounted on

/dev/sdaa2             20G  1.5G   17G   8% /

/dev/cciss/c0d0p1     1.1G  118M  909M  12% /boot

/dev/sdaa6            9.7G  151M  9.0G   2% /home

/dev/sdaa7            9.7G  151M  9.0G   2% /tmp

/dev/sdaa5            9.7G  317M  8.9G   4% /var

/dev/sdaa8            494M  212M  257M  46% /vmimages

Please advice. Thanks

Tags (5)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Are you allowed to enable SSH on the ESX(i) servers ?

And are you allowed to establish a SSH session to each ESX(i) server ?

Do you have an account and password on each ESX(i) server that can run the 'df' command ?

If all these are yes, then you can use something like plink.exe from the PuTTY Suite to connect to each ESX(i) server, run the 'df' command and retrieve the output.

There are multiple examples available of using plink.

And remember that you will need a fingerprint for each ESX(i) server to be stored on the client from where you run the script.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
5 Replies
JCMorrissey
Expert
Expert
Jump to solution

Hi,

Take a look at http://communities.vmware.com/thread/319870

Many tx!

Please consider marking as "helpful", if you find this post useful. Thanks!... http://johncmorrissey.wordpress.com/
LucD
Leadership
Leadership
Jump to solution

Are you allowed to enable SSH on the ESX(i) servers ?

And are you allowed to establish a SSH session to each ESX(i) server ?

Do you have an account and password on each ESX(i) server that can run the 'df' command ?

If all these are yes, then you can use something like plink.exe from the PuTTY Suite to connect to each ESX(i) server, run the 'df' command and retrieve the output.

There are multiple examples available of using plink.

And remember that you will need a fingerprint for each ESX(i) server to be stored on the client from where you run the script.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
clockvm
Contributor
Contributor
Jump to solution

Thank you LucD and all for replying in this, definitely that will work via ssh. Done that between linux box before and it works.

But if there is any option from powercli to obtain those information that would be great.

Thanks again!

0 Kudos
clockvm
Contributor
Contributor
Jump to solution

Thanks JCMorrissey I really appreciate it.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Afaik there are no PowerCLI cmdlets that allow you to list the local ESXi filesystem


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos