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.
Dump to alarms to a file
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Dump to alarms to a file
You can pull these from the API
Help -> API Docs -> Objects Reference -> objects/statehistory
Help -> API Docs -> Objects Reference -> objects/statehistory
Re: Dump to alarms to a file
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.
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.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Dump to alarms to a file
They are in the nagios DB nagios_statehistory
But it gets complicated because that DB references object_id from nagios_objects
But it gets complicated because that DB references object_id from nagios_objects
Re: Dump to alarms to a file
Thank you.
We will try this and get back to you incase of any difficulties.
We will try this and get back to you incase of any difficulties.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Dump to alarms to a file
Sounds goodets_user wrote:Thank you.
We will try this and get back to you incase of any difficulties.