API Call for servicestatus filter on last_state_change

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dh0125e
Posts: 40
Joined: Tue Aug 04, 2020 9:30 am

API Call for servicestatus filter on last_state_change

Post by dh0125e »

Is there any guidance on how to add a filter to the API call api/v1/objects/servicestatus for the last_state_change value to pull only services that have only had a state update since the datetime value provided?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: API Call for servicestatus filter on last_state_change

Post by scottwilkerson »

Yes, you can append something like the following to the URL

Code: Select all

&last_state_change=gt:2020-10-01
this would show all services that have a last_state_change greater than 2020-10-01
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
dh0125e
Posts: 40
Joined: Tue Aug 04, 2020 9:30 am

Re: API Call for servicestatus filter on last_state_change

Post by dh0125e »

I will test, but I'm assuming I can also specify a time to it? so 2020-10-30 09:55:00 ?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: API Call for servicestatus filter on last_state_change

Post by scottwilkerson »

dh0125e wrote:I will test, but I'm assuming I can also specify a time to it? so 2020-10-30 09:55:00 ?
correct
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked