Package: munin-node
Severity: normal
Version: 1.4.5-3
Tags: patch

The documentation in the beginning of the script claims that the default
url is "env.url http://localhost/nginx_status";. This is a great default,
fits most uses, matches nginx_status, etc. However this isn't what the
script actually does. Instead of localhost it uses the fqdn as the
default address: 

chomp(my $fqdn=`hostname -f 2>/dev/null | hostname`);
my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://$fqdn/nginx_status";;

This causes the plugin to fail when configured as documented on machines
where fqdn does not point to 127.0.0.1. The attached patch fixes this,
and also massively optimizes the script by removing the useless call to
hostname.

-- 
Arto Jantunen

diff -ur munin-1.4.6.orig/plugins/node.d/nginx_request.in munin-1.4.6/plugins/node.d/nginx_request.in
--- munin-1.4.6.orig/plugins/node.d/nginx_request.in	2012-03-14 12:50:44.570116206 +0200
+++ munin-1.4.6/plugins/node.d/nginx_request.in	2012-03-14 12:50:54.482306537 +0200
@@ -61,9 +61,7 @@
 	$ret = "LWP::UserAgent not found";
 }
 
-chomp(my $fqdn=`hostname -f 2>/dev/null | hostname`);
-
-my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://$fqdn/nginx_status";;
+my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://localhost/nginx_status";;
 my $port = exists $ENV{'port'} ? $ENV{'port'} : "80";
 
 if ( exists $ARGV[0] and $ARGV[0] eq "autoconf" )

Reply via email to