title: Linux Battery: Charge, Energy, Health, Charge Rate and Cycles
agents: linux
catalog: os/hardware
license: GPLv2
distribution: check_mk
description:
 This check monitors the state of batteries reported by the Linux kernel
 power supply class in {/sys/class/power_supply}. For each battery it reports
 the charge status (charging, discharging, full), the remaining charge in
 percent, the energy content in Wh and the energy when full, the battery
 health (the current full charge capacity as a percentage of the original
 design capacity), the charge/discharge rate in W (and the resulting time to
 full or time remaining) and the number of charge cycles.

 The check goes {WARN} or {CRIT} when the remaining charge or the battery
 health drop below configurable levels, when the number of charge cycles
 exceeds configurable upper levels, or when the estimated time remaining
 (while discharging) drops below configurable levels. The levels can be
 configured with the rule "Linux laptop battery".

 The agent plug-in {mk_lnx_battery} can discover system batteries (laptops,
 UPS; kernel scope {System} or unset) and/or peripheral batteries (wireless
 mice/keyboards via the HID++ protocol, exposed as {hidpp_battery_*}, kernel
 scope {Device}). Which device classes are discovered is configured via the
 agent bakery rule and defaults to system batteries only. Peripheral devices
 typically report only charge and status, so energy/health/cycle readings are
 omitted for them.

 This check needs the agent plug-in {mk_lnx_battery} to be installed on the
 monitored host.

item:
 The name of the battery as reported by the kernel, for example {BAT0} or
 {hidpp_battery_1}.

discovery:
 One service is created for each discovered battery in
 {/sys/class/power_supply}.
