API Config Service Ingnores check_command
Posted: Fri Aug 17, 2018 11:38 am
I have over 1,000 service checks to add to Nagios so I'm using the REST API to do it. I can successfully query the API for objects and even my curl command below generates a successful new service in CCM. However, each time I do this the check_command never seems to work. In the CCM, the check command box and the args boxes are blank. When I go to apply the config, it fails since the check_command is missing.
Are there any logs that would be helpful to provide or tail?
curl -XPOST "http://xxxx/nagiosxi/api/v1/config/serv ... x&pretty=1" -d "host_name=xxxx&service_description=Disk&check_command=check_nrpe_disk_space\!15%\!10%\!/apps&check_interval=15&retry_interval=4&max_check_attempts=3&check_period=xi_timeperiod_24x7&contacts=nagiosadmin¬ification_interval=5¬ification_period=xi_timeperiod_24x7&applyconfig=1"
{
"success": "Successfully added xxxx :: Disk to the system. Config applied, Nagios Core was restarted."
}
Are there any logs that would be helpful to provide or tail?
curl -XPOST "http://xxxx/nagiosxi/api/v1/config/serv ... x&pretty=1" -d "host_name=xxxx&service_description=Disk&check_command=check_nrpe_disk_space\!15%\!10%\!/apps&check_interval=15&retry_interval=4&max_check_attempts=3&check_period=xi_timeperiod_24x7&contacts=nagiosadmin¬ification_interval=5¬ification_period=xi_timeperiod_24x7&applyconfig=1"
{
"success": "Successfully added xxxx :: Disk to the system. Config applied, Nagios Core was restarted."
}