mikaku / Monitorix

Monitorix is a free, open source, lightweight system monitoring tool.
https://www.monitorix.org
GNU General Public License v2.0
1.12k stars 167 forks source link

Monitor log-file is filling up with WARNING: unable to connect to HTTP built-in server 'http://localhost:8080/monitorix'. #257

Closed Sweepr closed 5 years ago

Sweepr commented 5 years ago

Logfile is filling up with this:

Tue Oct 22 10:59:00 2019 - WARNING: unable to connect to HTTP built-in server 'http://localhost:8080/monitorix'. Tue Oct 22 10:59:00 2019 - Restarted HTTP built-in server (pid 5409). HTTPServer: You can connect to your server at http://localhost:8080/

curl -v localhost:8080/monitorix

I have Auth enabled, is that the reason ?

How can i prevent the logfile filling up with this warning?

mikaku commented 5 years ago

Hi,

I have Auth enabled, is that the reason ?

Yes, it has been fixed in the #249 issue.

How can i prevent the logfile filling up with this warning?

You might want to download the latest monitorix version and overwrite your own, if you don't want to wait for the next Monitorix release.

Thanks.

Sweepr commented 5 years ago

:+1: Great, thnx.. ! closing

atomGit commented 4 years ago

i'm getting essentially the same thing, except i'm running on :8088...

HTTPServer: You can connect to your server at http://localhost:8088/
Thu Jan  2 06:41:01 2020 - WARNING: unable to connect to HTTP built-in server 'http://localhost:8088/monitorix'.
# lsof -i:8088
COMMAND     PID   USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
monitorix 11231 nobody    3u  IPv4 1076896446      0t0  TCP *:radan-http (LISTEN)
Name        : monitorix
Arch        : noarch
Version     : 3.11.0
Release     : 1.el7
Size        : 1.8 M
Repo        : installed
From repo   : epel
mikaku commented 4 years ago

@atomGit, yes this has already been fixed in the development version, so it will be fixed in the next release of Monitorix.

As I said, if you don't want to wait for the next version, you might want to download the latest monitorix version and overwrite your own.

Thanks.

atomGit commented 4 years ago

oh, i'm sorry, i mistakenly thought it was fixed in 3.11.0

JackySw commented 11 months ago

I got v3.15.0 but also still this problem.

WARNING: HTTP built-in server not responding at 'http://myserver.com:8090/monitorix'.

But the URL is 100% correct and responsive. What could be it?

The httpd server always becomes unresponsive after 3 or 4 days or so. I cannot figure out why and this auto responsive check could fix it in the time-being.

mikaku commented 11 months ago

I've the latest version (perl-HTTP-Server-Simple-0.52-21.fc39.noarch) and I almost don't see this message except on very sporadic times when this web server is somehow abused from an outside script.

Are you using the latest version of this Perl module?

JackySw commented 11 months ago

Thank you. Yes, I got 0.52.

JackySw commented 11 months ago

Ok, this is interesting. I got:

<httpd_builtin>
...
hosts_allow = localhost, 127.0.0.1, 123.123.123.123
autocheck_responsiveness = y
....
</httpd_builtin>

Assuming this would be ok for IP access for localhost and myself. But it seems that the autocheck responsiveness cannot be performed because the result from checking the URL still gives a 403 access forbidden response. So instead of 'localhost' I added the IP address of the server in _hostsallow and now it works.

Interesting. Is this the behavior that was intended?

Sweepr commented 11 months ago

127.0.0.1 is the IP address assigned to the "loopback" or local-only interface. This is a "fake" network adapter that can only communicate within the same host. It's often used when you want a network-capable application to only serve clients on the same host. A process that is listening on 127.0.0.1 for connections will only receive local connections on that socket.

"localhost" is normally the hostname for the 127.0.0.1 IP address. It's usually set in /etc/hosts, you can use it just like any other hostname, try pinging localhost and see how it resolves to 127.0.0.1.

mikaku commented 11 months ago

Well, if the host option in <httpd_builtin> is not defined, then it should bind Monitorix to all interfaces (including localhost).

Please, check with netstat -ltnp or ss -ltnp if your Monitorix web server is correctly bound to 0.0.0.0.

JackySw commented 11 months ago

Thanks Sweepr for explaining this. Mikaku, no it is not bound to 0.0.0.0. I do indeed use the host option.

mikaku commented 11 months ago

@JackySw: so it's all fixed now?

JackySw commented 11 months ago

For me it works now, thank you. If this is how it was supposed to be, all fine! Thanks for the support and the great tool Monitorix is that you've created.

mikaku commented 11 months ago

I've seen that in some systems binding to 0.0.0.0 does not always work for some reason. Maybe this is your case. Anyway, glad to know you managed to solve it, and also glad you are enjoying Monitorix.