Opened 21 months ago

#1123 new defect

munin-fastcgi-graph fails to parse services with an extra - in them

Reported by: williamt Owned by: nobody
Priority: normal Milestone: Munin 1.4.7
Component: plugins Version: 1.4.5
Severity: normal Keywords:
Cc:

Description

Using such plugins like: https://github.com/kjellm/munin-mysql/
allows you to monitor multiple mysql instances. Your plugin name looks like: mysql_foo
and the graph it creates looks like bin_relay_log-foo. However when the scale gets attached
to that it will be named bin_relay_log-foo-day.png. Munin builds the rrds just fine but the fastcgi
graph fails to parse the name and fails with an error of "Weird scale foo-day". This patch fixes it.
I believe the same thing should be applied to muning-cgi-graph as well.

# diff -u /var/www/html/munin/cgi/munin-fastcgi-graph.fcgi.orig    /var/www/html/munin/cgi/munin-fastcgi-graph.fcgi
--- /var/www/html/munin/cgi/munin-fastcgi-graph.fcgi.orig	2011-08-23 10:07:11.202004345 -0700
+++ /var/www/html/munin/cgi/munin-fastcgi-graph.fcgi	2011-08-23 10:25:15.118379059 -0700
@@ -72,7 +72,7 @@
     my $path = $ENV{PATH_INFO} || "";
     $path =~ s/^\///;
     ($dom, $host, $serv) = split /\//, $path;
-    ($serv, $scale) = split /-/, $serv, 2;
+    ($serv, $scale) = split /-(?!.*-)/, $serv, 2;
     $scale =~ s/\.png$//;
   
     if (! &verify_parameters ($dom, $host, $serv, $scale)) {

Change History (0)

Note: See TracTickets for help on using tickets.