Qué vas a conseguir
Que el SAI de la sala avise, se pruebe solo y apague los servidores en orden sin que nadie tenga que estar delante. La guía de SAI de la sala de comunicaciones explica el dimensionado, la doble alimentación, las pruebas anuales y el orden de apagado; esta es la parte práctica en un APC Smart-UPS con Network Management Card 3 (NMC 3): la tarjeta, los avisos y PowerChute.
Antes de empezar
- El modelo del SAI y de la tarjeta (en la etiqueta de la tarjeta; las NMC 3 son las AP9640, AP9641 y AP9643) y su MAC, para reservar la IP.
- Una IP fija en la VLAN de gestión, con su nombre en DNS (
sai-cr1-a.mgmt.contoso.local). - Un relé SMTP interno que acepte correo desde la red de gestión y una lista de distribución de guardia (
sai-alertas@contoso.local). - Para el apagado: las IP de los servidores y del vCenter, y el orden de apagado acordado.
1. La tarjeta en la red
La NMC 3 arranca por DHCP de fábrica. Dos formas de dejarle una IP fija:
- Reserva en DHCP con la MAC de la tarjeta, o
- Por el puerto de consola micro-USB de la tarjeta, con PuTTY o similar, y la CLI:
boot -b manualtcpip -i 10.10.90.41 -s 255.255.255.0 -g 10.10.90.1 -h sai-cr1-arebootLa herramienta Device IP Configuration Wizard del fabricante hace lo mismo por red con varias tarjetas a la vez.
El primer acceso es por HTTPS (HTTP viene desactivado) con el usuario apc y contraseña apc, y la tarjeta obliga a cambiarla en ese momento. Después, la hora: en Configuration › General › Date/Time, modo NTP contra los servidores de la sede. En Configuration › Network › DNS, los servidores DNS de la sede: sin ellos, la tarjeta no resuelve el nombre del relé de correo. Sin hora correcta, el registro de eventos no sirve para reconstruir un corte.
2. Usuarios
apces el Super User: no se puede borrar ni renombrar. Su contraseña nueva va al gestor de contraseñas como cuenta de emergencia.- Para el día a día, cuentas con nombre en Configuration › Security › Local Users › Management: administradores con rol Administrator y la monitorización con Read-Only. Las cuentas de esos roles vienen desactivadas hasta que se cambia la contraseña de
apc. - Si hay RADIUS, en Configuration › Security › Remote Users la autenticación remota con la local como respaldo: una baja en el directorio quita el acceso a todos los SAI.
3. Avisos por correo
En Configuration › Notification › E-mail:
- Recipients: la lista de guardia, no buzones de personas. Una persona se va de vacaciones o de la empresa; la lista sigue.
- En Event Actions (por evento o por grupo de gravedad), comprueba que los eventos que importan tienen marcada la casilla de correo: en batería, batería baja, fallo del autotest, sustituir batería, sobrecarga y bypass.
- Test: el envío de prueba desde la propia tarjeta. Si no llega, el resto de esta sección no sirve de nada.
El correo no basta como único canal. Los avisos de "en batería" y "batería baja" también tienen que llegar a la monitorización y, de ahí, al teléfono de guardia.
4. SNMP y traps
En la NMC 3, SNMPv1 y SNMPv3 vienen desactivados. Para la monitorización, solo SNMPv3:
- Configuration › Network › SNMPv3 › User Profiles: un usuario con autenticación SHA y cifrado AES.
- Configuration › Network › SNMPv3 › Access Control: ese usuario, solo desde la IP del servidor de monitorización.
- Configuration › Notification › SNMP Traps › Trap Receivers: el servidor de monitorización como receptor, con el mismo usuario SNMPv3. Envía un trap de prueba y comprueba que llega.
Los OID del MIB estándar de SAI y cómo consultarlos están en la guía de SAI de la sala de comunicaciones. Añade en la monitorización una alerta de tarjeta sin respuesta: si no se la ve, tampoco se verá un corte.
5. Autotest y fecha de las baterías
- Autotest programado en UPS › Configuration › Self-Test Schedule. Las opciones dependen del modelo; una vez cada dos semanas, o al menos una al mes, es lo habitual. El SAI pasa unos segundos a batería: si una batería está mal, el SAI lo detecta con carga real y lo registra.
- El resultado queda en el registro de eventos (UPS: Passed a self-test o un fallo con su motivo) y, si el evento tiene acción de correo, llega a la lista.
- Fecha de la última sustitución de baterías: en la configuración general del SAI, el campo Last Battery Replacement (mes y año). Al cambiar las baterías, se actualiza el mismo día. El estado de baterías (Battery System) muestra la fecha estimada de la siguiente sustitución.
Una fecha de baterías sin actualizar hace que el SAI calcule mal cuándo hay que cambiarlas, y que el inventario diga que unas baterías de cinco años son nuevas.
6. Apagado ordenado con PowerChute Network Shutdown
PowerChute Network Shutdown (PCNS) es el agente que escucha a la tarjeta y apaga el equipo donde está instalado. Va en cada servidor físico (Windows o Linux) o, en vSphere, como dispositivo virtual que apaga las máquinas virtuales, el vCenter y los hosts en el orden configurado.
En la tarjeta, UPS › Configuration › PowerChute:
- La frase de autenticación (authentication phrase), vacía de fábrica y obligatoria para que PowerChute pueda registrarse.
- La lista de clientes: la IP de cada servidor o dispositivo virtual de PowerChute (hasta 50 por tarjeta). PowerChute también se añade solo al registrarse.
- El protocolo, HTTPS si tu versión de PowerChute lo admite.
En PowerChute, la consola web en https://<servidor>:6547. El asistente pide la IP de la tarjeta, el usuario y la frase de autenticación. Entre servidor y tarjeta tienen que estar abiertos TCP 80 o 443, 3052 y 6547 y UDP 3052.
- En Configure Events, el evento UPS On Battery con Shutdown activado y cuántos segundos en batería esperar antes de empezar. El tiempo se fija con la autonomía medida y lo que tarda el apagado completo, no con la del catálogo.
- En los ajustes de virtualización: qué máquinas virtuales se apagan primero, cuánto se les deja para apagarse, si el vCenter es una máquina virtual (va casi al final) y después el host.
- El evento Available runtime has been exceeded avisa de que el apagado configurado dura más que la batería que queda: hay que reducir tiempos o carga.
- En la tarjeta, UPS › Configuration › Shutdown tiene el Low Battery Duration: los minutos que quedan cuando el SAI declara batería baja. Tiene que ser mayor que lo que tarda PowerChute en terminar.
7. El ticket: "el SAI estuvo en batería anoche y no le llegó un correo a nadie"
Jueves, 8:00. El vigilante comenta que anoche se fue la luz en el edificio "un rato". En la sala todo está encendido, pero nadie recibió nada.
- Qué pasó: en Logs › Events › Log de la tarjeta.
Diecisiete minutos en batería. PowerChute tenía el apagado a los 20 minutos: la vuelta de la luz llegó tres minutos antes de que se apagaran los servidores, y nadie lo sabía.
- Por qué no llegó el correo. Desde la propia tarjeta, E-mail › Test. Si falla, por orden:
| Comprobación | Lo que se suele encontrar |
|---|---|
| Servidor SMTP de la tarjeta | Apunta a un relé antiguo que se dio de baja al migrar el correo |
| DNS de la tarjeta | Sin servidor DNS: el nombre del relé no se resuelve |
| Cortafuegos | La VLAN de gestión no tiene permitido el puerto 25 o 587 hacia el relé |
| Relé | Solo acepta correo de IP autorizadas, y la de la tarjeta no está |
| Destinatarios y Event Actions | El destinatario está desactivado o el evento no tiene marcada la acción de correo |
Aquí era el primero: la tarjeta seguía apuntando al relé de antes de la migración. Se cambia al relé actual, se da de alta la IP de la tarjeta en él y se repite el test hasta que llega.
- Por qué no avisó la monitorización: los traps estaban configurados con SNMPv1, que la tarjeta tenía desactivado. Se pasa a SNMPv3 como en el paso 4 y se envía un trap de prueba.
- Las baterías: tras 17 minutos de descarga, comprueba la carga en el estado de baterías antes de dar el ticket por cerrado. Hasta que se recupere, un segundo corte tiene menos autonomía.
- El edificio: pregunta a mantenimiento por qué se cortó y si el grupo electrógeno arrancó. Si la sala estuvo 17 minutos en batería, el grupo no entró o no cubre esa línea.
En el ticket: hora de inicio y fin del corte, la causa de que no llegaran los avisos, los cambios en la tarjeta y la monitorización, la prueba de correo y de trap recibidas y la pregunta abierta con mantenimiento. Para que no se repita en silencio, una prueba de correo y de trap de cada SAI entra en la revisión mensual.
Siguientes pasos
- La guía de SAI de la sala de comunicaciones cubre la prueba anual con el mantenedor y el orden de apagado por capas.
- La de monitorización 24x7 explica cómo hacer que un aviso llegue a una persona y no solo a un buzón.
- La de VMware vSphere y vCenter, para el arranque de hosts y máquinas virtuales cuando vuelve la luz.
¿Falta algo o en tu entorno es distinto? Escríbeme y lo corrijo.
What you'll get
A comms room UPS that raises alerts, tests itself and shuts the servers down in order without anyone having to be there. The comms room UPS guide explains sizing, dual power, annual tests and the shutdown order; this is the hands-on part on an APC Smart-UPS with a Network Management Card 3 (NMC 3): the card, the alerts and PowerChute.
Before you start
- The UPS and card model (on the card's label; the NMC 3 cards are the AP9640, AP9641 and AP9643) and its MAC, to reserve the IP.
- A fixed IP on the management VLAN, with its name in DNS (
ups-cr1-a.mgmt.contoso.local). - An internal SMTP relay that accepts mail from the management network and an on-call distribution list (
ups-alerts@contoso.local). - For the shutdown: the IPs of the servers and the vCenter, and the agreed shutdown order.
1. The card on the network
The NMC 3 boots with DHCP out of the box. Two ways to give it a fixed IP:
- A DHCP reservation with the card's MAC, or
- Through the card's micro-USB console port, with PuTTY or similar, and the CLI:
boot -b manualtcpip -i 10.10.90.41 -s 255.255.255.0 -g 10.10.90.1 -h ups-cr1-arebootThe vendor's Device IP Configuration Wizard tool does the same over the network for several cards at once.
First access is over HTTPS (HTTP comes disabled) with user apc and password apc, and the card forces you to change it there and then. Next, the time: under Configuration › General › Date/Time, NTP mode against the site's servers. Under Configuration › Network › DNS, the site's DNS servers: without them, the card can't resolve the mail relay's name. Without the right time, the event log is useless for reconstructing an outage.
2. Users
apcis the Super User: it cannot be deleted or renamed. Its new password goes into the password manager as the emergency account.- For day-to-day work, named accounts under Configuration › Security › Local Users › Management: administrators with the Administrator role and monitoring with Read-Only. Accounts with those roles stay disabled until the
apcpassword is changed. - If there is RADIUS, under Configuration › Security › Remote Users remote authentication with local as fallback: a leaver in the directory loses access to every UPS.
3. Email alerts
Under Configuration › Notification › E-mail:
- Recipients: the on-call list, not personal mailboxes. A person goes on holiday or leaves; the list stays.
- Under Event Actions (by event or by severity group), check that the events that matter have the email box ticked: on battery, low battery, self-test failed, replace battery, overload and bypass.
- Test: the test send from the card itself. If it doesn't arrive, the rest of this section is worth nothing.
Email is not enough as the only channel. "On battery" and "low battery" alerts also have to reach monitoring and, from there, the on-call phone.
4. SNMP and traps
On the NMC 3, SNMPv1 and SNMPv3 come disabled. For monitoring, SNMPv3 only:
- Configuration › Network › SNMPv3 › User Profiles: a user with SHA authentication and AES encryption.
- Configuration › Network › SNMPv3 › Access Control: that user, only from the monitoring server's IP.
- Configuration › Notification › SNMP Traps › Trap Receivers: the monitoring server as receiver, with the same SNMPv3 user. Send a test trap and check it arrives.
The standard UPS MIB OIDs and how to query them are in the comms room UPS guide. Add a card not responding alert in monitoring: if the card can't be seen, an outage won't be seen either.
5. Self-test and battery date
- Scheduled self-test under UPS › Configuration › Self-Test Schedule. The options depend on the model; once every two weeks, or at least once a month, is usual. The UPS goes to battery for a few seconds: if a battery is bad, the UPS detects it under real load and logs it.
- The result goes into the event log (UPS: Passed a self-test or a failure with its reason) and, if the event has an email action, reaches the list.
- Last battery replacement date: in the UPS's general configuration, the Last Battery Replacement field (month and year). When the batteries are replaced, it is updated the same day. The battery status (Battery System) shows the estimated date of the next replacement.
A battery date that isn't updated makes the UPS miscalculate when they need replacing, and makes the inventory say five-year-old batteries are new.
6. Orderly shutdown with PowerChute Network Shutdown
PowerChute Network Shutdown (PCNS) is the agent that listens to the card and shuts down the machine it is installed on. It goes on each physical server (Windows or Linux) or, on vSphere, as a virtual appliance that shuts down the virtual machines, the vCenter and the hosts in the configured order.
On the card, UPS › Configuration › PowerChute:
- The authentication phrase, empty out of the box and required before PowerChute can register.
- The client list: the IP of each PowerChute server or virtual appliance (up to 50 per card). PowerChute also adds itself when it registers.
- The protocol, HTTPS if your PowerChute version supports it.
In PowerChute, the web console at https://<server>:6547. The wizard asks for the card's IP, the user and the authentication phrase. Between server and card, TCP 80 or 443, 3052 and 6547 and UDP 3052 have to be open.
- Under Configure Events, the UPS On Battery event with Shutdown enabled and how many seconds on battery to wait before starting. The time is set from measured runtime and how long the complete shutdown takes, not the catalogue figure.
- In the virtualisation settings: which virtual machines shut down first, how long they get to shut down, whether the vCenter is a virtual machine (it goes near the end) and then the host.
- The Available runtime has been exceeded event warns that the configured shutdown takes longer than the battery that is left: cut times or load.
- On the card, UPS › Configuration › Shutdown holds the Low Battery Duration: the minutes left when the UPS declares low battery. It has to be longer than PowerChute needs to finish.
7. The ticket: "the UPS ran on battery last night and nobody got an email"
Thursday, 8:00. The security guard mentions the building lost power "for a while" last night. Everything in the room is on, but nobody received anything.
- What happened: under Logs › Events › Log on the card.
Seventeen minutes on battery. PowerChute had shutdown set at 20 minutes: power came back three minutes before the servers would have gone down, and nobody knew.
- Why the email didn't arrive. From the card itself, E-mail › Test. If it fails, in order:
| Check | What you usually find |
|---|---|
| The card's SMTP server | It points at an old relay that was retired when mail was migrated |
| The card's DNS | No DNS server: the relay's name doesn't resolve |
| Firewall | The management VLAN isn't allowed port 25 or 587 to the relay |
| Relay | It only accepts mail from authorised IPs, and the card's isn't one of them |
| Recipients and Event Actions | The recipient is disabled or the event doesn't have the email action ticked |
Here it was the first one: the card still pointed at the pre-migration relay. It is changed to the current relay, the card's IP is authorised on it, and the test is repeated until it arrives.
- Why monitoring didn't alert: the traps were configured with SNMPv1, which the card had disabled. It moves to SNMPv3 as in step 4 and a test trap is sent.
- The batteries: after 17 minutes of discharge, check the charge in the battery status before closing the ticket. Until it recovers, a second outage has less runtime.
- The building: ask maintenance why the power was cut and whether the generator started. If the room spent 17 minutes on battery, the generator didn't come in or doesn't cover that line.
In the ticket: outage start and end times, the reason the alerts didn't arrive, the changes on the card and in monitoring, the test email and test trap received, and the open question with maintenance. So it can't happen silently again, a test email and test trap from every UPS goes into the monthly review.
Next steps
- The comms room UPS guide covers the annual test with the maintainer and the layered shutdown order.
- The 24x7 monitoring guide explains how to make an alert reach a person and not just a mailbox.
- The VMware vSphere and vCenter guide, for bringing hosts and virtual machines back when power returns.
Is something missing, or different in your environment? Get in touch and I'll fix it.
Tech Career Lab · newsletter
¿Te ha servido? Cada dos semanas envío una idea práctica para perfiles IT: LinkedIn, proyectos, networking y procesos de selección.Found this useful? Every two weeks I send one practical idea for IT professionals: LinkedIn, projects, networking and hiring processes.
Apúntate y llévate las 33 ideasSign up and get the 33 ideas →