Add support for JSON-format output from all plugins
It might be nice to support JSON output as a valid format for all custom plugins, so that they can be piped through HTTP/JSON rather than relying solely on NRPE or similar.
This would probably be supported via something like the following pattern in the main()
function for each plugin:
def main(...):
...
status, message = check_thing(...)
if args.json:
utils.write_json(
status,
message,
validity=3600,
)
else:
print(message)
return status