Skip to content

Commit 324ee0f

Browse files
upsstats: Add JSON output mode via ?json parameter
When the ?json (or &json) parameter is added to the URL, upsstats.cgi will now bypass all HTML template processing. Instead, it returns a "Content-Type: application/json" response containing the full data for the requested UPS(es), including all variables, raw status, and parsed status. This provides a modern API for external monitoring tools without affecting the existing HTML template functionality. Signed-off-by: Atanas Vladimirov <vladimirov.atanas@gmail.com>
1 parent f8ecd52 commit 324ee0f

3 files changed

Lines changed: 300 additions & 39 deletions

File tree

NEWS.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ several `FSD` notifications into one executed action. [PR #3097]
193193

194194
- `upsset` should now recognize `RANGE NUMBER` and `NUMBER` types. [#3164]
195195

196+
- `upsstats` has now JSON output mode via ?json (or &json)
197+
parameter. [issue #2524 and #2525, PR #3171]
198+
196199
- `upssched` tool updates:
197200
* Previously in PR #2896 (NUT releases v2.8.3 and v2.8.4) the `UPSNAME` and
198201
`NOTIFYTYPE` environment variables were neutered for the timer daemon,

0 commit comments

Comments
 (0)