example host delete api call claims to work, appears not to
Posted: Tue Feb 07, 2017 11:57 am
I'm running nagiosxi 5.3.2 on rhel 6.8 64bit, manual install of nagiosxi
I've written some tests for creating hosts / services via the rest api, and that seems to be working fine.
When I try to delete services or hosts, the api claims that the hosts/services are removed, but they continue to appear in the nagiosxi ui. I tried following along with the example code in the api doc provided from in the product.
[lukas@nagiosxi-60ox ~]$ curl -k -XPOST "https://nagiosxi-60ox.noc.harvard.edu/n ... d&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"
{
"success": "Successfully added testapihostapply to the system. Config applied, Nagios Core was restarted."
}
[lukas@nagiosxi-60ox ~]$ curl -k -XDELETE "https://nagiosxi-60ox.noc.harvard.edu/n ... lyconfig=1"
{
"success": "Removed testapihostapply from the system. Config applied, Nagios Core was restarted."
}
the host is not actually removed from nagiosxi.
Is there something that I'm missing? The user whose api key I'm using above has admin access.
The host has no services associated, it is not a member of any hostgroup. It's about as simple a case as you can get.
thanks,
-Luke
I've written some tests for creating hosts / services via the rest api, and that seems to be working fine.
When I try to delete services or hosts, the api claims that the hosts/services are removed, but they continue to appear in the nagiosxi ui. I tried following along with the example code in the api doc provided from in the product.
[lukas@nagiosxi-60ox ~]$ curl -k -XPOST "https://nagiosxi-60ox.noc.harvard.edu/n ... d&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"
{
"success": "Successfully added testapihostapply to the system. Config applied, Nagios Core was restarted."
}
[lukas@nagiosxi-60ox ~]$ curl -k -XDELETE "https://nagiosxi-60ox.noc.harvard.edu/n ... lyconfig=1"
{
"success": "Removed testapihostapply from the system. Config applied, Nagios Core was restarted."
}
the host is not actually removed from nagiosxi.
Is there something that I'm missing? The user whose api key I'm using above has admin access.
The host has no services associated, it is not a member of any hostgroup. It's about as simple a case as you can get.
thanks,
-Luke