From 80efbfe69bdeb19848df59a91102c944efe51424 Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Tue, 5 May 2020 09:37:00 +0200 Subject: [PATCH] fixed the HTTP built-in responsiveness check to use the value of the option 'host' #278 --- monitorix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monitorix b/monitorix index cb1cd23..728605c 100755 --- a/monitorix +++ b/monitorix @@ -867,7 +867,8 @@ while(1) { use LWP::UserAgent; my $pid = fork(); if(!$pid) { - my $url = "http://localhost:" . $config{httpd_builtin}->{port} . $config{base_url}; + my $host = $config{httpd_builtin}->{host} ? $config{httpd_builtin}->{host} : "localhost"; + my $url = "http://" . $host . ":" . $config{httpd_builtin}->{port} . $config{base_url}; my $ua = LWP::UserAgent->new(timeout => 30); my $response = $ua->request(HTTP::Request->new('GET', $url)); if(!$response->is_success) {