API wildcards

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

API wildcards

Post by BanditBBS »

I put in a feature request in January 2016 for wildcards to work in the API urls. Was that ever completed and if so, their documentation on how ot use? I looked through the change log but didn't see it mentioned.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: API wildcards

Post by scottwilkerson »

By chance do you have a link to the request so we can see what you were looking for? I'm not fully clear on the request, it may be implemented, but not sure
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: API wildcards

Post by BanditBBS »

https://support.nagios.com/forum/viewto ... 16&t=36648 <---original thread

Basically I want to do an API call for service status where the hostname is like abc* or abc%

Code: Select all

https://xxxx.xxx.com/nagiosxi/api/v1/objects/servicestatus?host_name=abc*&apikey=xxxxx&pretty=1"
The above being an example of what I'd like to do, get a service status list for all hosts that start with abc
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: API wildcards

Post by scottwilkerson »

If you click "type" you can see all the options
api_options.JPG
So in your example you would do this

Code: Select all

https://xxxx.xxx.com/nagiosxi/api/v1/objects/servicestatus?host_name=lks:abc&apikey=xxxxx&pretty=1
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: API wildcards

Post by BanditBBS »

Oh god, thanks you! I thought it was added before but just couldn't find it!

Close this up!
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: API wildcards

Post by scottwilkerson »

The only caveat we could not achieve was if you wanted to wildcard like abc*123

This wasn't an option and would need to be filtered after the results are pulled.

Closing ticket
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked