We've automated our nagios monitoring using a variety of scripts, mainly written in python, and it appears to be working correctly.
However, we're running into an issue when a host needs to be removed.
The logic is, if a service gets deleted, and that is the last service on that host, delete the host as well. Simple.
Here, we find that host is never deleted correctly, throwing the following error:
Code: Select all
{
"error": "Host cannot be deleted using this method. Must be deleted through the CCM."
}
Code: Select all
time.sleep(5)Is this an issue with the host delete API being called to quick after service delete is called? I'm guessing it doesn't have the time to remove all service information correctly from the DB and throws a dependency error?
Please advise what's the best course of actions to take here. Having a delay of a couple of seconds isn't an issue but isn't ideal. Just wanted to check if this is the best solution for now?
Regards,