monitoringartist / dockbix-agent-xxl

:whale: Dockerized Zabbix agent with Docker metrics and host metrics support for CoreOS, RHEL, CentOS, Ubuntu, Debian, Fedora, Boot2docker, Photon OS, Amazon Linux, ...
https://hub.docker.com/r/monitoringartist/dockbix-agent-xxl-limited/
Other
182 stars 54 forks source link

net.tcp.service is cannot resolve dns names #24

Closed zbence closed 7 years ago

zbence commented 7 years ago

I try to monitor web pages with this agent and I can't make it work with DNS names. With IP addresses it works like a charm.

13:20170302:140616.538 Requested [net.tcp.service[http,www.google.com,80]] 13:20170302:140616.538 TCP expect network error: cannot resolve [www.google.com]

The container is on a custom network, other containers can resolve dns names on that network.

Any idea what cause this issue?

jangaraj commented 7 years ago

Readme says: --net=host. Sorry, if you are using custom network, then I can't help you.

zbence commented 7 years ago

I don't want to create new issue for this so I just post my update here:

I put the agent to the host network but still it can't resolve DNS names. So do you know something about this?

jangaraj commented 7 years ago

No problem:

[root@dockerhost ~]# zabbix_get -s 127.0.0.1 -k web.page.get[www.zabbix.com,index.php,80]
zabbix_get [38383]: Get value error: cannot connect to [[127.0.0.1]:10050]: [111] Connection refused
[root@dockerhost ~]# docker run \
>   --name=dockbix-agent-xxl \
>   --net=host \
>   --privileged \
>   -v /:/rootfs \
>   -v /var/run:/var/run \
>   --restart unless-stopped \
>   -e "ZA_Server=<ZABBIX SERVER IP/DNS NAME>" \
>   -e "ZA_ServerActive=<ZABBIX SERVER IP/DNS NAME>" \
>   -d monitoringartist/dockbix-agent-xxl-limited:latest
d606684abd52051fc34c3126572eba31bf95551eac6aac0b5e294682505b5f3b
[root@dockerhost ~]# zabbix_get -s 127.0.0.1 -k web.page.get[www.zabbix.com,index.php,80]                                                                               HTTP/1.1 301 Moved Permanently
Date: Thu, 02 Mar 2017 21:02:38 GMT
Server: Apache/2.4.10 (Debian)
Location: http://www.zabbix.com/index
Content-Length: 315
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.zabbix.com/index">here</a>.</p>
<hr>
<address>Apache/2.4.10 (Debian) Server at www.zabbix.com Port 80</address>
</body></html>

Increase debuglevel and provide logs please https://github.com/monitoringartist/dockbix-agent-xxl#support

zbence commented 7 years ago

I didn't try to use web.page.get key because of this: 11:20170303:081027.294 Requested [web.page.get[www.zabbix.com,index.php,80]] 11:20170303:081027.294 Sending back [ZBX_NOTSUPPORTED: Unsupported item key.]

But with the net.tcp.service shows the same: 12:20170303:081145.801 Requested [net.tcp.service[http,www.zabbix.com/index.php,80]] 12:20170303:081145.801 TCP expect network error: cannot resolve [www.zabbix.com/index.php] 12:20170303:081145.801 Sending back [0]

jangaraj commented 7 years ago

Increase debuglevel and provide logs please https://github.com/monitoringartist/dockbix-agent-xxl#support

zbence commented 7 years ago

Ok after I started the container like you pasted here it works. I was on an older version of agent which was: monitoringartist/zabbix-agent-xxl-limited:latest