Linux apmd command to monitor battery and power events

Updated

apmd is an monitoring daemon for the Advanced Power Management (APM) subsystem. It works in conjunction with the APM BIOS driver in the OS kernel. apmd manages events shown by the Power management BIOS driver, a driver reports on battery level and requests to enter sleep or suspend mode. apmd will register all reports it gets via syslogd and take steps to ensure that basic sleep and suspend calls are handled perfectly. apmd emits various messages, most of which are self-explanatory.

The APM BIOS driver in the kernel sends events to apmd, which logs them to syslogd and runs the proxy program.

Synopsis :

apmd [ -TVWciqv ] [ -P program ] [ -T seconds ] [ -c seconds] [ -p percent ] [ -v level] [ -w percent]

OPTIONS :

Tag Explanation
-P [program],–proxy program Directs the proxy program to execute when events are received.
-V,–version It prints the version of the apmd program and exits.
-T [seconds] ,–proxy-timeout [seconds] It sets a definite timeout for the proxy.If this option is not given or is given with a negative argument, apmd waits indefinitely for the proxy to finish.The default timeout is of 30 seconds.
-c [seconds] ,–check [seconds] It controls how much time to wait for an event to occur.Controls how many seconds to block on the /dev/apm_bios device. Normally the daemon blocks until the APM driver reports an event.The default is 30 seconds.
-p [percent],–percentage percent It logs the information of percentage of power changes(discharge or recharge).The default is 5. A value greater than 100 can be imposed to disable periodic logging of the battery level.
-q,–quiet-bios-battery-low Directs apmd not to generate a warning when a LOW BATTERY signal is received from the APM subsystem.
-w percent,–warn percent When the battery is not being charged and the percentage of available power drops below warn_percent, log a warning at ALERT level to syslog(2). If the -W or –wall flag was given, the daemon will also use wall(1) to alert all users of impending doom. Give the warning each time the percentage changes. The default is 10. Use negative values to disable this feature.
-v [level] ,–verbose [level] Enables verbose mode, where each event reported by the APM driver is logged.
-W,–wall In addition to logging low battery status (as determined either by the -w level or by the APM BIOS) using syslog(2), apmd will, given this option, also use wall(1) to alert all users.
-h,–help Prints a command summary and exits.

The power management and conservation activities are mainly handled by the proxy program specified using the -P option. The proxy program is invoked with one or two arguments:

  1. start-Invoked when the daemon starts.
  2. stop-Invoked when the daemon stops.
  3. standby [ system | user ]-Invoked when the APM driver reports that system standby has been initiated. The second parameter indicates whether the BIOS or a user action caused this.
  4. suspend [ system | user ]-Invoked when the APM driver reports that system suspension has been initiated. The second parameter indicates whether the BIOS or a user action (ex-closing a machine) initiated suspension.
  5. resume [ suspend | standby | critical ]-Invoked when the APM driver reports that system has resumed normal operation. The second parameter indicates what sort of mode it was in before, either the “suspend” mode or else “standby” mode.
  6. change power-Invoked when the APM subsystem reports a change in power status, such as a switch from mains to battery power.
  7. change battery-The APM driver has reported that the BIOS thinks the strength of one (or more) batteries is “low” and at least five minutes of power should remain.
  8. change capability-Some change in the power management capabilities of the system was reported, maybe by operation of some setup utility, or by the arrival or removal of some devices.

BUGS :

  • The values showed maybe vary with actual charge and discharge rates and times can be very inaccurate.
  • The daemon supports all APM events described in the APM BIOS specification version 1.2 but it fails to support some of the advanced features of APM 1.2.
  • Multiple batteries are treated as if they are one single large one.

FILES :

  • /dev/apm_bios
  • /etc/apm/apmd_proxy
  • /proc/apm
  • /etc/apmd_proxy
Comment
Mithlesh Upadhyay Published 24 Nov 2026 · 4 min read

Mithlesh Upadhyay is a Computer Science and AI expert from Madhya Pradesh with strong academic background (BE in CSE and M.Tech in AI) and over six years of experience in technical content development. He has contributed tech articles, led teams, and worked in Full Stack Development and Data Science. He founded the w3colleges.org portal for learning resources.

Related tutorials

  • Software concepts of Computer

    Before starting the software concepts, let us take a brief look into the components of computer. Components of Computer: A computer system has 3 components namely: Hardware, Software,…

    3 min read
  • Difference between Full Virtualization and Para-virtualization

    Process of abstracting underlying hardware components from software is the primary concept behind virtualization. 1. Full Virtualization In full virtualization, a single host operating system allows the execution…

    2 min read
  • Storage Structure memory

    Storage structure consists of registers, main memory, and magnetic disk is only one of many possible storage systems. There are also cache CD ROM, magnetic takes, and so…

    3 min read
  • What is Software and its Types ?

    Software is nothing but a program or collection of programs that perform a specific task. Software is a bridge between user and computer hardware. Softwares directs the peripheral…

    1 min read
  • Searching in parent and printing result in child processes using fork()

    In C/C++, the fork() function is used to generate a new process known as the child process. We can do searching within a fork() process. Problem statement –…

    3 min read
  • Multilevel Paging in Operating System

    A page table is a data structure used by virtual memory system in a computer operating system to store the mapping between the virtual addresses and physical addresses.…

    4 min read