Hi everybody
We have a datacenter with more than 1000 vms in our v-center. we need to get the access logs of the last 90 days for each VM. Does anybody know the way to do it from Vcenter?
I hope you can help me
Thanks
Lenin R.
Are you referring to anyone who access the console of the VM?
If you ONLY want console access information. Then you can run this query directly on the database....
select* from vpxv_events WHERE event_type = 'vim.event.VmAcquiredTicketEvent'
Keep in mind the date/time stamps don't account for timezone so you may need to do a little math there.
If you have the vCenter appliance this blog post explains how to gain access to the database... How to Hack vCenter Database in vCSA Appliance | DoubleCloud => Private Cloud + Public Cloud
Hi Leslie
Yes, I need to know which was the last access logs each console, to debug VMs are not using for a long time... Can I get this in vcenter client?
Thanks
I created this script for my vcenter servers. to check the logon. hope it can help you atleast 90%.
You can but you have to go to each server individually, go to the Events area and search for mks. This also may not display back 90 days. Anjani_Kumar's script will tell you the last logged on time of your specified servers, but not who and doesn't give a history.
Thanks Leslie,I will execute the script you gave me, and will let you know the test results.
Best regards.
Thanks Anjani,
I will execute the script you gave me, and will let you know the test results.
Best regards.
Sounds good. Keep in mind that script will tell you who opened the console on VMs, not whether they logged in or not. It also won't tell you the details if anyone logged into the server through other means (i.e. RDP).
If you are looking to get the list of users who accessed the VM console, I've developed a small PowerCLI script which can be useful to you.
You can find the script in my blog here. Also I am attaching a copy of it.
Hi PrakasPrakash
This script works for users who access the virtual machine from the View client?
Thanks