(plugin) network::alcatel::omniswitch::snmp - add temperature metrics (#3738)

This commit is contained in:
qgarnier 2022-06-15 14:31:41 +02:00 committed by GitHub
parent 81e50fd52f
commit d3fa0fde0e
12 changed files with 268 additions and 72 deletions

View File

@ -59,9 +59,9 @@ sub check {
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.backplane.power.watt', nlabel => 'hardware.backplane.power.watt',
instances => $instance, unit => 'W',
instances => [$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance],
value => $result->{chasEntPhysPower}, value => $result->{chasEntPhysPower},
min => 0 min => 0
); );

View File

@ -26,6 +26,157 @@ use network::alcatel::omniswitch::snmp::mode::components::resources qw(%oids $ma
sub load {} sub load {}
sub check_temp_aos6 {
my ($self, %options) = @_;
my $mapping_temp = {
boardTemp => { oid => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.4', default => -1 }, # chasHardwareBoardTemp
threshold => { oid => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.7', default => -1 }, # chasTempThreshold
danger => { oid => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.8', default => -1 } # chasDangerTempThreshold
};
my $result = $self->{snmp}->map_instance(mapping => $mapping_temp, results => $self->{results}->{entity}, instance => $options{instance});
return if ($result->{boardTemp} <= 0);
$self->{output}->output_add(
long_msg => sprintf(
"chassis '%s/%s' [instance: %s] board temperature is %s degree centigrade",
$options{name},
$options{descr},
$options{instance},
$result->{boardTemp}
)
);
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $options{instance}, value => $result->{boardTemp});
if ($checked == 0) {
my $warn_th = $result->{threshold} > 0 ? $result->{threshold} : '';
my $crit_th = $result->{danger} > 0 ? $result->{danger} : '';
$self->{perfdata}->threshold_validate(label => 'warning-temperature-instance-' . $options{instance}, value => $warn_th);
$self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $options{instance}, value => $crit_th);
$exit = $self->{perfdata}->threshold_check(
value => $result->{boardTemp},
threshold => [
{ label => 'critical-temperature-instance-' . $options{instance}, exit_litteral => 'critical' },
{ label => 'warning-temperature-instance-' . $options{instance}, exit_litteral => 'warning' }
]
);
$warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-temperature-instance-' . $options{instance});
$crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $options{instance})
}
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(
severity => $exit,
short_msg => sprintf(
"chassis '%s/%s/%s' board temperature is %s degree centigrade",
$options{name},
$options{descr},
$options{instance},
$result->{boardTemp}
)
);
}
$self->{output}->perfdata_add(
nlabel => 'hardware.temperature.celsius',
unit => 'C',
instances => [$options{name}, $options{descr}, $options{instance}, 'Chassis'],
value => $result->{boardTemp},
warning => $warn,
critical => $crit
);
}
sub check_temp_aos7 {
my ($self, %options) = @_;
my $mapping_temp = {
threshold => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.5', default => -1 }, # chasTempThreshold
danger => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.6', default => -1 }, # chasDangerTempThreshold
CPMA => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.8', default => -1 }, # chasCPMAHardwareBoardTemp
CFMA => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.9', default => -1 }, # chasCFMAHardwareBoardTemp
CPMB => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.10', default => -1 }, # chasCPMBHardwareBoardTemp
CFMB => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.11', default => -1 }, # chasCFMBHardwareBoardTemp
CFMC => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.12', default => -1 }, # chasCFMCHardwareBoardTemp
CFMD => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.13', default => -1 }, # chasCFMDHardwareBoardTemp
FanTray1 => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.14', default => -1 }, # chasFTAHardwareBoardTemp
FanTray2 => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.15', default => -1 }, # chasFTBHardwareBoardTemp
NI1 => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.16', default => -1 }, # chasNI1HardwareBoardTemp
NI2 => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.17', default => -1 }, # chasNI2HardwareBoardTemp
NI3 => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.18', default => -1 }, # chasNI3HardwareBoardTemp
NI4 => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.19', default => -1 }, # chasNI4HardwareBoardTemp
NI5 => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.20', default => -1 }, # chasNI5HardwareBoardTemp
NI6 => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.21', default => -1 }, # chasNI6HardwareBoardTemp
NI7 => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.22', default => -1 }, # chasNI7HardwareBoardTemp
NI8 => { oid => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.23', default => -1 } # chasNI8HardwareBoardTemp
};
my $result = $self->{snmp}->map_instance(mapping => $mapping_temp, results => $self->{results}->{entity}, instance => $options{instance});
foreach my $sensor ('CPMA', 'CFMA', 'CPMB', 'CFMB', 'CFMC', 'CFMD', 'FanTray1', 'FanTray2', 'NI1', 'NI2', 'NI3', 'NI4', 'NI5', 'NI6', 'NI7', 'NI8') {
next if ($result->{$sensor} <= 0);
$self->{output}->output_add(
long_msg => sprintf(
"chassis '%s/%s/%s/%s' temperature is %s degree centigrade",
$options{name},
$options{descr},
$options{instance},
$sensor,
$result->{$sensor}
)
);
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $options{instance}, value => $result->{$sensor});
if ($checked == 0) {
my $warn_th = $result->{threshold} > 0 ? $result->{threshold} : '';
my $crit_th = $result->{danger} > 0 ? $result->{danger} : '';
$self->{perfdata}->threshold_validate(label => 'warning-temperature-instance-' . $options{instance}, value => $warn_th);
$self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $options{instance}, value => $crit_th);
$exit = $self->{perfdata}->threshold_check(
value => $result->{$sensor},
threshold => [
{ label => 'critical-temperature-instance-' . $options{instance}, exit_litteral => 'critical' },
{ label => 'warning-temperature-instance-' . $options{instance}, exit_litteral => 'warning' }
]
);
$warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-temperature-instance-' . $options{instance});
$crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $options{instance})
}
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(
severity => $exit,
short_msg => sprintf(
"chassis '%s/%s/%s/%s' temperature is %s degree centigrade",
$options{name},
$options{descr},
$options{instance},
$sensor,
$result->{$sensor}
)
);
}
$self->{output}->perfdata_add(
nlabel => 'hardware.temperature.celsius',
unit => 'C',
instances => [$options{name}, $options{descr}, $options{instance}, $sensor],
value => $result->{$sensor},
warning => $warn,
critical => $crit
);
}
}
sub check { sub check {
my ($self) = @_; my ($self) = @_;
@ -42,7 +193,7 @@ sub check {
} }
foreach my $instance (@instances) { foreach my $instance (@instances) {
next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); next if (!defined($self->{results}->{entity}->{ $oids{ $self->{type} }->{chasEntPhysAdminStatus} . '.' . $instance }));
my $result = $self->{snmp}->map_instance(mapping => $mapping->{ $self->{type} }, results => $self->{results}->{entity}, instance => $instance); my $result = $self->{snmp}->map_instance(mapping => $mapping->{ $self->{type} }, results => $self->{results}->{entity}, instance => $instance);
@ -51,29 +202,40 @@ sub check {
$self->{output}->output_add( $self->{output}->output_add(
long_msg => sprintf( long_msg => sprintf(
"chassis '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.", "chassis '%s/%s' [instance: %s, admin status: %s] operationnal status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName},
$result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus} $result->{entPhysicalDescr},
$instance,
$result->{chasEntPhysAdminStatus},
$result->{chasEntPhysOperStatus}
) )
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.chassis.power.watt', nlabel => 'hardware.chassis.power.watt',
instances => $instance, unit => 'W',
instances => [$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance],
value => $result->{chasEntPhysPower}, value => $result->{chasEntPhysPower},
min => 0 min => 0
); );
} }
if ($self->{type} eq 'aos6') {
check_temp_aos6($self, instance => $instance, name => $result->{entPhysicalName}, descr => $result->{entPhysicalDescr});
} else {
check_temp_aos7($self, instance => $instance, name => $result->{entPhysicalName}, descr => $result->{entPhysicalDescr});
}
my $exit = $self->get_severity(label => 'admin', section => 'chassis.admin', value => $result->{chasEntPhysAdminStatus}); my $exit = $self->get_severity(label => 'admin', section => 'chassis.admin', value => $result->{chasEntPhysAdminStatus});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add( $self->{output}->output_add(
severity => $exit, severity => $exit,
short_msg => sprintf( short_msg => sprintf(
"chassis '%s/%s/%s' admin status is %s", "chassis '%s/%s/%s' admin status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName},
$result->{entPhysicalDescr},
$instance,
$result->{chasEntPhysAdminStatus} $result->{chasEntPhysAdminStatus}
) )
); );
@ -86,7 +248,9 @@ sub check {
severity => $exit, severity => $exit,
short_msg => sprintf( short_msg => sprintf(
"chassis '%s/%s/%s' operational status is %s", "chassis '%s/%s/%s' operational status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName},
$result->{entPhysicalDescr},
$instance,
$result->{chasEntPhysOperStatus} $result->{chasEntPhysOperStatus}
) )
); );

View File

@ -59,9 +59,9 @@ sub check {
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.container.power.watt', nlabel => 'hardware.container.power.watt',
instances => $instance, unit => 'W',
instances => [$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance],
value => $result->{chasEntPhysPower}, value => $result->{chasEntPhysPower},
min => 0 min => 0
); );

View File

@ -48,7 +48,7 @@ sub check {
} }
foreach my $instance (@instances) { foreach my $instance (@instances) {
next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); next if (!defined($self->{results}->{entity}->{ $oids{ $self->{type} }->{chasEntPhysAdminStatus} . '.' . $instance }));
my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance); my $result = $self->{snmp}->map_instance(mapping => $mapping->{$self->{type}}, results => $self->{results}->{entity}, instance => $instance);
@ -67,7 +67,7 @@ sub check {
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => "power", unit => 'W', label => "power", unit => 'W',
nlabel => 'hardware.fan.power.watt', nlabel => 'hardware.fan.power.watt',
instances => $instance, instances => [$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance],
value => $result->{chasEntPhysPower}, value => $result->{chasEntPhysPower},
min => 0 min => 0
); );
@ -99,6 +99,8 @@ sub check {
} }
} }
return if ($self->{type} eq '');
foreach my $key (keys %{$self->{results}->{ $oids{ $self->{type} }->{alaChasEntPhysFanStatus} } }) { foreach my $key (keys %{$self->{results}->{ $oids{ $self->{type} }->{alaChasEntPhysFanStatus} } }) {
next if ($key !~ /^$oids{$self->{type}}->{alaChasEntPhysFanStatus}\.(.*?)\.(.*?)$/); next if ($key !~ /^$oids{$self->{type}}->{alaChasEntPhysFanStatus}\.(.*?)\.(.*?)$/);
my ($phys_index, $loc_index) = ($1, $2); my ($phys_index, $loc_index) = ($1, $2);

View File

@ -59,9 +59,9 @@ sub check {
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.module.power.watt', nlabel => 'hardware.module.power.watt',
instances => $instance, unit => 'W',
instances => [$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance],
value => $result->{chasEntPhysPower}, value => $result->{chasEntPhysPower},
min => 0 min => 0
); );

View File

@ -59,9 +59,9 @@ sub check {
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.other.power.watt', nlabel => 'hardware.other.power.watt',
instances => $instance, unit => 'W',
instances => [$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance],
value => $result->{chasEntPhysPower}, value => $result->{chasEntPhysPower},
min => 0 min => 0
); );

View File

@ -42,7 +42,7 @@ sub check {
} }
foreach my $instance (@instances) { foreach my $instance (@instances) {
next if (!defined($self->{results}->{entity}->{$oids{$self->{type}}{chasEntPhysAdminStatus} . '.' . $instance})); next if (!defined($self->{results}->{entity}->{ $oids{ $self->{type} }->{chasEntPhysAdminStatus} . '.' . $instance }));
my $result = $self->{snmp}->map_instance(mapping => $mapping->{ $self->{type} }, results => $self->{results}->{entity}, instance => $instance); my $result = $self->{snmp}->map_instance(mapping => $mapping->{ $self->{type} }, results => $self->{results}->{entity}, instance => $instance);
@ -59,9 +59,9 @@ sub check {
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.powersupply.power.watt', nlabel => 'hardware.powersupply.power.watt',
instances => $instance, unit => 'W',
instances => [$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance],
value => $result->{chasEntPhysPower}, value => $result->{chasEntPhysPower},
min => 0 min => 0
); );

View File

@ -83,28 +83,31 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $
aos6 => { aos6 => {
entreprise_alcatel_base => '.1.3.6.1.4.1.6486.800', entreprise_alcatel_base => '.1.3.6.1.4.1.6486.800',
version => '.1.3.6.1.4.1.6486.800.1.1.1.2.1.1.3.17.0', # systemHardwareUbootVersion
chasPhysBase => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1',
chasEntPhysAdminStatus => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.1', chasEntPhysAdminStatus => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.1',
chasEntPhysOperStatus => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.2', chasEntPhysOperStatus => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.2',
chasEntPhysPower => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.4', chasEntPhysPower => '.1.3.6.1.4.1.6486.800.1.1.1.1.1.1.1.4',
chasHardwareBoardTemp => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.4', chasChassisEntry => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1',
chasTempThreshold => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.7',
chasDangerTempThreshold => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.8',
alaChasEntPhysFanStatus => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.11.1.2' alaChasEntPhysFanStatus => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.11.1.2'
}, },
aos7 => { aos7 => {
entreprise_alcatel_base => '.1.3.6.1.4.1.6486.801', entreprise_alcatel_base => '.1.3.6.1.4.1.6486.801',
version => '.1.3.6.1.4.1.6486.801.1.1.1.2.1.1.3.17.0', # systemHardwareUbootVersion
chasPhysBase => '.1.3.6.1.4.1.6486.801.1.1.1.1.1.1.1',
chasEntPhysAdminStatus => '.1.3.6.1.4.1.6486.801.1.1.1.1.1.1.1.1', chasEntPhysAdminStatus => '.1.3.6.1.4.1.6486.801.1.1.1.1.1.1.1.1',
chasEntPhysOperStatus => '.1.3.6.1.4.1.6486.801.1.1.1.1.1.1.1.2', chasEntPhysOperStatus => '.1.3.6.1.4.1.6486.801.1.1.1.1.1.1.1.2',
chasEntPhysPower => '.1.3.6.1.4.1.6486.801.1.1.1.1.1.1.1.3', chasEntPhysPower => '.1.3.6.1.4.1.6486.801.1.1.1.1.1.1.1.3',
chasTempThreshold => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.5', chasChassisEntry => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1',
chasDangerTempThreshold => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.6',
alaChasEntPhysFanStatus => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.11.1.2' alaChasEntPhysFanStatus => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.11.1.2'
}, }
); );
$mapping = { $mapping = {

View File

@ -59,9 +59,9 @@ sub check {
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.sensor.power.watt', nlabel => 'hardware.sensor.power.watt',
instances => $instance, unit => 'W',
instances => [$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance],
value => $result->{chasEntPhysPower}, value => $result->{chasEntPhysPower},
min => 0 min => 0
); );

View File

@ -59,9 +59,9 @@ sub check {
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => "power", unit => 'W',
nlabel => 'hardware.stack.power.watt', nlabel => 'hardware.stack.power.watt',
instances => $instance, unit => 'W',
instances => [$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance],
value => $result->{chasEntPhysPower}, value => $result->{chasEntPhysPower},
min => 0 min => 0
); );

View File

@ -59,8 +59,8 @@ sub check {
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
$self->{output}->perfdata_add( $self->{output}->perfdata_add(
label => "power", unit => 'W', nlabel => [$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance],
nlabel => 'hardware.unknown.power.watt', unit => 'W',
instances => $instance, instances => $instance,
value => $result->{chasEntPhysPower}, value => $result->{chasEntPhysPower},
min => 0 min => 0

View File

@ -26,6 +26,8 @@ use network::alcatel::omniswitch::snmp::mode::components::resources qw(%oids);
sub set_system { sub set_system {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{regexp_threshold_numeric_check_section_option} = '^(temperature)$';
$self->{cb_hook2} = 'snmp_execute'; $self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = { $self->{thresholds} = {
@ -58,34 +60,59 @@ sub snmp_execute {
my ($self, %options) = @_; my ($self, %options) = @_;
$self->{snmp} = $options{snmp}; $self->{snmp} = $options{snmp};
$self->{results} = $self->{snmp}->get_multiple_table(oids => [
my $versions = $self->{snmp}->get_leef(
oids => [ $oids{aos6}->{version}, $oids{aos7}->{version} ]
);
$self->{type} = '';
if (defined($versions->{ $oids{aos6}->{version} })) {
$self->{type} = 'aos6';
} elsif (defined($versions->{ $oids{aos7}->{version} })) {
$self->{type} = 'aos7';
}
if ($self->{type} eq 'aos6') {
$self->{results} = $self->{snmp}->get_multiple_table(
oids => [
{ oid => $oids{common}->{entPhysicalClass} }, { oid => $oids{common}->{entPhysicalClass} },
{ oid => $oids{aos6}->{alaChasEntPhysFanStatus} }, { oid => $oids{aos6}->{alaChasEntPhysFanStatus} }
{ oid => $oids{aos7}->{alaChasEntPhysFanStatus} } ]
]); );
$self->{results}->{entity} = $self->{snmp}->get_multiple_table(oids => [
$self->{results}->{entity} = $self->{snmp}->get_multiple_table(
oids => [
{ oid => $oids{common}->{entPhysicalDescr} }, { oid => $oids{common}->{entPhysicalDescr} },
{ oid => $oids{common}->{entPhysicalName} }, { oid => $oids{common}->{entPhysicalName} },
{ oid => $oids{aos6}->{chasEntPhysAdminStatus} }, { oid => $oids{aos6}->{chasPhysBase}, start => $oids{aos6}->{chasEntPhysAdminStatus}, end => $oids{aos6}->{chasEntPhysOperStatus} },
{ oid => $oids{aos6}->{chasEntPhysOperStatus} },
{ oid => $oids{aos6}->{chasEntPhysPower} }, { oid => $oids{aos6}->{chasEntPhysPower} },
{ oid => $oids{aos7}->{chasEntPhysAdminStatus} }, { oid => $oids{aos6}->{chasChassisEntry} }
{ oid => $oids{aos7}->{chasEntPhysOperStatus} }, ],
{ oid => $oids{aos7}->{chasEntPhysPower} } return_type => 1
], return_type => 1); );
} elsif ($self->{type} eq 'aos7') {
$self->{results} = $self->{snmp}->get_multiple_table(
oids => [
{ oid => $oids{common}->{entPhysicalClass} },
{ oid => $oids{aos7}->{alaChasEntPhysFanStatus} }
]
);
$self->{type} = 'aos6'; $self->{results}->{entity} = $self->{snmp}->get_multiple_table(
foreach (keys %{$self->{results}->{entity}}) { oids => [
if (/^$oids{aos7}->{entreprise_alcatel_base}\./) { { oid => $oids{common}->{entPhysicalDescr} },
$self->{type} = 'aos7'; { oid => $oids{common}->{entPhysicalName} },
last; { oid => $oids{aos7}->{chasPhysBase}, start => $oids{aos7}->{chasEntPhysAdminStatus}, end => $oids{aos7}->{chasEntPhysPower} },
} { oid => $oids{aos7}->{chasChassisEntry} }
],
return_type => 1
);
} }
} }
sub new { sub new {
my ($class, %options) = @_; my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class; bless $self, $class;
$options{options}->add_options(arguments => {}); $options{options}->add_options(arguments => {});