Next: , Previous: , Up: Servicios   [Contents][Index]


11.10.28 Servicios de gestión de energía

Power Profiles Daemon

The (gnu services pm) module provides a Guix service definition for the Linux Power Profiles Daemon, which makes power profiles handling available over D-Bus.

The available profiles consist of the default ‘balanced’ mode, a ‘power-saver’ mode and on supported systems a ‘performance’ mode.

Importante: The power-profiles-daemon conflicts with other power management tools like tlp. Using both together is not recommended.

Variable: power-profiles-daemon-service-type

This is the service type for the Power Profiles Daemon. The value for this service is a power-profiles-daemon-configuration.

To enable the Power Profiles Daemon with default configuration add this line to your services:

Data Type: power-profiles-daemon-configuration

Data type representing the configuration of power-profiles-daemon-service-type.

power-profiles-daemon (default: power-profiles-daemon) (type: file-like)

Package object of power-profiles-daemon.

Daemon TLP

El módulo (gnu services pm) proporciona una definición de servicio Guix para la herramienta de gestión de energía de Linux TLP.

TLP activa varios modos de ahorro de energía en el núcleo y en espacio de usuaria. Al contrario que upower-service, no es una herramienta de monitorización pasiva, puesto que aplicará una nueva configuración personalizada cada vez que se detecte una nueva fuente de energía/alimentación. Puede encontrar más información en la página de TLP.

Variable: tlp-service-type

EL tipo de servicio para la herramienta TLP. La configuración predeterminada está optimizada para la vida de la batería en la mayoría de los sistemas, pero puede modificarla al completo con las opciones que desee proporcionando un objeto tlp-configuration válido:

(service tlp-service-type
         (tlp-configuration
          (cpu-scaling-governor-on-ac (list "performance"))
          (sched-powersave-on-bat? #t)))

Each parameter definition is preceded by its type; for example, ‘boolean foo’ indicates that the foo parameter should be specified as a boolean. Types starting with maybe- denote parameters that won’t show up in TLP config file when their value is left unset, or is explicitly set to the %unset-value value.

Los campos disponibles de tlp-configuration son:

parámetro de tlp-configuration: package tlp

El paquete TLP.

parámetro de tlp-configuration: boolean tlp-enable?

Proporcione un valor verdadero si desea activar TLP.

El valor predeterminado es ‘#t

parámetro de tlp-configuration: string tlp-default-mode

Modo predeterminado cuando no se puede detectar una fuente de alimentación. Las alternativas son AC (corriente alterna) y BAT (batería).

El valor predeterminado es ‘"AC"’ (corriente alterna).

parámetro de tlp-configuration: entero-no-negativo disk-idle-secs-on-ac

Número de segundos que el núcleo Linux debe esperar desde que el disco se queda en espera, antes de sincronizar en corriente alterna (AC).

El valor predeterminado es ‘0’.

parámetro de tlp-configuration: entero-no-negativo disk-idle-secs-on-bat

Igual que disk-idle-ac pero en modo BAT (batería).

El valor predeterminado es ‘2’.

parámetro de tlp-configuration: entero-no-negativo max-lost-work-secs-on-ac

Periodicidad de la evacuación de las páginas sucias, expresada en segundos.

El valor predeterminado es ‘15’.

parámetro de tlp-configuration: entero-no-negativo max-lost-work-secs-on-bat

Igual que max-lost-work-secs-on-ac pero en modo BAT (batería).

El valor predeterminado es ‘60’.

parámetro de tlp-configuration: maybe-lista-cadena-separada-espacios cpu-scaling-governor-on-ac

Gobernador de escalado de frecuencia del procesador en modo de corriente alterna (AC). Con el controlador intel_pstate, las alternativas son “powersave” (ahorro de energía) y “performance” (rendimiento). Con el controlador acpi-cpufreq, las alternativas son “ondemand” (bajo demanda), “powersave”, “performance” y “conservative” (conservativo).

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-lista-cadena-separada-espacios cpu-scaling-governor-on-bat

Igual que max-lost-work-secs-on-ac pero en modo BAT (batería).

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-entero-no-negativo cpu-scaling-min-freq-on-ac

Establece la frecuencia mínima disponible para el controlador de escalado en AC.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-entero-no-negativo cpu-scaling-max-freq-on-ac

Establece la frecuencia máxima disponible para el controlador de escalado en AC.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-entero-no-negativo cpu-scaling-min-freq-on-bat

Establece la frecuencia mínima disponible para el controlador de escalado en BAT.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-entero-no-negativo cpu-scaling-max-freq-on-bat

Establece la frecuencia máxima disponible para el controlador de escalado en BAT.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-entero-no-negativo cpu-min-perf-on-ac

Limita el estado-P mínimo para controlar la disipación de potencia del procesador en modo AC. Los valores se indican como un porcentaje de rendimiento disponible.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-entero-no-negativo cpu-max-perf-on-ac

Limita el estado-P máximo para controlar la disipación de potencia del procesador en modo AC. Los valores se indican como un porcentaje de rendimiento disponible.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-entero-no-negativo cpu-min-perf-on-bat

Igual que cpu-min-perf-on-ac pero en modo BAT (batería).

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-entero-no-negativo cpu-max-perf-on-bat

Igual que cpu-max-perf-on-ac pero en modo BAT (batería).

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-boolean cpu-boost-on-ac?

Activa la característica “turbo boost” del procesador en modo AC (corriente alterna).

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-boolean cpu-boost-on-bat?

Igual que cpu-boost-on-ac pero en modo BAT (batería).

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: boolean sched-powersave-on-ac?

Permite al núcleo Linux minimizar el número de núcleos/hyper-thread del procesador usados bajo condiciones de baja carga.

El valor predeterminado es ‘#f

parámetro de tlp-configuration: boolean sched-powersave-on-bat?

Igual que sched-powersave-on-ac? pero en modo BAT (batería).

El valor predeterminado es ‘#t

parámetro de tlp-configuration: boolean nmi-watchdog?

Activa el proceso guardián (watchdog) NMI del núcleo Linux.

El valor predeterminado es ‘#f

parámetro de tlp-configuration: maybe-string phc-controls

Para núcleos Linux con el parche PHC aplicado, cambia los voltajes del procesador. Un valor de ejemplo sería ‘"F:V F:V F:V F:V"’.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: string energy-perf-policy-on-ac

Set CPU performance versus energy saving policy on AC. Alternatives are performance, normal, powersave.

El valor predeterminado es ‘"performance"’.

parámetro de tlp-configuration: string energy-perf-policy-on-bat

Igual que energy-perf-policy-ac pero en modo BAT (batería).

El valor predeterminado es ‘"powersave"’.

parámetro de tlp-configuration: lista-cadena-separada-espacios disks-devices

Dispositivos de disco duro.

parámetro de tlp-configuration: lista-cadena-separada-espacios disk-apm-level-on-ac

Nivel de APM (gestión avanzada de energía) del disco duro.

parámetro de tlp-configuration: lista-cadena-separada-espacios disk-apm-level-on-bat

Igual que disk-apm-bat pero en modo BAT (batería).

parámetro de tlp-configuration: maybe-lista-cadena-separada-espacios disk-spindown-timeout-on-ac

Plazo para la parada rotacional del disco duro. Se debe especificar un valor por cada disco duro declarado.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-lista-cadena-separada-espacios disk-spindown-timeout-on-bat

Igual que disk-spindown-timeout-on-ac pero en modo BAT (batería).

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-lista-cadena-separada-espacios disk-iosched

Selecciona el planificador de E/S para dispositivos de disco. Se debe especificar un valor por cada disco duro declarado. Ejemplos de alternativas son “cfq”, “deadline” y “noop”.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: string sata-linkpwr-on-ac

Nivel de gestión agresiva de energía del enlace (ALPM) de SATA. Las alternativas son “min_power” (energía mínima), “medium_power” (energía media) y “max_performance” (máximo rendimiento).

El valor predeterminado es ‘"max_performance"’.

parámetro de tlp-configuration: string sata-linkpwr-on-bat

Igual que sata-linkpwr-ac pero en modo BAT (batería).

El valor predeterminado es ‘"min_power"’.

parámetro de tlp-configuration: maybe-string sata-linkpwr-blacklist

Excluye los dispositivos SATA especificados de la gestión de energía del enlace.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-on-off-boolean ahci-runtime-pm-on-ac?

Activa la gestión de energía de tiempo de ejecución para controladores AHCI y discos en modo AC.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-on-off-boolean ahci-runtime-pm-on-bat?

Igual que ahci-runtime-pm-on-ac pero en modo BAT (batería).

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: entero-no-negativo ahci-runtime-pm-timeout

Segundos de inactividad antes de suspender el disco.

El valor predeterminado es ‘15’.

parámetro de tlp-configuration: string pcie-aspm-on-ac

Nivel de gestión de energía de estado activo de PCI Express. Las alternativas son “default” (predeterminado), “performance” (rendimiento) y “powersave” (ahorro de energía).

El valor predeterminado es ‘"performance"’.

parámetro de tlp-configuration: string pcie-aspm-on-bat

Igual que pcie-aspm-ac pero en modo BAT (batería).

El valor predeterminado es ‘"powersave"’.

tlp-configuration parameter: maybe-non-negative-integer start-charge-thresh-bat0

Percentage when battery 0 should begin charging. Only supported on some laptops.

El valor predeterminado es ‘disabled’.

tlp-configuration parameter: maybe-non-negative-integer stop-charge-thresh-bat0

Percentage when battery 0 should stop charging. Only supported on some laptops.

El valor predeterminado es ‘disabled’.

tlp-configuration parameter: maybe-non-negative-integer start-charge-thresh-bat1

Percentage when battery 1 should begin charging. Only supported on some laptops.

El valor predeterminado es ‘disabled’.

tlp-configuration parameter: maybe-non-negative-integer stop-charge-thresh-bat1

Percentage when battery 1 should stop charging. Only supported on some laptops.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: string radeon-power-profile-on-ac

Nivel de velocidad de reloj de gráficos Radeon. Las alternativas son “low” (bajo), “mid” (medio), “high” (alto), “auto” (automático) y “default” (predeterminado).

El valor predeterminado es ‘"high"’.

parámetro de tlp-configuration: string radeon-power-profile-on-bat

Igual que radeon-power-ac pero en modo BAT (batería).

El valor predeterminado es ‘"low"’.

parámetro de tlp-configuration: string radeon-dpm-state-on-ac

Método de gestión de energía dinámica (DPM) de Radeon. Las alternativas son “battery” (batería) y “performance” (rendimiento).

El valor predeterminado es ‘"performance"’.

parámetro de tlp-configuration: string radeon-dpm-state-on-bat

Igual que radeon-dpm-state-ac pero en modo BAT (batería).

El valor predeterminado es ‘"battery"’.

parámetro de tlp-configuration: string radeon-dpm-perf-level-on-ac

Nivel de rendimiento del DPM de Radeon. Las alternativas son “auto” (automático), “low” (bajo) y “high” (alto).

El valor predeterminado es ‘"auto"’.

parámetro de tlp-configuration: string radeon-dpm-perf-level-on-bat

Igual que radeon-dpm-perf-ac pero en modo BAT (batería).

El valor predeterminado es ‘"auto"’.

parámetro de tlp-configuration: on-off-boolean wifi-pwr-on-ac?

Modo de ahorro de energía de Wifi.

El valor predeterminado es ‘#f

parámetro de tlp-configuration: on-off-boolean wifi-pwr-on-bat?

Igual que wifi-power-ac? pero en modo BAT (batería).

El valor predeterminado es ‘#t

parámetro de tlp-configuration: y-n-boolean wol-disable?

Desactiva el encendido desde la red local (wake on LAN).

El valor predeterminado es ‘#t

parámetro de tlp-configuration: entero-no-negativo sound-power-save-on-ac

Duración en segundos del plazo antes de activar el ahorro de energía de audio en dispositivos Intel HDA y AC97. El valor 0 desactiva el ahorro de energía.

El valor predeterminado es ‘0’.

parámetro de tlp-configuration: entero-no-negativo sound-power-save-on-bat

Igual que sound-powersave-ac pero en modo BAT (batería).

El valor predeterminado es ‘1’.

parámetro de tlp-configuration: y-n-boolean sound-power-save-controller?

Desactiva el controlador en modo de ahorro de energía en dispositivos Intel HDA.

El valor predeterminado es ‘#t

parámetro de tlp-configuration: boolean bay-poweroff-on-bat?

Activa las unidades ópticas en UltraBay/MediaBay en modo BAT. La unidad puede volver a alimentarse liberando (y reinsertando) la palanca de eyección o presionando el botón de eyección de disco en modelos más modernos.

El valor predeterminado es ‘#f

parámetro de tlp-configuration: string bay-device

Nombre de la unidad de dispositivos ópticos a apagar.

El valor predeterminado es ‘"sr0"’.

parámetro de tlp-configuration: string runtime-pm-on-ac

Gestión de energía en tiempo de ejecución para dispositivos de bus PCI(e). Las alternativas son “on” y “auto”.

El valor predeterminado es ‘"on"’.

parámetro de tlp-configuration: string runtime-pm-on-bat

Igual que runtime-pm-ac pero en modo BAT (batería).

El valor predeterminado es ‘"auto"’.

parámetro de tlp-configuration: boolean runtime-pm-all?

Gestión de energía en tiempo de ejecución (Runtime Power Management) para todos los dispositivos del bus PCI(e), excepto los excluidos.

El valor predeterminado es ‘#t

parámetro de tlp-configuration: maybe-lista-cadena-separada-espacios runtime-pm-blacklist

Excluye las direcciones de dispositivo PCI(e) especificadas de la gestión de energía en tiempo de ejecución (Runtime Power Management).

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: lista-cadena-separada-espacios runtime-pm-driver-blacklist

Excluye los dispositivos PCI(e) asignados a los controladores especificados de la gestión de energía en tiempo de ejecución (Runtime Power Management).

parámetro de tlp-configuration: boolean usb-autosuspend?

Permite la suspensión automática de USB.

El valor predeterminado es ‘#t

parámetro de tlp-configuration: maybe-string usb-blacklist

Excluye los dispositivos especificados de la suspensión automática de USB.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: boolean usb-blacklist-wwan?

Excluye los dispositivos WWAN de la suspensión automática de USB.

El valor predeterminado es ‘#t

parámetro de tlp-configuration: maybe-string usb-whitelist

Incluye los dispositivos especificados en la suspensión automática de USB, incluso cuando están excluidos por el controlador o a través de usb-blacklist-wwan?.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: maybe-boolean usb-autosuspend-disable-on-shutdown?

Activa la suspensión automática de USB antes del apagado.

El valor predeterminado es ‘disabled’.

parámetro de tlp-configuration: boolean restore-device-state-on-startup?

Restablece el estado de los dispositivos de radio (bluetooth, wifi, wwan) previo al apagado durante el arranque del sistema.

El valor predeterminado es ‘#f

tlp-configuration parameter: string cpu-energy-perf-policy-on-ac

Set CPU energy/performance policy when on AC mode. Possible values, in order of increasing power saving, are performance, balance_performance, default, balance_power and power.

tlp-configuration parameter: string cpu-energy-perf-policy-on-bat

Set CPU energy/performance policy when on BAT mode. Possible values, in order of increasing power saving, are performance, balance_performance, default, balance_power and power.

Daemon Thermald

El módulo (gnu services pm) proporciona una interfaz con thermald, un servicio de escalado de frecuencia de la CPU que ayuda a prevenir el sobrecalentamiento.

Variable: thermald-service-type

Este es el tipo de servicio para thermald, el daemon Thermal de Linux, que es responsable del control del estado térmico de los procesadores y la prevención del sobrecalentamiento.

Tipo de datos: thermald-configuration

Tipo de datos que representa la configuración de thermald-service-type.

adaptive? (default: #f)

Use DPTF (Dynamic Power and Thermal Framework) adaptive tables when present.

ignore-cpuid-check? (predeterminado: #f)

Ignora la comprobación de cpuid durante la comprobación de procesadores permitidos.

thermald (predeterminado: thermald)

El objeto paquete de thermald.

PowerTOP

The (gnu services pm) module also provides a service definition for PowerTOP, a power consumption analysis and tuning tool. When started, it tunes Linux kernel settings to reduce power consumption.

Variable: powertop-service-type

The service type for PowerTOP. No configuration is necessary. When the service starts, it executes powertop --auto-tune.

Available powertop-configuration fields are:

powertop-configuration parameter: package powertop

The PowerTOP package. Defaults to powertop in the (gnu packages linux) module

The (gnu services power) module provides a service definition for apcupsd, a utility to interact with APC (APC by Schneider Electric or formerly American Power Conversion Corporation) UPS (Uninterruptible Power Supply) devices. Apcupsd also works with some OEM (Original Equipment Manufacturer)-branded products manufactured by APC.

Variable: apcupsd-service-type

The service type for apcupsd. For USB UPSes no configuration is necessary, however tweaking some fields to better suit your needs might be desirable. The defaults are taken from the upstream configuration and they are not very conservative (for example, the default battery-level of 5% may be considered too low by some).

The default event handlers do send emails, read more in apcupsd-event-handlers.

Data Type: apcupsd-configuration

Available apcupsd-configuration fields are:

apcupsd (default: apcupsd) (type: package)

The apcupsd package to use.

shepherd-service-name (default: apcupsd) (type: symbol)

The name of the shepherd service. You can add the service multiple times with different names to manage multiple UPSes.

auto-start? (default: #t) (type: boolean)

Should the shepherd service auto-start?

pid-file (default: "/var/run/apcupsd.pid") (type: string)

The file name of the pid file.

debug-level (default: 0) (type: integer)

The logging verbosity. Bigger number means more logs. The source code uses up to 300 as debug level value, so a value of 999 seems reasonable to enable all the logs.

run-dir (default: "/var/run/apcupsd") (type: string)

The directory containing runtime information. You need to change this if you desire to run multiple instances of the daemon.

name (type: maybe-string)

Use this to give your UPS a name in log files and such. This is particularly useful if you have multiple UPSes. This does not set the EEPROM. It should be 8 characters or less.

cable (default: usb) (type: enum-cable)

The type of a cable connecting the UPS to your computer. Possible generic choices are 'simple, 'smart, 'ether and 'usb.

Alternatively, a specific cable model number may be used: '940-0119A, '940-0127A, '940-0128A, '940-0020B, '940-0020C, '940-0023A, '940-0024B, '940-0024C, '940-1524C, '940-0024G, '940-0095A, '940-0095B, '940-0095C, '940-0625A, 'M-04-02-2000.

type (default: usb) (type: enum-type)

The type of the UPS you have.

apcsmart

Newer serial character device, appropriate for SmartUPS models using a serial cable (not an USB).

usb

Most new UPSes are an USB.

net

Network link to a master apcupsd through apcupsd’s Network Information Server. This is used if the UPS powering your computer is connected to a different computer for monitoring.

snmp

SNMP network link to an SNMP-enabled UPS device.

netsnmp

Same as the SNMP above but requires use of the net-snmp library. Unless you have a specific need for this old driver, you should use the 'snmp instead.

dumb

An old serial character device for use with simple-signaling UPSes.

pcnet

A PowerChute Network Shutdown protocol which can be used as an alternative to an SNMP with the AP9617 family of smart slot cards.

modbus

A serial device for use with newest SmartUPS models supporting the MODBUS protocol.

device (default: "") (type: string)

For USB UPSes, usually you want to set this to an empty string (the default). For other UPS types, you must specify an appropriate port or address.

apcsmart

Set to the appropriate /dev/tty** device.

usb

A null string setting enables auto-detection, which is the best choice for most installations.

net

Set to hostname:port.

snmp

Set to hostname:port:vendor:community. The hostname is the ip address or hostname of the UPS on the network. The vendor can be can be "APC" or "APC_NOTRAP". "APC_NOTRAP" will disable SNMP trap catching; you usually want "APC". The port is usually 161. The community is usually "private".

netsnmp

Same as the 'snmp.

dumb

Set to the appropriate /dev/tty** device.

pcnet

Set to ipaddr:username:passphrase:port. The ipaddr is the IP address of the UPS management card. The username and the passphrase are the credentials for which the card has been configured. The port is the port number on which to listen for messages from the UPS, normally 3052. If this parameter is empty or missing, the default of 3052 will be used.

modbus

Set to the appropriate /dev/tty** device. You can also leave it empty for MODBUS over USB or set to the serial number of the UPS.

poll-time (default: 60) (type: integer)

The interval (in seconds) at which apcupsd polls the UPS for status. This setting applies both to directly-attached UPSes (apcsmart, usb, dumb) and networked UPSes (net, snmp). Lowering this setting will improve the apcupsd’s responsiveness to certain events at the cost of higher CPU utilization.

on-batery-delay (default: 6) (type: integer)

The time in seconds from when a power failure is detected until we react to it with an onbattery event. The 'powerout event will be triggered immediately when a power failure is detected. However, the 'onbattery event will be trigger only after this delay.

battery-level (default: 5) (type: integer)

If during a power failure, the remaining battery percentage (as reported by the UPS) is below or equal to this value, the apcupsd will initiate a system shutdown.

Nota: battery-level, remaining-minutes, and timeout work in a conjunction, so the first that occurs will cause the initation of a shutdown.

remaining-minutes (default: 3) (type: integer)

If during a power failure, the remaining runtime in minutes (as calculated internally by the UPS) is below or equal to this value, apcupsd will initiate a system shutdown.

Nota: battery-level, remaining-minutes, and timeout work in a conjunction, so the first that occurs will cause the initation of a shutdown.

timeout (default: 0) (type: integer)

If during a power failure, the UPS has run on batteries for this many seconds or longer, apcupsd will initiate a system shutdown. The value of 0 disables this timer.

Nota: battery-level, remaining-minutes, and timeout work in a conjunction, so the first that occurs will cause the initation of a shutdown.

annoy-interval (default: 300) (type: integer)

The time in seconds between annoying users (via the 'annoyme event) to sign off prior to system shutdown. 0 disables.

annoy-delay (default: 60) (type: integer)

The initial delay in seconds after a power failure before warning users to get off the system.

no-logon (default: disable) (type: enum-no-logon)

The condition which determines when users are prevented from logging in during a power failure.

kill-delay (default: 0) (type: integer)

If this is non-zero, the apcupsd will continue running after a shutdown has been requested, and after the specified time in seconds attempt to kill the power. This is for use on systems where apcupsd cannot regain control after a shutdown.

net-server (default: #f) (type: boolean)

If enabled, a network information server process will be started.

net-server-ip (default: "127.0.0.1") (type: string)

An IP address on which the NIS server will listen for incoming connections.

net-server-port (default: 3551) (type: integer)

An IP port on which the NIS server will listen for incoming connections.

net-server-events-file (type: maybe-string)

If you want the last few EVENTS to be available over the network by the network information server, you must set this to a file name.

net-server-events-file-max-size (default: 10) (type: integer)

The maximum size of the events file in kilobytes.

class (default: standalone) (type: enum-class)

Normally standalone unless you share an UPS using an APC ShareUPS card.

mode (default: disable) (type: enum-mode)

Normally disable unless you share an UPS using an APC ShareUPS card.

stat-time (default: 0) (type: integer)

The time interval in seconds between writing the status file, 0 disables.

log-stats (default: #f) (type: boolean)

Also write the stats as a logs. This generates a lot of output.

data-time (default: 0) (type: integer)

The time interval in seconds between writing the data records to the log file, 0 disables.

facility (type: maybe-string)

The logging facility for the syslog.

event-handlers (type: apcupsd-event-handlers)

Handlers for events produced by apcupsd.

Data Type: apcupsd-event-handlers

For a description of the events please refer to ‘man 8 apccontrol’.

Each handler shall be a gexp. It is spliced into the control script for the daemon. In addition to the standard Guile programming environment, the following procedures and variables are also available:

conf

Variable containing the file name of the configuration file.

powerfail-file

Variable containing the file name of the powerfail file.

cmd

The event currently being handled.

name

The name of the UPS as specified in the configuration file.

connected?

Is #t if apcupsd is connected to the UPS via a serial port (or a USB port). In most configurations, this will be the case. In the case of a Slave machine where apcupsd is not directly connected to the UPS, this value will be #f.

powered?

Is #t if the computer on which apcupsd is running is powered by the UPS and #f if not. At the moment, this value is unimplemented and always #f.

(err fmt args...)

Wrapper around format outputting to (current-error-port).

(wall fmt args...)

Wrapper around format outputting via wall.

(apcupsd args...)

Call apcupsd while passing the correct configuration file and all the arguments.

(mail-to-root subject body)

Send an email to the local administrator. This procedure assumes the sendmail is located at /run/privileged/bin/sendmail (as would be the case with opensmtpd-service-type).

Available apcupsd-event-handlers fields are:

modules (type: gexp)

Additional modules to import into the generated handler script.

killpower (type: gexp)

The handler for the killpower event.

commfailure (type: gexp)

The handler for the commfailure event.

commok (type: gexp)

The handler for the commfailure event.

powerout (type: gexp)

The handler for the powerout event.

onbattery (type: gexp)

The handler for the onbattery event.

offbattery (type: gexp)

The handler for the offbattery event.

mainsback (type: gexp)

The handler for the mainsback event.

failing (type: gexp)

The handler for the failing event.

timeout (type: gexp)

The handler for the timeout event.

loadlimit (type: gexp)

The handler for the loadlimit event.

runlimit (type: gexp)

The handler for the runlimit event.

doreboot (type: gexp)

The handler for the doreboot event.

doshutdown (type: gexp)

The handler for the doshutdown event.

annoyme (type: gexp)

The handler for the annoyme event.

emergency (type: gexp)

The handler for the emergency event.

changeme (type: gexp)

The handler for the changeme event.

remotedown (type: gexp)

The handler for the remotedown event.

startselftest (type: gexp)

The handler for the startselftest event.

endselftest (type: gexp)

The handler for the endselftest event.

battdetach (type: gexp)

The handler for the battdetach event.

battattach (type: gexp)

The handler for the battattach event.


Next: Servicios de audio, Previous: Integración continua, Up: Servicios   [Contents][Index]