Page 1 of 1

Ingest JSON

Posted: Thu Mar 07, 2019 2:48 pm
by csatola
Hi All! I'm evaluating Nagios as a possible replacement for our current implementation of Solarwinds NPM and SAM. One of the key features I'm using in Solarwinds is writing a custom exe monitor to hit a web URL that returns JSON. I ingest the JSON and return the data to Solarwinds the way it wants it (Statistic and Message for a handful of items)

Example JSON Output:

Code: Select all

[
{
name: "queue-count",
message: "",
statistic: "0",
responseTime: "0",
status: "UP"
},
{
name: "phrase-search",
message: "",
statistic: "0",
responseTime: "4",
status: "UP"
}
]
Resulting output to Solarwinds:

Code: Select all

Message.queue_count:UP
Statistic.queue_count:0
Message.phrase_search:UP
Statistic.phrase_search:0
Message.Status:Check Complete: http:/url/status (RunID e8415e67-96ac-4fc3-908e-2ff502a7e040)
Statistic.Status:1205
So I can alert on the message or statistic of either of these sections. Is this doable in Nagios?

Re: Ingest JSON

Posted: Thu Mar 07, 2019 3:12 pm
by cdienger
There are a few plugins on the Exchange that work with json responses via urls. Check out:

https://exchange.nagios.org/index.php?o ... check_json