mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-10157-14544-plugin-anadir-parametro-extra-para-calcular-el-de-bandwidth-max-de-port-channels' into 'develop'
Ent 10157 14544 plugin anadir parametro extra para calcular el de bandwidth max de port channels See merge request artica/pandorafms!5810
This commit is contained in:
commit
492032bd41
@ -60,6 +60,7 @@ Where OPTIONS could be:
|
|||||||
-inUsage Show only input usage (in percentage) - 1, or not 0.
|
-inUsage Show only input usage (in percentage) - 1, or not 0.
|
||||||
-outUsage Show only output usage (in percentage) - 1, or not 0.
|
-outUsage Show only output usage (in percentage) - 1, or not 0.
|
||||||
-f We treat unkonwn duplex as full duplex.
|
-f We treat unkonwn duplex as full duplex.
|
||||||
|
-max Value that replaces ifSpeed when you have a port chanel with multiple interfaces.
|
||||||
|
|
||||||
Note: You can also use snmpget/snmpwalk argument notation,
|
Note: You can also use snmpget/snmpwalk argument notation,
|
||||||
e.g. -v is equal to -version, -c to -community, etc.
|
e.g. -v is equal to -version, -c to -community, etc.
|
||||||
@ -140,6 +141,9 @@ sub update_config_key ($) {
|
|||||||
if ($arg eq 'f') {
|
if ($arg eq 'f') {
|
||||||
return "unknown_fullduplex";
|
return "unknown_fullduplex";
|
||||||
}
|
}
|
||||||
|
if ($arg eq 'max') {
|
||||||
|
return "max_interfaces";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -258,12 +262,17 @@ sub prepare_tree {
|
|||||||
$speed{'oid'} .= $config->{'x86_indexes'}{'ifSpeed'}.$ifIndex;
|
$speed{'oid'} .= $config->{'x86_indexes'}{'ifSpeed'}.$ifIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $speed = snmp_get(\%speed);
|
my $speed = 0;
|
||||||
if (ref($speed) eq "HASH") {
|
if (empty($config->{'max_interfaces'})) {
|
||||||
$speed = int $speed->{'data'};
|
$speed = snmp_get(\%speed);
|
||||||
|
if (ref($speed) eq "HASH") {
|
||||||
|
$speed = int $speed->{'data'};
|
||||||
|
} else {
|
||||||
|
# Ignore, cannot retrieve inOctets.
|
||||||
|
next;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
# Ignore, cannot retrieve inOctets.
|
$speed = $config->{'max_interfaces'};
|
||||||
next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user