curl, json and -d query
Posted: Fri Mar 19, 2021 4:55 am
Hello,
I'd like to monitoring the value of count (if it's 0 then trigger CRITICAL) from the following curl command:
I tried several check_json plugins, but I can't figure out how to pass -d'{"query": {"range": {"recordTime": {"gte": "now-12h"}}}}'.
Any tips would be greatly appreciated. I'm using Nagios Core 4.4.6 under Debian 10.
Thank you.
I'd like to monitoring the value of count (if it's 0 then trigger CRITICAL) from the following curl command:
Code: Select all
curl -u login:pass 192.168.100.9:9200/events/_count?pretty=true -H 'Content-Type: application/json' -d'{"query": {"range": {"recordTime": {"gte": "now-12h"}}}}'
{
"count" : 2073,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
}
}
Any tips would be greatly appreciated. I'm using Nagios Core 4.4.6 under Debian 10.
Thank you.