tags #636134 - patch
thanks

Hi Tim,

thanks for your patch. However, munin has evolved quite a bit in the
last months, and your patch doesn't apply any more to the current
development status which is already in Debian experimental.

The munin team would appeciate you checking out
svn://munin-monitoring.org/munin/trunk
and looking into ./plugins/node.d/hddtemp_smartctl.in. A tested patch
against that version will be quickly applied.

On Sun, Jul 31, 2011 at 02:06:29PM +0100, Tim Small wrote:
> @@ -141,7 +166,7 @@
>    my @drivesSCSI;
>    if (-d '/sys/block/') {
>      opendir(SCSI, '/sys/block/');
> -    @drivesSCSI = grep /sd[a-z]/, readdir SCSI;
> +    @drivesSCSI = grep /sd[a-z]+/, readdir SCSI;
>      closedir(SCSI);
>     }

The current code does no longer refer to /sys/block

> @@ -185,7 +210,6 @@
>      }
>    } elsif ($ARGV[0] eq 'config') {
>      print "graph_title HDD temperature\n";
> -    print "graph_args --base 1000 -l 0\n";
>      print "graph_vlabel temp in °C\n";
>      print "graph_category sensors\n";
>      print "graph_info This graph shows the temperature in degrees Celsius of 
> the hard drives in the machine.\n";
> @@ -194,7 +218,14 @@
>    }
>  }

This is already fixed in svn.

> @@ -209,29 +240,88 @@
>    }
>  
>    my $cmd = command_for_drive_device($drive, $fulldev, $use_nocheck);
> -  warn "[DEBUG] Command for $drive is % $cmd %\n" if $DEBUG;
> +    $smartreaders{$drive}{'cmd'} = $cmd;
>  
> -  my $output = `$cmd`;
> -  if ($? ne 0) {
> -      print "$drive.value U\n";
> -      print "$drive.extinfo Command $cmd on drive $drive failed: $?.  The 
> plugin needs to have read permission on all monitored devices.\n";
> -      warn "[ERROR] Command $cmd on drive $drive failed: $?.  The plugin 
> needs to have read permission on all monitored devices.\n";
> -      next;
> +    # This did use perl's "open |-" syntax, but this didn't work in 5.8.0 :-(
> +    $smartreaders{$drive}{'fh'} = IO::File->new;
> +    $smartreaders{$drive}{'pid'} = 
> pipe_from_fork($smartreaders{$drive}{'fh'});
> +
> +    if ($smartreaders{$drive}{'pid'}) { # parent process
> +      # switch to non-blocking reading of the pipe
> +      use Fcntl;
> +      my $flags = 0;
> +      fcntl($smartreaders{$drive}{'fh'}, F_GETFL, $flags) or die "Couldn't 
> get flags for $smartreaders{$drive}{'fh'} : $!\n";

*snip*

I don't understand this (big) hunk at all, There must something be
wrong with the indentation.

The team would appreciate you submitting a patch against current svn.
Additionally, please submit your patches as e-mail attachment, those
are much easier to download and apply.

Thank you for spending time with creating the patch, and apologies for
not applying it right away.

Greetings
Marc



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to