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;
}
check_cisco_free_interfaces.pl
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: check_cisco_free_interfaces.pl
Is this the whole plugin? It must be missing something
-
yangzhiyao2653
- Posts: 27
- Joined: Fri May 18, 2018 1:15 am
Re: check_cisco_free_interfaces.pl
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.scottwilkerson wrote:Is this the whole plugin? It must be missing something
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
the plugin is walking this oid and looking for an interface named "ethernet"
if it does not find one you get the error.
Have the Interfaces on this router been renamed to not include the word ethernet?
Code: Select all
.1.3.6.1.2.1.2.2.1.2Have the Interfaces on this router been renamed to not include the word ethernet?
-
yangzhiyao2653
- Posts: 27
- Joined: Fri May 18, 2018 1:15 am
Re: check_cisco_free_interfaces.pl
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
if they are called eth1 you would need to change line 27 of the plugin from this
to this
Code: Select all
$target_interface = "ethernet";Code: Select all
$target_interface = "eth1";