added the option 'url' in the 'nginx' graph to define a full URL to be used to collect stats

This commit is contained in:
Jordi Sanfeliu 2014-03-17 13:02:33 +01:00
parent 327aee563e
commit 62c730dd85
2 changed files with 8 additions and 1 deletions

View File

@ -147,7 +147,13 @@ sub nginx_update {
$ssl = "ssl_opts => {verify_hostname => 0}" $ssl = "ssl_opts => {verify_hostname => 0}"
if lc($config->{accept_selfsigned_certs}) eq "y"; 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 $ua = LWP::UserAgent->new(timeout => 30, $ssl);
my $response = $ua->request(HTTP::Request->new('GET', $url)); my $response = $ua->request(HTTP::Request->new('GET', $url));
my $rrdata = "N"; my $rrdata = "N";

View File

@ -322,6 +322,7 @@ secure_log_date_format = %b %e
# NGINX graph # NGINX graph
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
<nginx> <nginx>
url = http://localhost/nginx_status
port = 80 port = 80
rule = 24100 rule = 24100
rigid = 0, 0, 0 rigid = 0, 0, 0