diff --git a/Documentation/REST-API/Resources-Monitor.md b/Documentation/REST-API/Resources-Monitor.md index 49988c8e3..b8e16c2db 100644 --- a/Documentation/REST-API/Resources-Monitor.md +++ b/Documentation/REST-API/Resources-Monitor.md @@ -366,7 +366,7 @@ Invalid JSON body: ### Destroy a monitor ``` -DELETE /v1/monitors/:name/stop +DELETE /v1/monitors/:name ``` Destroy a created monitor. The monitor must not have relationships to any diff --git a/maxctrl/lib/show.js b/maxctrl/lib/show.js index 1b53c2321..8805ad60c 100644 --- a/maxctrl/lib/show.js +++ b/maxctrl/lib/show.js @@ -122,6 +122,11 @@ const service_fields = [ path: 'relationships.servers.data[].id', description: 'Servers that the service uses' }, + { + name: 'Filters', + path: 'relationships.filters.data[].id', + description: 'Filters that the service uses' + }, { name: 'Parameters', path: 'attributes.parameters', diff --git a/server/core/config_runtime.cc b/server/core/config_runtime.cc index d87773abb..9e994d77b 100644 --- a/server/core/config_runtime.cc +++ b/server/core/config_runtime.cc @@ -1352,7 +1352,11 @@ bool runtime_destroy_monitor(Monitor* monitor) { bool rval = false; - if (Service* s = service_uses_monitor(monitor)) + if (!monitor->servers().empty()) + { + config_runtime_error("Cannot destroy monitor '%s', it is monitoring servers.", monitor->name()); + } + else if (Service* s = service_uses_monitor(monitor)) { config_runtime_error("Monitor '%s' cannot be destroyed as it is used by service '%s'", monitor->name(), s->name());