VMware Cloud Community
EnormousBeans
Contributor
Contributor

View VM Usage Log via command line

Hello,

I am searching for a way to view the log files for specific VM's via the command line. I am new to using vSphere SDK.

My end goal is to make a report on every guest on a host and when it was last accessed.

Any ideas? Thanks for your help.

EnormousBeans

Tags (3)
0 Kudos
3 Replies
jonathanp
Expert
Expert

Hi,

which log files are you talking about exactly...

There is log files like vmware.log in each VMs folder.

i.e. /vmfs/volume/<vmfs_name>/<vm_name>/*.log

Jonathan

0 Kudos
EnormousBeans
Contributor
Contributor

Good question. The log files that you are talking about, the ones that are in each VM folder, would be excellent.

All I need to know is how to get the contents of those logs using the Perl SDK commands.

Thanks for responding.

EnormousBeans

0 Kudos
jonathanp
Expert
Expert

I know what you try to do, and was kind in this situation.

I ended up writing an apps in c# using some API.. and it tooks long time to do that.. but it is targeting another purpose.

Not so sure if you can get the log file using the perl SDK's.

One thing that you could do is... write a script that collect what you need from the log file and then pushing to a central location using ftps or scp.

you could have this automated using a cron job and you just take from one server using winscp or other tools...

Jonathan