bindgraph fejler på Debian 8 Jessie

Bindgraph virker af en eller anden grund ikke i Debian 8 (Jessie)

  •  apt-get install bindgraph

Det virker fint at installere men der kommer nogle syslog parser fejl hvis man prøver at starte bindgraph.pl

  • ./usr/sbin/bindgraph.pl
* Starting DNS Statistics /usr/sbin/bindgraph.pl Prototype mismatch: sub Parse::Syslog::str2time ($$$$$$$) vs ($$$$$$$$) at /usr/share/perl5/Parse/Syslog.pm line 121.
Subroutine str2time redefined at /usr/share/perl5/Parse/Syslog.pm line 66.
Subroutine new redefined at /usr/share/perl5/Parse/Syslog.pm line 138.
Subroutine _next_line redefined at /usr/share/perl5/Parse/Syslog.pm line 206.
Subroutine next redefined at /usr/share/perl5/Parse/Syslog.pm line 388.
Not enough arguments for Parse::Syslog::str2time at /usr/sbin/bindgraph.pl line 264, near "})"
BEGIN not safe after errors--compilation aborted at /usr/sbin/bindgraph.pl line 282.

For at rette dette kan man gøre følgende.

  • nano /usr/sbin/bindgraph.diff

indsæt følgende

--- /usr/sbin/bindgraph.pl	2006-05-11 01:31:02.000000000 +0200
+++ bindgraph.pl	2015-07-27 22:46:00.344293427 +0200
@@ -20,7 +20,7 @@
 # I'm embedding Parse::Syslog not to help lazy admins but because BIND
 # logs cannot be parsed by the standard version.
 
-package Parse::Syslog;
+package Parse::BgSyslog;
 
 use Carp;
 use Symbol;
@@ -222,7 +222,7 @@
 # this code parses the querylog of BIND 9.3
 
 package Parse::Log::Bind93;
-use base qw(Parse::Syslog);
+use base qw(Parse::BgSyslog);
 use Carp;
 
 sub next($)
@@ -260,7 +260,7 @@
 		$self->{_last_mon} = $mon;
 
 		# convert to unix time
-		my $time = Parse::Syslog::str2time($ss, $mm, $hh, $d, $mon,
+		my $time = Parse::BgSyslog::str2time($ss, $mm, $hh, $d, $mon,
 			$self->{year}-1900, $self->{GMT});
 
 		return [
@@ -350,7 +350,7 @@
 		}
 		$parser = new Parse::Log::Bind93(@parser_args);
 	} elsif ($opt{format} and $opt{format} eq 'bind92') {
-		$parser = new Parse::Syslog(@parser_args);
+		$parser = new Parse::BgSyslog(@parser_args);
 	} else {
 		print STDERR "Unknown log format '$opt{format}'.\n";
 		exit 1;

Patch nu din bindgraph

  • cd /usr/sbin
  • patch -p0 < bindgraph.diff

Det var det du kan nu starte din bindgraph service.

Jeg kan desværre ikke huske hvilket forum jeg fandt patch koden på.