check_cisco_free_interfaces.pl
Posted: Thu Aug 02, 2018 3:48 am
When I try to execute the script error "Interface Ethernet not found on the device 10.0.27.9", but I put the script in another machine can perform normal, that is the environment causes, but don't know how to check for this environment.I find this script is nagios official script, request to provide support, thank you.
if (find_match() == 0){
$nb_if_libre = 0;
$count = 1;
while ($count < ($#target_interface_index + 1)) {
if (probe_interface() == 1) {
$nb_if_libre = $nb_if_libre + 1;
}
$count = $count + 1 ;
}
if ($nb_if_libre > $warning) {
$status = 0;
$returnstring = "$nb_if_libre interfaces libres sur le switch";
}
else {
if ($nb_if_libre > $critical) {
$status = 1;
$returnstring = "$nb_if_libre interfaces libres sur le switch";
}
else {
$status = 2;
$returnstring = "$nb_if_libre interfaces libres sur le switch";
}
}
}
else {
$status = 2;
print "Interface $target_interface not found on device $hostname\n";
exit $status;
}
if (find_match() == 0){
$nb_if_libre = 0;
$count = 1;
while ($count < ($#target_interface_index + 1)) {
if (probe_interface() == 1) {
$nb_if_libre = $nb_if_libre + 1;
}
$count = $count + 1 ;
}
if ($nb_if_libre > $warning) {
$status = 0;
$returnstring = "$nb_if_libre interfaces libres sur le switch";
}
else {
if ($nb_if_libre > $critical) {
$status = 1;
$returnstring = "$nb_if_libre interfaces libres sur le switch";
}
else {
$status = 2;
$returnstring = "$nb_if_libre interfaces libres sur le switch";
}
}
}
else {
$status = 2;
print "Interface $target_interface not found on device $hostname\n";
exit $status;
}