Check Array vis snmpwalk no Status information

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;
}
}

Ok !
Iā€™m resolved !
Iā€™ve created the plugin with bash shellā€¦
itā€™s okā€¦

Bye !