diff --git a/lib/nginx.pm b/lib/nginx.pm index c352313..789a9f4 100644 --- a/lib/nginx.pm +++ b/lib/nginx.pm @@ -147,7 +147,13 @@ sub nginx_update { $ssl = "ssl_opts => {verify_hostname => 0}" if lc($config->{accept_selfsigned_certs}) eq "y"; - my $url = "http://127.0.0.1:" . $nginx->{port} . "/nginx_status"; + my $url; + + if($nginx->{url}) { + $url = $nginx->{url}; + } else { + $url = "http://127.0.0.1:" . $nginx->{port} . "/nginx_status"; + } my $ua = LWP::UserAgent->new(timeout => 30, $ssl); my $response = $ua->request(HTTP::Request->new('GET', $url)); my $rrdata = "N"; diff --git a/monitorix.conf b/monitorix.conf index d054ca6..67cf900 100644 --- a/monitorix.conf +++ b/monitorix.conf @@ -322,6 +322,7 @@ secure_log_date_format = %b %e # NGINX graph # ----------------------------------------------------------------------------- + url = http://localhost/nginx_status port = 80 rule = 24100 rigid = 0, 0, 0