Check Array vis snmpwalk no Status information


#1

Hi ! :frowning:

please help me ! VERY URGENT !!!
I’ve created a check for test status of array. I’ve used an preexistent file writ on PERL.
This chek working very fine when I lunch it via prompt, fromm root and nagios user end the response is :

OK :Array-B Logical drive normal operation mode

But I cannot to display this on Status information of nagios…

HELP HELP HELP PLEASE ! I’am not a PERL guru… :frowning:

Thanks !!!


#!/usr/bin/perl -w
$IP=$ARGV[0];

per hp dl360g5 con p400i

$resultat =snmpwalk -v 1 -c sgdnoc -On $IP .1.3.6.1.4.1.232.3.2.3.1.1.4.2.2;

if ( $resultat ) {
@pourcentage = split (/\n/,$resultat);

Getting Individual Value

    foreach ( @pourcentage ) {
    s/.1.3.6.1.4.1.232.3.2.3.1.1.4.2.2 = [INTEGER://g;](INTEGER://g;)
    $status=$_;

print “$status” ;

    }

} else {
print “Unknown : No response\n”;
exit;
}
if ($status == 2) {
print “OK :Array-B Logical drive normal operation mode\n”;
exit 0;
}
if ($status == 4) {
print “WARNING : Array-B Logical drives not configured \n”;
exit 2;
}
}


#2

Ok !
I’m resolved !
I’ve created the plugin with bash shell…
it’s ok…

Bye !