Page MenuHomeClusterLabs Projects

Pacemaker Command-line Output
Updated 325 Days AgoPublic

It was long common for agents and scripts to parse the text output of Pacemaker command-line tools. However, that approach is prone to problems when new versions are released and output changes.

To address this, Pacemaker has been gradually adding support for XML output for all command-line tools. The intent is that text output may change from release to release, but the XML output will change as little as possible, and remain backward-compatible as much as possible, for parsing. All commands will take the same --output-as option, which may be set to none, text (the default), or xml. Individual commands may support additional formats.

The schema for the XML output is installed as api-result.rng (typically in /usr/share/pacemaker/api). That file includes RNGs for each individual command. You can browse those to figure out how to parse what you want.

Pacemaker has also been gradually adding high-level C APIs corresponding to each command-line tool, and those generate identical XML output. See "Pacemaker High-Level API" in Pacemaker's API documentation for details.

Command--output-asC API
attrd_updater2.1.3n/a
cibadminn/an/a
crmadmin2.1.02.1.0
crm_attribute2.1.3n/a
crm_diffn/an/a
crm_error2.1.52.1.5
crm_mon2.0.32.1.3
crm_node2.1.7n/a
crm_resource2.1.02.1.0 (incomplete)
crm_rule2.1.32.1.5
crm_shadow2.1.6n/a
crm_simulate2.1.02.1.2
crm_ticketn/an/a
crm_verify2.1.0n/a
iso8601n/an/a
stonith_admin2.0.2n/a
Last Author
kgaillot
Last Edited
Oct 31 2023, 6:36 PM