check_cisco_free_interfaces.pl

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
yangzhiyao2653
Posts: 27
Joined: Fri May 18, 2018 1:15 am

check_cisco_free_interfaces.pl

Post 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;
}
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_cisco_free_interfaces.pl

Post by scottwilkerson »

Is this the whole plugin? It must be missing something
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
yangzhiyao2653
Posts: 27
Joined: Fri May 18, 2018 1:15 am

Re: check_cisco_free_interfaces.pl

Post 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.
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_cisco_free_interfaces.pl

Post 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?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
yangzhiyao2653
Posts: 27
Joined: Fri May 18, 2018 1:15 am

Re: check_cisco_free_interfaces.pl

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_cisco_free_interfaces.pl

Post 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";
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked