Does not work on Ubuntu 16.04.1

Asked by deti

The mrtg-rrd package provided with Ubuntu 16.04.1 contains a non working script whicht results in an empty web page and this error:
H01215: Can't use an undefined value as an ARRAY reference at /usr/lib/cgi-bin/mrtg-rrd.cgi line 911.: /usr/lib/cgi-bin/mrtg-rrd.cgi

The problem seems to be caused by the new perl version and can be fixed by this patch:

--- /usr/lib/cgi-bin/mrtg-rrd.cgi 2015-08-02 13:20:11.000000000 +0200
+++ /usr/lib/cgi-bin/mrtg-rrd.cgi 2016-08-31 11:21:19.540540237 +0200
@@ -496,7 +496,7 @@
 {
  my ($name, $target, $q) = @_;

- return @{$target->{args}} if @{$target->{args}};
+ return @{$target->{args}} if ($target->{args} && @{$target->{args}});

  my $noi = 1 if $target->{options}{noi};
  my $noo = 1 if $target->{options}{noo};
@@ -908,7 +908,7 @@
  print $directories{$dir}{bodytag};

  my $subdirs_printed;
- if (@{$directories{$dir}{subdir}}) {
+ if ($directories{$dir}{subdir} && @{$directories{$dir}{subdir}}) {
   $subdirs_printed = 1;
   print <<EOF;
 <H1>MRTG subdirectories in the directory $dir1</H1>

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu mrtg-rrd Edit question
Assignee:
No assignee Edit question
Solved by:
deti
Solved:
Last query:
Last reply:
Revision history for this message
deti (deti) said :
#1

Filed a real bug.