Dump to alarms to a file

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ets_user
Posts: 78
Joined: Mon Mar 30, 2020 2:50 am

Dump to alarms to a file

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Dump to alarms to a file

Post by scottwilkerson »

You can pull these from the API
Help -> API Docs -> Objects Reference -> objects/statehistory
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ets_user
Posts: 78
Joined: Mon Mar 30, 2020 2:50 am

Re: Dump to alarms to a file

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Dump to alarms to a file

Post by scottwilkerson »

They are in the nagios DB nagios_statehistory

But it gets complicated because that DB references object_id from nagios_objects
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ets_user
Posts: 78
Joined: Mon Mar 30, 2020 2:50 am

Re: Dump to alarms to a file

Post by ets_user »

Thank you.

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

Post by scottwilkerson »

ets_user wrote:Thank you.

We will try this and get back to you incase of any difficulties.
Sounds good
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked