I have a script running on an alert being triggered in which I need to get the current alert configuration. I have attempted to use the alert history API, however I can only get information about the alert from the last time it was triggered at the latest. However, I can't assume that the last time the alert was triggered that it had the same configuration and it seems like the alert history doesn't update until after my script is finished running.
Is there a way for me to read the current configuration of the alert from my script?
Get Current Alert Configuration
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Get Current Alert Configuration
Hi Randall,
That is a good question and I'm going to do a bit of research on it and get back to you once I've had a chance to review this further with the other team members.
That is a good question and I'm going to do a bit of research on it and get back to you once I've had a chance to review this further with the other team members.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Get Current Alert Configuration
This information can be found in the nagioslogserver index. You can pull it directly with something like:
Where AXLCm7Ku2ua2gtT2HiHq is the unique id of the alert. You can find the id by running:
Code: Select all
curl -XGET "http://localhost:9200/nagioslogserver/alert/AXLCm7Ku2ua2gtT2HiHq"Code: Select all
curl -XGET "http://localhost:9200/nagioslogserver/alert/_search?size=2000&pretty"As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
randall.schievelbein
- Posts: 7
- Joined: Mon Apr 13, 2020 3:19 pm
Re: Get Current Alert Configuration
This was exactly what I needed, thank you.
Re: Get Current Alert Configuration
Glad to help!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.