Commit 324ee0f
committed
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
196 | 199 | | |
197 | 200 | | |
198 | 201 | | |
| |||
0 commit comments