Forum

[status] => 404

Martin
24 March 2018, 13:14
Greetings Hugo, I can not manage the monitor for
get my servers up and running.

I set up servers that are to be read out via HTTP / 80,
I get no error when running fetch_webserver_logs
In the table 'events' I see a nonspecific error entry.
I also see that a connection is being set up on the server to be read,
but there is no transmission. I get the data from GET (print_r ($ result);)
I see a 404.

Array
(
[status] => 404
[headers] => Array
(
[date] => Sat, 24 Mar 2018 11:56:52 GMT
[connection] => close
[content-length] => 782
[content-type] => text/html
)

[body] => <!DOCTYPE html>
<html>
<head>
<title>404 - Not Found</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
body { background-color:#d0d0d0; font-family:sans-serif; padding:0 30px }
div { background-color:#f8f8f8; letter-spacing:4px; max-width:400px; margin:100px auto 0 auto; padding:50px; border-radius:10px; border:1px solid #808080; box-shadow:8px 15px 20px #404040 }
h1 { margin:0; font-size:22px; font-weight:normal }
p { margin:10px 0 0 0; padding-top:2px; font-size:14px; color:#606060; border-top:1px solid #a0a0ff; text-align:right; font-weight:bold }
@media (max-width:767px) { h1 { font-size:90%; letter-spacing:2px } p { font-size:70% } }
</style>
</head>
<body>
<div>
<h1>Not Found</h1>
<p>404</p>
</div>
</body>
</html>
)



Do I have to go to the destination server except the monitor server IP address
and the optional work directory set something else?

Best regards!
Martin

Hugo Leisink
25 March 2018, 21:18
In the configuration of the webservers you wish to monitor, did you set the MonitorServer setting?
Martin
26 March 2018, 09:32
Yes, sure.
# MONITOR SETTINGS
#
MonitorServer = 137.xxx.xxx.xxx
WorkDirectory = /var/lib/hiawatha


I also see that under /var/lib/hiawatha in the directories "gzipped" and "monitor" hiawatha generate lots of zipped files. The folder "upload" is empty.
Hugo Leisink
26 March 2018, 17:50
When the monitor server with IP 137.xxx.xxx.xxx connects to your webserver, does that webserver see 137.xxx.xxx.xxx as its IP address? Or is it hidden via some firewall or reverse proxy?
Martin
26 March 2018, 20:40
Once "fetch_webserver_logs" runs manually or per cron,
I see a connection on the web server for about a minute:

Every 1,0s: netstat -t -n | grep 137.xxx.xxx.xxx

tcp 0 0 37.xxx.xxx.xxx:80 137.xxx.xxx.xxx:55538 TIME_WAIT


The servers communicate directly with each other. There is no reverse proxy.
Port 80 is open in the firewall. Even with the firewall turned off
I return a 404. The web servers are productive and under load.
The monitor server can also be operated via a browser and runs on itself
problem-free - only that just no data arrive.

...
<title>404 - Not Found</title>
...
<h1>Not Found</h1>
<p>404</p>
...
Hugo Leisink
27 March 2018, 12:36
On your Monitor server, edit your /etc/hosts file and give one of the IP addresses of your webservers the hostname 'monitor'. Browse http://monitor/ via a command line browser like Links. What do you see?
Martin
30 March 2018, 15:41
w3m http://monitor

404
Not found


Must I except the two entries

MonitorServer = 137.xxx.xxx.xxx
WorkDirectory = /var/lib/hiawatha


in hiawatha.conf
to change sowthing of the target-web-server?
Direct access to the IP via http://37.xxx.xxx.xxx
leads default into nothing.

set IPv4=37.xxx.xxx.xxx

# DEFAULT WEBSITE
#
Hostname = IPv4
WebsiteRoot = /var/www/nothing
ErrorLogfile = /var/log/www/error.log
AccessLogfile = /dev/null
UseFastCGI = PHP7


My understanding of web server behavior is that
he, as soon as a request comes from the IP of the MonitorServer,
he answers these, regardless of the defined WebsiteRoot, not?

All websites of the productive servers are integrated via vhost directive.
About the IP address, none of these websites can be reached.

The conf entries in the README.md refer to the website of the monitor server, not?
That works fine at least.

Best regards!
Martin

Hugo Leisink
31 March 2018, 16:14
I'm a bit confused about what you're doing exactly. I'll describe what you need to do to set up the monitoring tool.

- Install the Monitoring tool. Make it accessible by all webservers you want to monitor.
- In the web servers you want to monitor, set the MonitorServer setting with the IP address of the Monitor server. Restart those webservers. Those webservers will now collect information for the monitor server. They will all have an internally defined virtual host with the hostname 'monitor', only accessible from the monitor server's IP address.
- In the Hiawatha Monitor, enter the IP addresses of the web servers you want to monitor in the Webserver Administration CMS page.
Martin
31 March 2018, 21:41
I'm sorry for my bad english.
What you describe is exactly what I did.
The internal vhost 'monitor' from the webservers is with 404 unreachable.
But all webservers generate data for the monitor (/var/lib/hiawatha/monitor/[1-9]{10}.txt.gz)

./hiawatha -m

Enabled modules: Cache, ChallengeClient, FileHashes, IPv6, Monitor, ReverseProxy, TLS v2.7.0, ThreadPool, UrlToolkit


The Monitor-Server is accessible from the webservers.

w3m monitor.servername.de

Hiawatha Monitor

Login
...


I do not remember where to find the mistake.
Hugo Leisink
31 March 2018, 22:57
Since you entered an IPv4 address for MonitorServer, the webservers expect an IPv4 incoming connection. In the Hiawatha Monitor, did you enter IPv4 addresses or hostnames? It could be that a hostname resolves to an IPv6 address, which causes the 404.
Martin
3 April 2018, 19:40
I enter IPv4 adresses in the CMS.
With command 'netstat' I see that the request also arrive with an IPv4 adress
(see my post from 26.03. / 20:40).

Further, I realized that it makes no difference whether the entry
'MontitorServer=137.xxx.xxx.xxx' in the 'hiawatha.conf' is activated or
commented out. It is always 404 reported back. As if the internal vhost
'monitor' was not created in the web server.
Hugo Leisink
4 April 2018, 09:01
If Hiawatha doesn't complain about the MonitorServer setting, I'm sure the Monitor module is included and an internal virtual host with the name 'monitor' is created. You can verify by using 'hiawatha -m', it should have a 'Monitor' element.

Since I can't look at your system to see what might causes it, I have no idea what goes wrong. What version of Hiawatha and the Monitor are you using?
This topic has been closed.