I’ve tried the ruby http-check plugin with no luck so I moved on to the nagios plugin
"http-nagios": {
"command": "/usr/lib/nagios/plugins/check_http --hostname exampleurl.com --url /health/ops -k Tenant-Id:op -k TraceId:1234 -j POST -P '{\"field1\":\"a\",\"field2\":1,\"childObj\":{\"cfield1\":\"b\",\"cfield2\":2,\"arrayField\":[3,4]},\"floatField\":8.8}' -E",
"standalone": true,
"interval": 1,
"playbook": "What to do if I'm failing",
"github": "github.com/urlgoeshere"
}
And I get HTTP WARNING: HTTP/1.1 400 Bad Request - 226 bytes
instead of HTTP OK: HTTP/1.1 200 OK - 292 bytes as I typically get executing the same command outside of the check.json file (i.e. sensu)
What am I doing wrong here? Could anyone show me an example POST with multiple headers and JSON using the ruby http plugin?
I’m at a loss as to why posting json is having a problem here.