Hi,
I've modified the script to actual purposes on megaraid-Section.
It was:
Code:
sub check_megacli {
my @CMD = ($megacli, '-PDList', '-aALL', '-NoLog');
unshift(@CMD, $sudo) if $> and $sudo;
Megacli requires a Kernel version <=2.6, so it won't work on an actual Ubuntu release with 3.2 Kernel. I modified the script as follow, which works fine on 2.6 and 3.x kernel.
Code:
sub check_megacli {
my @CMD = ($megacli, '-PDList', '-aALL', '-NoLog');
my $file = "/proc/version";
open my $fha, ,'<', $file or die "Not found: $!\n";
my @ver = <$fha>;
close $fha;
foreach my $line (@ver) {
if ($line =~ /^Linux version 3\..*$/i) {
@CMD = ('setarch', 'x86_64', '--uname-2.6', $megacli, '-PDList', '-aALL', '-NoLog');
}
}
unshift(@CMD, $sudo) if $> and $sudo;
Regards
Wolfgang