# rm-rf.es | Administración de sistemas

Bitácora personal de un SysAdmin Gnu/Linux, Windows, BSD...

Cómo utilizar la iLO de HP a través de SSH


HP Proliant iLOA la hora de automatizar gestiones y tareas que normalmente realizamos a través de la interfaz web de las iLO de HP disponer de acceso ssh a las mismas lo facilita enormemente (lógicamente…), así que en esta entrada vamos a ver los comandos y tareas básicas que podemos ejecutar desde la shell ssh que nos ofrece iLO.

El prompt que encontraremos al acceder por ssh es el siguiente:

</>hpiLO->

Ver el estado de “salud” del servidor

A través de ssh podemos ver el estado de los ventiladores, fuentes de alimentación y sensores de temperatura del sistema. Estos datos se encuentra en la ruta /system1/ y podemos visualizarlos con los siguientes comandos. Podemos tener una visión general de los parámetros que podemos revisar ejecutando:

</>hpiLO-> show /system1
status=0
status_tag=COMMAND COMPLETED

/system1
  Targets
    firmware1
    bootconfig1
    log1
    led1
    oemhp_vsp1
    cpu1
    cpu2
    memory1
    memory2
    memory3
    memory4
    memory5
    memory6
    memory7
    memory8
    slot1
    slot2
    slot3
    fan1
    sensor1
    sensor2
    sensor3
    sensor4
    sensor5
    sensor6
    sensor7
    sensor8
    sensor9
    sensor10
    sensor11
    drives
    network1
  Properties
    name=ProLiant BL460c G1
    number=XXXXXXX
    oemhp_server_name=XXXX
    enabledstate=enabled
    oemhp_powerreg=os
    processor_number=4
    pstate_number=1
    An iLO 2 License key is required.
  Verbs
    cd version exit show reset set start stop

Fuentes de alimentación

hpiLO-> show /system1/powersupply*
status=0
status_tag=COMMAND COMPLETED

/system1/powersupply*
Targets
Properties
Verbs
cd version exit show set

Nota: esta prueba ha sido realizada en un Proliant BL, motivo por el cual no se reciben datos.

Ventiladores

hpiLO-> show /system1/fan1
status=0
status_tag=COMMAND COMPLETED

/system1/fan1
  Targets
  Properties
    DeviceID=Virtual Fan
    ElementName=System
    OperationalStatus=Ok
    VariableSpeed=Yes
    DesiredSpeed=25
    HealthState=Ok

Sensores

hpiLO-> show /system1/sensor1

status=0
status_tag=COMMAND COMPLETED

/system1/sensor1
  Targets
  Properties
    DeviceID=VRM 1
    ElementName=CPU 1
    OperationalStatus=Ok
    RateUnits=Volts
    CurrentReading=N/A
    SensorType=Voltage
    HealthState=Ok
    oemhp_CautionValue=0
    oemhp_CriticalValue=0

Apagar, encender o reiniciar el servidor

Comprobar el estado del servidor:

</>hpiLO-> power

power: server power is currently: On

Encender el servidor:

</>hpiLO-> power on

ó

</>hpiLO-> start /system1

Apagar el servidor:

</>hpiLO-> power off

ó

</>hpiLO-> stop /system1

Power Cycle del servidor:

</>hpiLO-> power reset

ó

</>hpiLO-> reset /system1 hard

Reinicio suave del servidor:

</>hpiLO-> power warm

ó

</>hpiLO-> reset /system1 soft

Reinicio del servidor:

</>hpiLO-> reset /system1

Encender o apagar el LED (UID)

Comprobar el estado:

</>hpiLO-> show /system1/led1

Encender el UID:

</>hpiLO-> start /system1/led1

Apagar el UID:

</>hpiLO-> stop /system1/led1

Actualizar el firmware

Con el siguiente comando actualizaríamos el firmware del servidor a través de la imagen bin en la URL indicada:

</>hpiLO-> load -source http://repositorio.com/firmware/ilofirmware.bin

Visualizar el log de eventos y sistema

Visualizar el log de eventos de iLO:

</>hpiLO-> show /map1/log1

Este primer comando nos muestra el listado de eventos, luego podemos elegirlos de forma individual y visualizarlo:

</>hpiLO-> show /map1/log1/record212
status=0
status_tag=COMMAND COMPLETED

/map1/log1/record212
  Targets
  Properties
    number=212
    severity=Informational
    date=07/04/2009
    time=04:50
    description=Remote console session stopped by: XXX - 192.1.168.0.200(

Para visualizar eventos de sistema es lo mismo pero a través de /system1/log1:

</>hpiLO-> show /system1/log1
</>hpiLO-> show /system1/log1/record1
status=0
status_tag=COMMAND COMPLETED

/system1/log1/record1
  Targets
  Properties
    number=1
    severity=NonCritical
    date=08/04/2008
    time=00:01
    description=POST Error: 1785-Drive Array not Configured

Y esto es todo por hoy, una pequeña muestra de lo que podemos hacer en la iLO de HP vía SSH, por supuesto hay muchas más posibilidades, quizás las explique otro día ;)

Regenerar clave de administrador de iLO sin saber la password


Si hemos perdido la clave del usuario Administrator en una iLO y no queremos reiniciar el sistema para cambiar la clave o generar un nuevo usuario, podemos regenerarla (sin conocer la actual) desde la línea de comandos del servidor (GNU/Linux) en cuestión.

Lo primero que necesitamos es tener instalado hponcfg (revisad este artículo para su instalación: Cambiar password de HP iLO desde Linux).

Después utilizamos el siguiente XML para solicitar una nueva clave de Administrador contra la iLO:

<RIBCL VERSION="2.0">
<LOGIN USER_LOGIN="adminname" PASSWORD="password">
<USER_INFO MODE="write">
<MOD_USER USER_LOGIN="Administrator">
<PASSWORD value="aqui_la_clave"/>
</MOD_USER>
</USER_INFO>
</LOGIN>
</RIBCL>

No es necesario especificar el usuario admin y su clave actual, eso lo dejamos tal y como está. Únicamente cambiamos el valor PASSWORD aqui_la_clave. Una vez modificado el XML lo ejecutamos contra la iLO:

# hponcfg -f resetpass.xml

Ya deberíais poder acceder a la iLO con los nuevos datos.

Cambiar parámetros de red HP iLO desde Linux


Seguimos repasando algunas de las posibilidades que nos ofrece hponcfg, utilidad que permite cambiar desde el sistema operativo GNU/Linux la configuración de la iLO (Integrated Lights-Out) de servidores HP Proliant.

En este caso vamos a ver como modificar los parámetros de red (IP, máscara, puerta de enlace, etc) que se utilizan para posteriormente acceder a la web de gestión iLO.

Seguimos utilizando los ejemplos en formato XML de HP Lights-Out XML PERL Scripting Sample for Linux. A continuación el utilizado para realizar modificaciones en los parámetros de red:

<!--         RIBCL Sample Script for HP Lights-Out Products          -->
<!--Copyright (c) 2003,2010 Hewlett-Packard Development Company, L.P.-->
<!-- Description:  This is a sample XML script to configure the      -->
<!--               network settings for following devices:           -->
<!--                 Integrated Lights-Out 3 (iLO 3)                 -->
<!--                 Integrated Lights-Out 2 (iLO 2)                 -->
<!--                 Integrated Lights-Out (iLO)                     -->
<!--                 Remote Insight Lights-Out Edition II (RILOE II) -->
<!-- NOTE:  You will need to replace the USER_LOGIN and PASSWORD     -->
<!--        and other values inside the quotation marks with values  -->
<!--        that are appropriate for your environment.               -->
<!--        Double check all values before executing this script.    -->
<!--        Incorrect or mismatched network settings may cause you   -->
<!--        to lose the ability to connect to your Lights-Out device.-->
<!--        Use CPQLOCFG.EXE ver 2.26 or greater with this script.   -->
<!--        This script was written for iLO 3 firmware version 1.00  -->
<!--        release.                                                 -->
<!--        See "HP Integrated Lights-Out Management Processor       -->
<!--        Scripting and Command Line Resource Guide" for more      -->
<!--        information on scripting and the syntax of the RIBCL     -->
<!--        XML.                                                     -->
<!--        Firmware support infomation for this script:             -->
<!--            iLO 3 - All versions.                                -->
<!--            iLO 2 - All versions.                                -->
<!--              iLO - All versions.                                -->
<!--         RILOE II - All versions.                                -->
<RIBCL VERSION="2.0">
<LOGIN USER_LOGIN="adminname" PASSWORD="password">
<RIB_INFO MODE="write">
<MOD_NETWORK_SETTINGS>
<!--        Firmware support infomation for next 4 tags :      -->
<!--            iLO 3 - All versions.                          -->
<!--            iLO 2 - All versions.                          -->
<!--              iLO - All versions.                          -->
<!--         RILOE II - None.                                  -->
<ENABLE_NIC value="Yes"/>
<REG_DDNS_SERVER value="Yes"/>
<PING_GATEWAY value="No"/>
<DHCP_DOMAIN_NAME value="Yes"/>
<!--        Firmware support infomation for next 22 tags :     -->
<!--            iLO 3 - All versions.                          -->
<!--            iLO 2 - All versions.                          -->
<!--              iLO - All versions.                          -->
<!--         RILOE II - All versions.                          -->
<SPEED_AUTOSELECT value="YES"/>
<NIC_SPEED value="100"/>
<FULL_DUPLEX value="Yes"/>
<DHCP_ENABLE value="No"/>
<IP_ADDRESS value="172.20.60.152"/>
<SUBNET_MASK value="255.255.255.0"/>
<GATEWAY_IP_ADDRESS value="172.20.60.1"/>
<DNS_NAME value="demoilo"/>
<DOMAIN_NAME value="internal.com"/>
<DHCP_GATEWAY value="Yes"/>
<DHCP_DNS_SERVER value="Yes"/>
<DHCP_WINS_SERVER value="Yes"/>
<DHCP_STATIC_ROUTE value="Yes"/>
<REG_WINS_SERVER value="Yes"/>
<PRIM_DNS_SERVER value="0.0.0.0"/>
<SEC_DNS_SERVER value="0.0.0.0"/>
<TER_DNS_SERVER value="0.0.0.0"/>
<PRIM_WINS_SERVER value="0.0.0.0"/>
<SEC_WINS_SERVER value="0.0.0.0"/>
<STATIC_ROUTE_1 DEST="0.0.0.0" GATEWAY="0.0.0.0"/>
<STATIC_ROUTE_2 DEST="0.0.0.0" GATEWAY="0.0.0.0"/>
<STATIC_ROUTE_3 DEST="0.0.0.0" GATEWAY="0.0.0.0"/>
<!--        Firmware support infomation for next 4 tags :      -->
<!--            iLO 3 - All versions.                          -->
<!--            iLO 2 - None.                                  -->
<!--              iLO - None.                                  -->
<!--         RILOE II - None.                                  -->
<DHCP_SNTP_SETTINGS value="Yes"/>
<SNTP_SERVER1 value="0.0.0.0"/>
<SNTP_SERVER2 value="0.0.0.0"/>
<TIMEZONE value="America/Anchorage"/>
<!-- This tag can be used on an iLO blade server to force iLO  -->
<!-- to attempt to get an IP address from the signal backplane -->
<!-- in a server enclosure.  The IP address must be set prior  -->
<!-- with Mod_Enc_Bay_IP_Settings.xml                          -->
<!--        Firmware support infomation for next tag:          -->
<!--            iLO 3 - All versions.                          -->
<!--            iLO 2 - All versions.                          -->
<!--              iLO - All versions.                          -->
<!--         RILOE II - None.                                  -->
<!--
<ENCLOSURE_IP_ENABLE VALUE="Yes"/>
-->
<!--        Firmware support infomation for next tag:          -->
<!--            iLO 3 - None.                                  -->
<!--            iLO 2 - None.                                  -->
<!--              iLO - None.                                  -->
<!--         RILOE II - All versions.                          -->
<!--
<WEB_AGENT_IP_ADDRESS value="192.168.0.1"/>
-->
</MOD_NETWORK_SETTINGS>
</RIB_INFO>
</LOGIN>
</RIBCL>

En este XML tenemos que modificar primero los datos de conexión como administrador USER_LOGIN y PASSWORD y posteriormente a los parámetros que cada uno necesitemos modificar (IP_ADDRESS, SUBNET_MASK, GATEWAY_IP_ADDRESS…).

Si únicamente necesitáis cambiar los valores básicos, ahí va un script reducido y más fácil de entender:

<RIBCL VERSION="2.0">
<LOGIN USER_LOGIN="xxxxxxxx" PASSWORD="xxxxxxx">
<RIB_INFO MODE="WRITE" >
<MOD_NETWORK_SETTINGS>
<IP_ADDRESS VALUE = "192.168.0.100"/>
<SUBNET_MASK VALUE = "255.255.255.0"/>
<GATEWAY_IP_ADDRESS VALUE = "192.168.0.1"/>
<PRIM_DNS_SERVER value = "192.168.0.222"/>
<DHCP_ENABLE VALUE = "N"/>
</MOD_NETWORK_SETTINGS>
</RIB_INFO>
</LOGIN>
</RIBCL>

Una vez modificado todo el script a conveniencia lo ejecutamos contra la aplicación:

# hponcfg -f cambio-red.xml

Si en la salida de ejecución del comando recibimos “Script succeeded” el cambio debería haber funcionado y ya podríamos acceder con los nuevos datos.

Cambiar password de HP iLO desde Linux


Hponcfg es una utilidad que forma parte del HP Proliant Support Pack y que nos permite gestionar desde el sistema operativo todos los parámetros de iLO (Integrated Lights-Out) de servidores HP Proliant. Una vez descargado simplemente se instala como cualquier rpm:

#rpm -i hponcfg-3.0.0-0.noarch.rpm

Hoy vamos a ver como modificar la clave de acceso a la interfaz web de gestión de iLO sin tener que reiniciar el sistema y hacerlo en el arranque.

HP nos ofrece una serie de scripts en formato XML de ejemplo (HP Lights-Out XML PERL Scripting Sample for Linux) que podemos utilizar para realizar todas estas labores. Iré mostrando estos días los que me parecen más interesantes.

Para cambiar la clave de un usuario de acceso a iLO utilizaremos el siguiente script XML:

<!--         RIBCL Sample Script for HP Lights-Out Products          -->
<!--Copyright (c) 2003,2010 Hewlett-Packard Development Company, L.P.-->
<!-- Description:  This is a sample XML script to change a user's    -->
<!--               password in the database of local users on        -->
<!--               following devices:                                -->
<!--                 Integrated Lights-Out 3 (iLO 3)                 -->
<!--                 Integrated Lights-Out 2 (iLO 2)                 -->
<!--                 Integrated Lights-Out (iLO)                     -->
<!--                 Remote Insight Lights-Out Edition II (RILOE II) -->
<!-- NOTE:  You will need to replace the values inside the quote     -->
<!--        marks with values that are appropriate for your          -->
<!--        environment.                                             -->
<!--        Use CPQLOCFG.EXE ver 2.26 or greater with this script    -->
<!--        This script was written for iLO 3 firmware version 1.00. -->
<!--        release.                                                 -->
<!--        See "HP Integrated Lights-Out Management Processor       -->
<!--        Scripting and Command Line Resource Guide" for more      -->
<!--        information on scripting and the syntax of the RIBCL     -->
<!--        XML.                                                     -->
<!--        Firmware support infomation for this script:             -->
<!--            iLO 3 - All versions.                                -->
<!--            iLO 2 - All versions.                                -->
<!--              iLO - All versions.                                -->
<!--         RILOE II - All versions.                                -->
<RIBCL VERSION="2.0">
<LOGIN USER_LOGIN="adminname" PASSWORD="password">
<USER_INFO MODE="write">
<MOD_USER USER_LOGIN="username">
<PASSWORD value="newpassword"/>
</MOD_USER>
</USER_INFO>
</LOGIN>
</RIBCL>

Como véis es bastante sencillo, solo tenemos que especificar los datos de acceso del usuario administrador actual y posteriormente elegir los nuevos datos del usuario a modificar. Finalmente ejecutamos el script del siguiente modo:

# hponcfg -f cambio-clave.xml

Si en la salida de ejecución del comando recibimos “Script succeeded” el cambio debería haber funcionado y ya podríamos acceder con los nuevos datos.

HP proliant server: actualizar Firmware iLO 2


Tarde o temprano es necesario actualizar el firmware de las iLO (Integrated Lights-Out) para servidores HP ProLiant, tanto por corrección de bugs y fallos en el sistema como por mejoras y actualizaciones. A continuación os indico el proceso de actualización:

  1. Acceder al sitio web de HP y buscar los correspondientes drivers, la URL es la siguiente:

    http://welcome.hp.com/country/us/en/support.html?pageDisplay=drivers

  2. En el cuadro de búsqueda introducir iLO 2.
  3. Pinchar en HP Integrated Lights-Out 2 (iLO 2) Firmware
  4. Seleccionar la versión del sistema operativo.
  5. Pinchar en Firmware – Lights-Out Management
  6. Localizar la versión deseada y descargarla.

Una vez descargada, hay dos formas (que yo conozca) de actualizar el firmware. Os voy a explicar la que yo utilizo. La otra forma probablemente sería simplemente ejecutar el fichero que descargamos en el servidor correspondiente.

Yo lo que hago es extraer el contenido el fichero que descargamos (un fichero .EXE, por ejemplo cp009856.exe) en una carpeta. Esta extracción contiene un fichero .bin (por ejemplo ilo2_170.bin), que es la imagen del firmware Online ROM Flash Component for HP Integrated Lights-Out 2.

Una vez que tenemos dicho fichero, simplemente tenemos que accedeer a la iLO del servidor, e instalarla desde la sección de administración, donde te indican cada uno de los pasos a seguir:

  1. Update iLO 2 firmware as follows. For alternatives, consult the help page.
  2. Obtain the firmware image (.bin) file from the Online ROM Flash Component for HP Integrated Lights-Out 2. Use the Extract option to save the .bin file.
  3. The latest component can be downloaded from http://www.hp.com/support/ilo2.
  4. This component is also available on the HP ProLiant Firmware Maintenance CD.
  5. Specify the location of the firmware, or use the Browse button to locate it. Example: C:\ilo2_yyy.bin
  6. Send the data to iLO 2. Press Enter or click the Send firmware image button after the file has been specified.
  7. The firmware is received by iLO 2.
  8. iLO 2 validates the firmware image. This step prevents corrupt or invalid firmware from being installed.
  9. iLO 2 flashes the firmware image. This step may take a few minutes. During the flash step, iLO 2 is unresponsive. Do not power cycle the server while iLO 2 firmware is being programmed.
  10. iLO 2 resets. Resume normal use of iLO 2 with updated firmware after 60 seconds.
iLO2 administration