Page 1 of 1
Dump to alarms to a file
Posted: Tue Mar 31, 2020 4:14 am
by ets_user
Hi,
We have a requirement to dump all the alerts generated in NagiosXI to a file in a custome format.
Please let us know how this can be done.
Thanks.
Re: Dump to alarms to a file
Posted: Tue Mar 31, 2020 7:00 am
by scottwilkerson
You can pull these from the API
Help -> API Docs -> Objects Reference -> objects/statehistory
Re: Dump to alarms to a file
Posted: Tue Mar 31, 2020 4:11 pm
by ets_user
I enabled API access to the user Admin --> Manage Users --> Edit user --> Under Security settings --> then check the "Has API access" box --> Update User.
Then i tried to run the curl command as mentioned.
curl -XGET "
https://10.106.93.70/nagiosxi/api/v1/ob ... E&pretty=1"
So it looks like whatever status / alert messages we are seeing in UI can be retrieved from backend using these APIs.
Could you tell me what database nagios XI is using to store the alarms and if we can access it directly if its inbuilt.
Also any predefined script is available to make the alarms to our custom format (filter only important fields).
Thanks.
Re: Dump to alarms to a file
Posted: Tue Mar 31, 2020 4:24 pm
by scottwilkerson
They are in the nagios DB nagios_statehistory
But it gets complicated because that DB references object_id from nagios_objects
Re: Dump to alarms to a file
Posted: Thu Apr 02, 2020 4:57 am
by ets_user
Thank you.
We will try this and get back to you incase of any difficulties.
Re: Dump to alarms to a file
Posted: Thu Apr 02, 2020 8:01 am
by scottwilkerson
ets_user wrote:Thank you.
We will try this and get back to you incase of any difficulties.
Sounds good