我必须从 nagios 中删除自定义 HTTP 检查,因此在两个文件中注释了 check_http 部分,即 1.commands.cfg 2.services.cfg
但是,当我重新启动服务器时,出现以下错误。
Checking objects...
Error: Service check command 'check_http' specified in service 'HTTP' for host 'localhost' not defined anywhere!
Checked 225 services.
Checked 66 hosts.
Checked 11 host groups.
Checked 6 service groups.
Checked 16 contacts.
Checked 21 contact groups.
Checked 29 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 66 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
因此请协助解决此问题。
答案1
..但您还没有将其从主机配置中删除。如果某项服务与一个或多个主机相关联,那么您还需要从这些主机中删除该服务,否则您将收到类似的错误。
错误:服务“HTTP”中为主机“localhost”指定的服务检查命令“check_http”未在任何地方定义!
正如错误中明确提到的,您已为主机配置了此服务localhost
。因此,请检查文件(localhost.cfg 或 hosts.cfg),删除 HTTP 服务并重新启动 nagios。