Get Current Alert Configuration

This support forum board is for support questions relating to Nagios Log Server, our solution for managing and monitoring critical log data.
Locked
randall.schievelbein
Posts: 7
Joined: Mon Apr 13, 2020 3:19 pm

Get Current Alert Configuration

Post by randall.schievelbein »

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?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Get Current Alert Configuration

Post by benjaminsmith »

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.
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!
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Get Current Alert Configuration

Post by cdienger »

This information can be found in the nagioslogserver index. You can pull it directly with something like:

Code: Select all

curl -XGET "http://localhost:9200/nagioslogserver/alert/AXLCm7Ku2ua2gtT2HiHq"
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/_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

Post by randall.schievelbein »

This was exactly what I needed, thank you.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: Get Current Alert Configuration

Post by cdienger »

Glad to help!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked