Guided reading | This article explains the cause and solution of "ERROR Cannot fetch deployment URL via curl: Couldn't resolve host. The given remote host was not resolved.". |
check_mk is a tool to help you configure nagios monitoring server. Then when configuring one of the machines, I got the following error:
ERROR Cannot fetch deployment URL via curl:Couldn't resolve host。The given remote host was not resolved。
The error occurs when I try to register the machine with the monitoring server using the following command:
root@kerneltalks# /usr/bin/cmk-update-agent register -s monitor.kerneltalks.com -i master -H `hostname` -p http -U omdadmin -S ASFKWEFUNSHEFKG -v
in:
-s specifies the monitoring server -i specifies the name of the Check_MK site on the server -H specifies the hostname where the agent is located -p is the protocol, which can be http or https (default is https) -U User ID that is allowed to download the agent -S is the password. The user's auto action password (when an auto user)
As you can see from the error, the command cannot resolve the DNS name monitor.kerneltalks.com for the monitoring server.
solution:
Super easy. Check /etc/resolv.conf to make sure your DNS is configured correctly. If that doesn't solve the problem then you can specify its IP directly in /etc/hosts.
root@kerneltalks# cat /etc/hosts 10.0.10.9 monitor.kerneltalks.com
That's it. You can now successfully register.
root@kerneltalks # /usr/bin/cmk-update-agent register -s monitor.kerneltalks.com -i master -H `hostname` -p http -U omdadmin -S ASFKWEFUNSHEFKG -v Going to register agent at deployment server Successfully registered agent for deployment. You can now update your agent by running 'cmk-update-agent -v' Saved your registration settings to /etc/cmk-update-agent.state.
Alternatively, you can also specify the IP address directly for -s, and you won't have much trouble!
Author: kerneltalks Translator: lujun9972 Proofreading: wxy
This article is originally compiled by LCTT , and launched by Linux China with honor
The original text comes from: http://www.linuxprobe.com/fix-check-error.html