Dear Expert
when we adding new HOST with Services, or new SERVICES, specially Status and Bandwidth
its taking to long to check the services, we want some sort of option (feature request) upon adding the Services, please check newly added services to : Force an immediate check by Auto upon user request (user choice).
Regards
Force an immediate check immediately upon adding HOST
Re: Force an immediate check immediately upon adding HOST
You could use the REST API to add a new host, and then schedule a forced immediate check by submitting a core command. Both commands could be placed in a bash script, for example:
Make the script executable:
and run it:
This will add a host named "testapihost", and will scheduled a forced immediate check on it.
Code: Select all
#!/bin/bash
curl -XPOST "http://x.x.x.x/nagiosxi/api/v1/config/host?apikey=xxx&pretty=1" -d "host_name=testapihost&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"
curl -XPOST "http://x.x.x.x/nagiosxi/api/v1/system/corecommand?apikey=xxx" -d "cmd=SCHEDULE_FORCED_HOST_CHECK;localhost"Code: Select all
chmod +x myscript.shCode: Select all
./myscript.shBe sure to check out our Knowledgebase for helpful articles and solutions!