Knowledge base

Monitor response formats

format parameter
Structure instead of text

Every monitor page can be retrieved as a structure: the format=xml or format=json parameter on the address without the /ui suffix. By default the monitor root redirects a browser to /ui.

The XML and JSON structures match field for field — the manual gives the status response in both formats — so the reading side takes whichever suits it.

The main trap is the address with /ui. A link copied from a browser leads to the page for a person: parsing gets markup instead of a structure.
What the Hub does. It asks for json — that way the response is parsed without parsing text.
Recommended values

Which address for whom:

For whom Address Format
a person with /ui a page
an XML program without /ui, format=xml XML
a JSON program without /ui, format=json JSON
The address without /ui, the two formats and matching structures come from the manual (§ 5.1, § 5.3). The table is ours.
Example configuration
# one page in two formats
curl -s 'http://127.0.0.1:8080/status?format=json'curl -s 'http://127.0.0.1:8080/status?format=xml'
Both responses carry the same fields.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
Compatibility
PowerMTA 6.0
described in the manual of this version · platform: any
The vendor does not state the first version for every directive — there is no note here. The name also appears in the 5.0 edition of the manual.
How to check on the node
Check that a structure arrives:
curl -s 'http://127.0.0.1:8080/status?format=json' | head -c 200
The response should start with {; HTML markup means the request went to the page for a person.
In the Hub
Cost of a mistake
safe: a wrong value breaks nothing
Scenarios
Collect telemetry