Pacemaker Command-line Output
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-as | C API |
---|---|---|
attrd_updater | 2.1.3 | n/a |
cibadmin | n/a | n/a |
crmadmin | 2.1.0 | 2.1.0 |
crm_attribute | 2.1.3 | n/a |
crm_diff | n/a | n/a |
crm_error | 2.1.5 | 2.1.5 |
crm_mon | 2.0.3 | 2.1.3 |
crm_node | 2.1.7 | n/a |
crm_resource | 2.1.0 | 2.1.0 (incomplete) |
crm_rule | 2.1.3 | 2.1.5 |
crm_shadow | 2.1.6 | n/a |
crm_simulate | 2.1.0 | 2.1.2 |
crm_ticket | n/a | n/a |
crm_verify | 2.1.0 | n/a |
iso8601 | n/a | n/a |
stonith_admin | 2.0.2 | n/a |
- Last Author
- kgaillot
- Last Edited
- Oct 31 2023, 6:36 PM