Page 1 of 1

check_cisco_free_interfaces.pl

Posted: Thu Aug 02, 2018 3:48 am
by yangzhiyao2653
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;
}

Re: check_cisco_free_interfaces.pl

Posted: Thu Aug 02, 2018 8:36 am
by scottwilkerson
Is this the whole plugin? It must be missing something

Re: check_cisco_free_interfaces.pl

Posted: Thu Aug 02, 2018 7:31 pm
by yangzhiyao2653
scottwilkerson wrote:Is this the whole plugin? It must be missing something
Attachment is the information of the plug-in, I believe that in the plug-in content is complete, because I was on another machine test can obtain monitoring data.

Re: check_cisco_free_interfaces.pl

Posted: Fri Aug 03, 2018 7:12 am
by scottwilkerson
the plugin is walking this oid and looking for an interface named "ethernet"

Code: Select all

.1.3.6.1.2.1.2.2.1.2
if it does not find one you get the error.

Have the Interfaces on this router been renamed to not include the word ethernet?

Re: check_cisco_free_interfaces.pl

Posted: Sat Aug 04, 2018 4:10 am
by yangzhiyao2653
I run snmpwalk found to get to this part of the information, will not do anything with Ethernet.But I found that because of the db offloading configuration of the machine can be located with db communication interfaces, and other units are eth1 as with db communication network card, it will have effect?

Re: check_cisco_free_interfaces.pl

Posted: Mon Aug 06, 2018 7:05 am
by scottwilkerson
if they are called eth1 you would need to change line 27 of the plugin from this

Code: Select all

$target_interface = "ethernet";
to this

Code: Select all

$target_interface = "eth1";