Hi all
Need one help on APIs avalaible in NAgiosXI ,as I have tried the APIs for the process which define all hosts and services combine ,but is it possible to call any specific services for any particular host individually??? ,If you can provide me with any example of API to call for any single host and service ,for example
for hosts
http://192.168.150.30/nagiosxi/backend/ ... t=f0ebse4q
For services
http://192.168.150.30/nagiosxi/backend/ ... t=f0ebse4q
Now in this we need specific host and service to call ,Is it possible ,that is my question, Please advice and Help on this too.
Basically I want to modify or create/call an specific service for an single host at a give time period in APIs ,there are limited set pf APIs modification available in help menu.. for ex [below attachment]
Regards
Format or Modified the Limited queries in NagiosXI APIs
-
network2016
- Posts: 47
- Joined: Tue Mar 08, 2016 11:35 am
Format or Modified the Limited queries in NagiosXI APIs
You do not have the required permissions to view the files attached to this post.
Re: Format or Modified the Limited queries in NagiosXI APIs
The links you posted are for the OLD API version, but the screenshot appears to be for the NEW API. For the older backend component, here is how you could drill down to a specific host -
Just append &name= to specify further what you're looking for.
As for the newer API, I would look at the Help -> Config Reference (this is the part that applies to making configuration changes through the API.
You can modify the time periods here as needed, as you'll see these as the optional variables.
An example call to do so -
Code: Select all
http://192.168.3.115/nagiosxi/backend/?cmd=gethoststatus&username=nagiosadmin&ticket=32klfcka&name=localhost
As for the newer API, I would look at the Help -> Config Reference (this is the part that applies to making configuration changes through the API.
You can modify the time periods here as needed, as you'll see these as the optional variables.
Code: Select all
host_name host name
address ip address
max_check_attempts #
check_period timeperiod_name
contacts
or
contact_groups contacts
or
contact_groups
notification_interval #
notification_period timeperiod_name
Code: Select all
curl -XPOST "http://192.168.3.115/nagiosxi/api/v1/config/host?apikey=32klfcka&pretty=1" -d "host_name=testapihostapply&address=127.0.0.1&check_command=check_ping\!3000,80%\!5000,100%&max_check_attempts=2&check_period=24x7&contacts=nagiosadmin¬ification_interval=5¬ification_period=24x7&applyconfig=1"
Former Nagios Employee
-
network2016
- Posts: 47
- Joined: Tue Mar 08, 2016 11:35 am
Re: Format or Modified the Limited queries in NagiosXI APIs
Thanks rkennedy !!!!!!!!!!!!!!!!!!!!!!!!!
Really helpful reply!!!!
Really helpful reply!!!!
Re: Format or Modified the Limited queries in NagiosXI APIs
Did you need additional assistance with this issue, or are we ok to close this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
network2016
- Posts: 47
- Joined: Tue Mar 08, 2016 11:35 am
Re: Format or Modified the Limited queries in NagiosXI APIs
U can please close this for now.. I am happy with the help and will return IF required any help in future
Thank you everyone ..for the Help

Thank you everyone ..for the Help