VMware Communities > VMTN > VMware vSphere™ > Automation Tools > vSphere™ PowerCLI > Discussions

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
4 Replies Last post: May 12, 2009 10:13 PM by LucD
Reply

how to get detailed esx host info?

May 12, 2009 7:19 AM

Click to view vmsf's profile Enthusiast vmsf 57 posts since
Jul 14, 2006

Hi,

Is there a script available to find the following information reg. an esx host:

TIME ZONE, ESX UUID, ESX LICENSE, USERS CONNECTED, LIST OF REGISTERED VMS, LAST 30logins, VMWARE PROCESS LIST, SERIAL NUMBER,

LOCATION, HOSTID, PKGINFO, PASSWD/SHADOW/GROUPS ENTRIES ,

Contents of following files: KRB5.CONF YP.CONF NSCD.CONF

SYSLOG.CONF/INITTAB/SERVICES NETSTAT-NR output.

Thx,

-vmsf

Reply Re: how to get detailed esx host info? May 12, 2009 7:42 AM
Click to view harkamal's profile Hot Shot harkamal 220 posts since
Mar 19, 2009
Looks like you need professional help...or have you made some initial efforts and seek further help from the forum ?
Reply Re: how to get detailed esx host info? May 12, 2009 8:16 AM
Click to view vmsf's profile Enthusiast vmsf 57 posts since
Jul 14, 2006

I can get a lot of information using PowerGui (just started learning PowerShell http://communities.vmware.com/images/emoticons/cool.gif ) but not of all it - example the 30 logins or the contents of the files.

I also want to run it as a scheduled task (where PowerGui does not really work) so a PowerShell script will really help.


Reply Re: how to get detailed esx host info? May 12, 2009 8:02 PM
in response to: vmsf
Click to view cody.bunch's profile Hot Shot cody.bunch 152 posts since
Dec 28, 2007
Everything in PowerGUI however, has some PowerShell code on the backend that can be viewed. This would work well for some copy/paste into a script. As far as logins, and contents of files, I'm not sure you can get this directly from PowerShell (but I'm sure LucD will tell me otherwise).


-Cody Bunch
vExpert, VCP VI3
http://professionalvmware.com

Reply Re: how to get detailed esx host info? May 12, 2009 10:13 PM
in response to: cody.bunch
Click to view LucD's profile Champion LucD 2,382 posts since
Oct 31, 2005
The ESX information you're after can't be obtained directly with the VITK.

The alternative is to set up a session with plink to the COS and get the information from there (provided it is available).
Some examples can be found in Copy files (vmx) , how to script it ??, Retrieve VMX and Scipt to update ESX local file (esx.conf) on all hosts.
But note that the use of plink requires you to set up sudo on the COS.

Coming back to your question, if you can get the information at the console, you can get it with PowerShell via the use of the plink utility.
Actions