Buscar

VMWare: ESXi host uptime

En el siguiente post vimos las distintas formas de obtener el uptime de un equipo Windows:

Windows: Ver uptime (SYSADMIT.com)

Sobre sistemas VMWare ESXi, gracias a los comandos integrados en la BusyBox, disponemos del comando uptime.

Acerca de la BusyBox de VMWare ESXi:

VMWare: ESXi BusyBox (SYSADMIT.com)

Si conectamos vía SSH a cada host VMWare ESXi y ejecutamos el comando uptime, podremos obtener el uptime del host ESXi:

login as: root
Using keyboard-interactive authentication.
Password: XXXXXX
The time and date of this login have been sent to the system logs.

VMware offers supported, powerful system administration tools.  Please
see www.vmware.com/go/sysadmintools for details.

The ESXi Shell can be disabled by an administrative user. See the
vSphere Security documentation for more information.
~ # uptime
 04:26:24 up 00:20:42, load average: 0.01, 0.01, 0.01


También vía SSH, fuera de los comandos incluidos en la BusyBox, disponemos del comando esxtop, donde también podremos verificar el uptime del host VMWare ESXi:

Vista esxtop

Finalmente, a partir de la versión 5 de VMWare ESXi disponemos del fichero: /var/log/vmksummary.log.

Este fichero, entre otra información, contiene las paradas, reinicios que se han producido sobre el host ESXi.

Entre los mensajes que podemos encontrar junto con su fecha y hora:

bootstop: Host has booted
bootstop: Host is rebooting
bootstop: Host is powering off
bootstop: Host is halting


Con los comandos cat y grep, podremos obtener el listado de forma rápida:

cat /var/log/vmksummary.log |grep booted

2015-06-26T06:25:27Z bootstop: Host has booted
2015-06-26T06:47:23Z bootstop: Host has booted
2015-06-26T06:58:19Z bootstop: Host has booted
2015-06-26T07:05:26Z bootstop: Host has booted
2015-06-26T07:09:50Z bootstop: Host has booted
2015-07-08T05:32:17Z bootstop: Host has booted

Sin embargo, en entornos donde disponemos de muchos hosts VMWare ESXi, podemos obtener el uptime de todos ellos, vía VSphere Client o bien con PowerCLI, conectando al Virtual Center de nuestra infraestructura.


Para obtener masivamente el uptime de todos los hosts VMWare ESXi:


1) Con VSphere Client:

Conectamos VSphere Client a nuestro Virtual Center.

Cambiamos a la vista "Inventory", seleccionamos "Datastores and Datastore Clusters", seleccionamos el datacenter, pestaña "Hosts", botón derecho, "View Column", seleccionamos "Uptime".

Este procedimiento nos añadirá una nueva columna con el nombre "Uptime", donde veremos el uptime de cada host ESXi.

Vista VSphere Client


2) Con PowerCLI:

Get-VMHost | Get-View | select Name, @{N="Uptime"; E={(Get-Date) - $_.Summary.Runtime.BootTime}}|fl


Recordemos que para que la PowerCLI conecte a nuestro Virtual Center, deberemos ejecutar en primer lugar:

Connect-VIServer -Server XXX.XXX.XXX.XXX -User YYYYYYY -Password ZZZZZZZZ

No hay comentarios:

Publicar un comentario