API for alerts and events

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
abhishekkayal89
Posts: 6
Joined: Mon Sep 16, 2019 6:54 am

API for alerts and events

Post by abhishekkayal89 »

is there any api for getting device deatils and logentries together
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: API for alerts and events

Post by scottwilkerson »

Yes in XI under
Help -> Objects Reference
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
abhishekkayal89
Posts: 6
Joined: Mon Sep 16, 2019 6:54 am

Re: API for alerts and events

Post by abhishekkayal89 »

objects/logentries gives events and alerts
but i am looking for respective device details along with it how to get in single api call
abhishekkayal89
Posts: 6
Joined: Mon Sep 16, 2019 6:54 am

Re: API for alerts and events

Post by abhishekkayal89 »

or can we correlate the data from objects/logentries api with any other api available in Nagios XI api objects to get device details
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: API for alerts and events

Post by scottwilkerson »

abhishekkayal89 wrote:objects/logentries gives events and alerts
but i am looking for respective device details along with it how to get in single api call
You cannot do it in a single call, you can get status from:

GET objects/hoststatus
GET objects/servicestatus
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
abhishekkayal89
Posts: 6
Joined: Mon Sep 16, 2019 6:54 am

Re: API for alerts and events

Post by abhishekkayal89 »

but how i will relate the logentries api results with hostlist results to determine which alert is for which device
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: API for alerts and events

Post by scottwilkerson »

The API isn't written to do this correlation, the best I can suggest would be to search the host names in the logs.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked