Index · Directives systemd 263~devel

Name

systemd-report-power-source@.service, systemd-report-power-source.socket, systemd-report-power-source — Report AC power status and battery state as system report metrics

Synopsis

systemd-report-power-source@.service

systemd-report-power-source.socket

/usr/lib/systemd/systemd-report-power-source

Experimental

This component is experimental and subject to change without advance notice. It will be stabilized and given a backward-compatibility guarantee in a future release, but may also possibly be removed.

Description

systemd-report-power-source@.service is a metrics source for systemd-report(1). It reports whether the system is running on external power, as well as the key parameters of the system's batteries, as exposed by the kernel's power supply class ("power_supply"), by implementing the io.systemd.Metrics Varlink interface on a socket linked into the /run/systemd/report/ directory.

The following system-wide metric is reported, without metric object:

io.systemd.PowerSource.ACPower

1 if the system is running on external (AC) power, 0 if it is running on battery. Systems without any power supply information (for example most desktop machines and virtual machines) are considered to be running on AC power.

Added in version 263.

The following metrics are reported for every battery that is present and powers the system, i.e. batteries of peripheral devices such as mice or keyboards are not included. The metric object is the kernel's name of the battery, for example "BAT0". Metrics the battery's driver does not provide are omitted.

io.systemd.PowerSource.BatteryCapacityPercent

The current charge level of the battery, in percent.

Added in version 263.

io.systemd.PowerSource.BatteryCycleCount

The number of charge cycles the battery has undergone over its lifetime.

Added in version 263.

io.systemd.PowerSource.BatteryHealthPercent

The capacity of the fully charged battery relative to its design capacity, in percent. Typically decreases as the battery ages, and may exceed 100 for new batteries.

Added in version 263.

io.systemd.PowerSource.BatteryPowerWatts

The rate at which the battery is currently being charged or discharged, in Watts. This is always a non-negative value, use io.systemd.PowerSource.BatteryStatus to determine the direction.

Added in version 263.

io.systemd.PowerSource.BatteryStatus

The charging status of the battery, as reported by the kernel, i.e. one of "Charging", "Discharging", "Not charging", "Full" or "Unknown".

Added in version 263.

See Also

systemd(1), systemd-report(1), Linux power supply class