fix(alcatel/omniswitch): mode hardware - change default threshold for fan noStatus (#3393)

This commit is contained in:
qgarnier 2022-01-11 09:53:40 +01:00 committed by GitHub
parent ed6e30582d
commit c754ec8ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 322 additions and 195 deletions

View File

@ -49,9 +49,12 @@ sub check {
next if ($self->check_filter(section => 'backplane', instance => $instance)); next if ($self->check_filter(section => 'backplane', instance => $instance));
$self->{components}->{backplane}->{total}++; $self->{components}->{backplane}->{total}++;
$self->{output}->output_add(long_msg => sprintf("backplane '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.", $self->{output}->output_add(
long_msg => sprintf(
"backplane '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}) $result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
)
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
@ -66,19 +69,27 @@ sub check {
my $exit = $self->get_severity(label => 'admin', section => 'backplane.admin', value => $result->{chasEntPhysAdminStatus}); my $exit = $self->get_severity(label => 'admin', section => 'backplane.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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("backplane '%s/%s/%s' admin status is %s", severity => $exit,
short_msg => sprintf(
"backplane '%s/%s/%s' admin status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus})); $result->{chasEntPhysAdminStatus}
)
);
next; next;
} }
$exit = $self->get_severity(label => 'oper', section => 'backplane.oper', value => $result->{chasEntPhysOperStatus}); $exit = $self->get_severity(label => 'oper', section => 'backplane.oper', value => $result->{chasEntPhysOperStatus});
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("backplane '%s/%s/%s' operational status is %s", severity => $exit,
short_msg => sprintf(
"backplane '%s/%s/%s' operational status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysOperStatus})); $result->{chasEntPhysOperStatus}
)
);
} }
} }
} }

View File

@ -49,9 +49,12 @@ sub check {
next if ($self->check_filter(section => 'chassis', instance => $instance)); next if ($self->check_filter(section => 'chassis', instance => $instance));
$self->{components}->{chassis}->{total}++; $self->{components}->{chassis}->{total}++;
$self->{output}->output_add(long_msg => sprintf("chassis '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.", $self->{output}->output_add(
long_msg => sprintf(
"chassis '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}) $result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
)
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
@ -66,19 +69,27 @@ sub check {
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("chassis '%s/%s/%s' admin status is %s", severity => $exit,
short_msg => sprintf(
"chassis '%s/%s/%s' admin status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus})); $result->{chasEntPhysAdminStatus}
)
);
next; next;
} }
$exit = $self->get_severity(label => 'oper', section => 'chassis.oper', value => $result->{chasEntPhysOperStatus}); $exit = $self->get_severity(label => 'oper', section => 'chassis.oper', value => $result->{chasEntPhysOperStatus});
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("chassis '%s/%s/%s' operational status is %s", severity => $exit,
short_msg => sprintf(
"chassis '%s/%s/%s' operational status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysOperStatus})); $result->{chasEntPhysOperStatus}
)
);
} }
} }
} }

View File

@ -49,9 +49,12 @@ sub check {
next if ($self->check_filter(section => 'container', instance => $instance)); next if ($self->check_filter(section => 'container', instance => $instance));
$self->{components}->{container}->{total}++; $self->{components}->{container}->{total}++;
$self->{output}->output_add(long_msg => sprintf("container '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.", $self->{output}->output_add(
long_msg => sprintf(
"container '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}) $result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
)
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
@ -66,19 +69,27 @@ sub check {
my $exit = $self->get_severity(label => 'admin', section => 'container.admin', value => $result->{chasEntPhysAdminStatus}); my $exit = $self->get_severity(label => 'admin', section => 'container.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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("container '%s/%s/%s' admin status is %s", severity => $exit,
short_msg => sprintf(
"container '%s/%s/%s' admin status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus})); $result->{chasEntPhysAdminStatus}
)
);
next; next;
} }
$exit = $self->get_severity(label => 'oper', section => 'container.oper', value => $result->{chasEntPhysOperStatus}); $exit = $self->get_severity(label => 'oper', section => 'container.oper', value => $result->{chasEntPhysOperStatus});
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("container '%s/%s/%s' operational status is %s", severity => $exit,
short_msg => sprintf(
"container '%s/%s/%s' operational status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysOperStatus})); $result->{chasEntPhysOperStatus}
)
);
} }
} }
} }

View File

@ -27,7 +27,7 @@ use network::alcatel::omniswitch::snmp::mode::components::resources qw(%oids $ma
my %fan_status = ( my %fan_status = (
0 => 'noStatus', 0 => 'noStatus',
1 => 'notRunning', 1 => 'notRunning',
2 => 'running', 2 => 'running'
); );
sub load {} sub load {}
@ -55,9 +55,12 @@ sub check {
next if ($self->check_filter(section => 'fan', instance => $instance)); next if ($self->check_filter(section => 'fan', instance => $instance));
$self->{components}->{fan}->{total}++; $self->{components}->{fan}->{total}++;
$self->{output}->output_add(long_msg => sprintf("fan '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.", $self->{output}->output_add(
long_msg => sprintf(
"fan '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}) $result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
)
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
@ -72,19 +75,27 @@ sub check {
my $exit = $self->get_severity(label => 'admin', section => 'fan.admin', value => $result->{chasEntPhysAdminStatus}); my $exit = $self->get_severity(label => 'admin', section => 'fan.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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("fan '%s/%s/%s' admin status is %s", severity => $exit,
short_msg => sprintf(
"fan '%s/%s/%s' admin status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus})); $result->{chasEntPhysAdminStatus}
)
);
next; next;
} }
$exit = $self->get_severity(label => 'oper', section => 'fan.oper', value => $result->{chasEntPhysOperStatus}); $exit = $self->get_severity(label => 'oper', section => 'fan.oper', value => $result->{chasEntPhysOperStatus});
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("fan '%s/%s/%s' operational status is %s", severity => $exit,
short_msg => sprintf(
"fan '%s/%s/%s' operational status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysOperStatus})); $result->{chasEntPhysOperStatus}
)
);
} }
} }
@ -100,16 +111,23 @@ sub check {
next if ($self->check_filter(section => 'fan', instance => $phys_index . '.' . $loc_index)); next if ($self->check_filter(section => 'fan', instance => $phys_index . '.' . $loc_index));
$self->{components}->{fan}->{total}++; $self->{components}->{fan}->{total}++;
$self->{output}->output_add(long_msg => sprintf("fan '%s/%s' [instance: %s] status is %s", $self->{output}->output_add(
long_msg => sprintf(
"fan '%s/%s' [instance: %s] status is %s",
$name, $descr, $phys_index . '.' . $loc_index, $name, $descr, $phys_index . '.' . $loc_index,
$fan_status{$status}) $fan_status{$status}
)
); );
my $exit = $self->get_severity(label => 'fan', section => 'fan.status', value => $fan_status{$status}); my $exit = $self->get_severity(label => 'fan', section => 'fan.status', value => $fan_status{$status});
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("fan '%s/%s/%s' status is %s", severity => $exit,
short_msg => sprintf(
"fan '%s/%s/%s' status is %s",
$name, $descr, $phys_index . '.' . $loc_index, $name, $descr, $phys_index . '.' . $loc_index,
$fan_status{$status})); $fan_status{$status}
)
);
} }
} }
} }

View File

@ -49,9 +49,12 @@ sub check {
next if ($self->check_filter(section => 'module', instance => $instance)); next if ($self->check_filter(section => 'module', instance => $instance));
$self->{components}->{module}->{total}++; $self->{components}->{module}->{total}++;
$self->{output}->output_add(long_msg => sprintf("module '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.", $self->{output}->output_add(
long_msg => sprintf(
"module '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}) $result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
)
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
@ -66,19 +69,27 @@ sub check {
my $exit = $self->get_severity(label => 'admin', section => 'module.admin', value => $result->{chasEntPhysAdminStatus}); my $exit = $self->get_severity(label => 'admin', section => 'module.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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("module '%s/%s/%s' admin status is %s", severity => $exit,
short_msg => sprintf(
"module '%s/%s/%s' admin status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus})); $result->{chasEntPhysAdminStatus}
)
);
next; next;
} }
$exit = $self->get_severity(label => 'oper', section => 'module.oper', value => $result->{chasEntPhysOperStatus}); $exit = $self->get_severity(label => 'oper', section => 'module.oper', value => $result->{chasEntPhysOperStatus});
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("module '%s/%s/%s' operational status is %s", severity => $exit,
short_msg => sprintf(
"module '%s/%s/%s' operational status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysOperStatus})); $result->{chasEntPhysOperStatus}
)
);
} }
} }
} }

View File

@ -49,9 +49,12 @@ sub check {
next if ($self->check_filter(section => 'other', instance => $instance)); next if ($self->check_filter(section => 'other', instance => $instance));
$self->{components}->{other}->{total}++; $self->{components}->{other}->{total}++;
$self->{output}->output_add(long_msg => sprintf("other '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.", $self->{output}->output_add(
long_msg => sprintf(
"other '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}) $result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
)
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
@ -66,19 +69,27 @@ sub check {
my $exit = $self->get_severity(label => 'admin', section => 'other.admin', value => $result->{chasEntPhysAdminStatus}); my $exit = $self->get_severity(label => 'admin', section => 'other.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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("other '%s/%s/%s' admin status is %s", severity => $exit,
short_msg => sprintf(
"other '%s/%s/%s' admin status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus})); $result->{chasEntPhysAdminStatus}
)
);
next; next;
} }
$exit = $self->get_severity(label => 'oper', section => 'other.oper', value => $result->{chasEntPhysOperStatus}); $exit = $self->get_severity(label => 'oper', section => 'other.oper', value => $result->{chasEntPhysOperStatus});
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("other '%s/%s/%s' operational status is %s", severity => $exit,
short_msg => sprintf(
"other '%s/%s/%s' operational status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysOperStatus})); $result->{chasEntPhysOperStatus}
)
);
} }
} }
} }

View File

@ -49,9 +49,12 @@ sub check {
next if ($self->check_filter(section => 'port', instance => $instance)); next if ($self->check_filter(section => 'port', instance => $instance));
$self->{components}->{port}->{total}++; $self->{components}->{port}->{total}++;
$self->{output}->output_add(long_msg => sprintf("port '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.", $self->{output}->output_add(
long_msg => sprintf(
"port '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}) $result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
)
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
@ -66,19 +69,27 @@ sub check {
my $exit = $self->get_severity(label => 'admin', section => 'port.admin', value => $result->{chasEntPhysAdminStatus}); my $exit = $self->get_severity(label => 'admin', section => 'port.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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("port '%s/%s/%s' admin status is %s", severity => $exit,
short_msg => sprintf(
"port '%s/%s/%s' admin status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus})); $result->{chasEntPhysAdminStatus}
)
);
next; next;
} }
$exit = $self->get_severity(label => 'oper', section => 'port.oper', value => $result->{chasEntPhysOperStatus}); $exit = $self->get_severity(label => 'oper', section => 'port.oper', value => $result->{chasEntPhysOperStatus});
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("port '%s/%s/%s' operational status is %s", severity => $exit,
short_msg => sprintf(
"port '%s/%s/%s' operational status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysOperStatus})); $result->{chasEntPhysOperStatus}
)
);
} }
} }
} }

View File

@ -49,9 +49,12 @@ sub check {
next if ($self->check_filter(section => 'psu', instance => $instance)); next if ($self->check_filter(section => 'psu', instance => $instance));
$self->{components}->{psu}->{total}++; $self->{components}->{psu}->{total}++;
$self->{output}->output_add(long_msg => sprintf("power supply '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.", $self->{output}->output_add(
long_msg => sprintf(
"power supply '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}) $result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
)
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
@ -66,19 +69,27 @@ sub check {
my $exit = $self->get_severity(label => 'admin', section => 'psu.admin', value => $result->{chasEntPhysAdminStatus}); my $exit = $self->get_severity(label => 'admin', section => 'psu.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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("power supply '%s/%s/%s' admin status is %s", severity => $exit,
short_msg => sprintf(
"power supply '%s/%s/%s' admin status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus})); $result->{chasEntPhysAdminStatus}
)
);
next; next;
} }
$exit = $self->get_severity(label => 'oper', section => 'psu.oper', value => $result->{chasEntPhysOperStatus}); $exit = $self->get_severity(label => 'oper', section => 'psu.oper', value => $result->{chasEntPhysOperStatus});
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("power supply '%s/%s/%s' operational status is %s", severity => $exit,
short_msg => sprintf(
"power supply '%s/%s/%s' operational status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysOperStatus})); $result->{chasEntPhysOperStatus}
)
);
} }
} }
} }

View File

@ -44,7 +44,7 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $
8 => 'sensor', 8 => 'sensor',
9 => 'module', 9 => 'module',
10 => 'port', 10 => 'port',
11 => 'stack', 11 => 'stack'
); );
%phys_oper_status = ( %phys_oper_status = (
@ -57,7 +57,7 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $
7 => 'unpowered', 7 => 'unpowered',
8 => 'master', 8 => 'master',
9 => 'idle', 9 => 'idle',
10 => 'pwrsave', 10 => 'pwrsave'
); );
%phys_admin_status = ( %phys_admin_status = (
@ -71,14 +71,14 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $
8 => 'resetWithFabric', 8 => 'resetWithFabric',
9 => 'takeoverWithFabrc', 9 => 'takeoverWithFabrc',
10 => 'vcTakeover', 10 => 'vcTakeover',
11 => 'resetVcAll', 11 => 'resetVcAll'
); );
%oids = ( %oids = (
common => { common => {
entPhysicalDescr => '.1.3.6.1.2.1.47.1.1.1.1.2', entPhysicalDescr => '.1.3.6.1.2.1.47.1.1.1.1.2',
entPhysicalClass => '.1.3.6.1.2.1.47.1.1.1.1.5', entPhysicalClass => '.1.3.6.1.2.1.47.1.1.1.1.5',
entPhysicalName => '.1.3.6.1.2.1.47.1.1.1.1.7', entPhysicalName => '.1.3.6.1.2.1.47.1.1.1.1.7'
}, },
aos6 => { aos6 => {
entreprise_alcatel_base => '.1.3.6.1.4.1.6486.800', entreprise_alcatel_base => '.1.3.6.1.4.1.6486.800',
@ -91,7 +91,7 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $
chasTempThreshold => '.1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1.7', 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', 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',
@ -103,7 +103,7 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $
chasTempThreshold => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.5', chasTempThreshold => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.5',
chasDangerTempThreshold => '.1.3.6.1.4.1.6486.801.1.1.1.3.1.1.3.1.6', 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'
}, },
); );
@ -113,15 +113,15 @@ $mapping = {
entPhysicalName => { oid => $oids{common}->{entPhysicalName} }, entPhysicalName => { oid => $oids{common}->{entPhysicalName} },
chasEntPhysAdminStatus => { oid => $oids{aos6}->{chasEntPhysAdminStatus}, map => \%phys_admin_status, default => 'unknown' }, chasEntPhysAdminStatus => { oid => $oids{aos6}->{chasEntPhysAdminStatus}, map => \%phys_admin_status, default => 'unknown' },
chasEntPhysOperStatus => { oid => $oids{aos6}->{chasEntPhysOperStatus}, map => \%phys_oper_status, default => 'unknown' }, chasEntPhysOperStatus => { oid => $oids{aos6}->{chasEntPhysOperStatus}, map => \%phys_oper_status, default => 'unknown' },
chasEntPhysPower => { oid => $oids{aos6}->{chasEntPhysPower}, default => -1 }, chasEntPhysPower => { oid => $oids{aos6}->{chasEntPhysPower}, default => -1 }
}, },
aos7 => { aos7 => {
entPhysicalDescr => { oid => $oids{common}->{entPhysicalDescr} }, entPhysicalDescr => { oid => $oids{common}->{entPhysicalDescr} },
entPhysicalName => { oid => $oids{common}->{entPhysicalName} }, entPhysicalName => { oid => $oids{common}->{entPhysicalName} },
chasEntPhysAdminStatus => { oid => $oids{aos7}->{chasEntPhysAdminStatus}, map => \%phys_admin_status, default => 'unknown' }, chasEntPhysAdminStatus => { oid => $oids{aos7}->{chasEntPhysAdminStatus}, map => \%phys_admin_status, default => 'unknown' },
chasEntPhysOperStatus => { oid => $oids{aos7}->{chasEntPhysOperStatus}, map => \%phys_oper_status, default => 'unknown' }, chasEntPhysOperStatus => { oid => $oids{aos7}->{chasEntPhysOperStatus}, map => \%phys_oper_status, default => 'unknown' },
chasEntPhysPower => { oid => $oids{aos7}->{chasEntPhysPower}, default => -1 }, chasEntPhysPower => { oid => $oids{aos7}->{chasEntPhysPower}, default => -1 }
}, }
}; };
1; 1;

View File

@ -49,9 +49,12 @@ sub check {
next if ($self->check_filter(section => 'sensor', instance => $instance)); next if ($self->check_filter(section => 'sensor', instance => $instance));
$self->{components}->{sensor}->{total}++; $self->{components}->{sensor}->{total}++;
$self->{output}->output_add(long_msg => sprintf("sensor '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.", $self->{output}->output_add(
long_msg => sprintf(
"sensor '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}) $result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
)
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
@ -66,19 +69,27 @@ sub check {
my $exit = $self->get_severity(label => 'admin', section => 'sensor.admin', value => $result->{chasEntPhysAdminStatus}); my $exit = $self->get_severity(label => 'admin', section => 'sensor.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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("sensor '%s/%s/%s' admin status is %s", severity => $exit,
short_msg => sprintf(
"sensor '%s/%s/%s' admin status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus})); $result->{chasEntPhysAdminStatus}
)
);
next; next;
} }
$exit = $self->get_severity(label => 'oper', section => 'sensor.oper', value => $result->{chasEntPhysOperStatus}); $exit = $self->get_severity(label => 'oper', section => 'sensor.oper', value => $result->{chasEntPhysOperStatus});
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("sensor '%s/%s/%s' operational status is %s", severity => $exit,
short_msg => sprintf(
"sensor '%s/%s/%s' operational status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysOperStatus})); $result->{chasEntPhysOperStatus}
)
);
} }
} }
} }

View File

@ -49,9 +49,12 @@ sub check {
next if ($self->check_filter(section => 'stack', instance => $instance)); next if ($self->check_filter(section => 'stack', instance => $instance));
$self->{components}->{stack}->{total}++; $self->{components}->{stack}->{total}++;
$self->{output}->output_add(long_msg => sprintf("stack '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.", $self->{output}->output_add(
long_msg => sprintf(
"stack '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}) $result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
)
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
@ -66,19 +69,27 @@ sub check {
my $exit = $self->get_severity(label => 'admin', section => 'stack.admin', value => $result->{chasEntPhysAdminStatus}); my $exit = $self->get_severity(label => 'admin', section => 'stack.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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("stack '%s/%s/%s' admin status is %s", severity => $exit,
short_msg => sprintf(
"stack '%s/%s/%s' admin status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus})); $result->{chasEntPhysAdminStatus}
)
);
next; next;
} }
$exit = $self->get_severity(label => 'oper', section => 'stack.oper', value => $result->{chasEntPhysOperStatus}); $exit = $self->get_severity(label => 'oper', section => 'stack.oper', value => $result->{chasEntPhysOperStatus});
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("stack '%s/%s/%s' operational status is %s", severity => $exit,
short_msg => sprintf(
"stack '%s/%s/%s' operational status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysOperStatus})); $result->{chasEntPhysOperStatus}
)
);
} }
} }
} }

View File

@ -49,9 +49,12 @@ sub check {
next if ($self->check_filter(section => 'unknown', instance => $instance)); next if ($self->check_filter(section => 'unknown', instance => $instance));
$self->{components}->{unknown}->{total}++; $self->{components}->{unknown}->{total}++;
$self->{output}->output_add(long_msg => sprintf("unknown '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.", $self->{output}->output_add(
long_msg => sprintf(
"unknown '%s/%s' [instance: %s, admin status: %s] operationnal status is %s.",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}) $result->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
)
); );
if ($result->{chasEntPhysPower} > 0) { if ($result->{chasEntPhysPower} > 0) {
@ -66,19 +69,27 @@ sub check {
my $exit = $self->get_severity(label => 'admin', section => 'unknown.admin', value => $result->{chasEntPhysAdminStatus}); my $exit = $self->get_severity(label => 'admin', section => 'unknown.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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("unknown '%s/%s/%s' admin status is %s", severity => $exit,
short_msg => sprintf(
"unknown '%s/%s/%s' admin status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysAdminStatus})); $result->{chasEntPhysAdminStatus}
)
);
next; next;
} }
$exit = $self->get_severity(label => 'oper', section => 'unknown.oper', value => $result->{chasEntPhysOperStatus}); $exit = $self->get_severity(label => 'oper', section => 'unknown.oper', value => $result->{chasEntPhysOperStatus});
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(severity => $exit, $self->{output}->output_add(
short_msg => sprintf("unknown '%s/%s/%s' operational status is %s", severity => $exit,
short_msg => sprintf(
"unknown '%s/%s/%s' operational status is %s",
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance, $result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
$result->{chasEntPhysOperStatus})); $result->{chasEntPhysOperStatus}
)
);
} }
} }
} }

View File

@ -33,7 +33,7 @@ sub set_system {
['^(reset|takeover|resetWithFabric|takeoverWithFabrc)$', 'WARNING'], ['^(reset|takeover|resetWithFabric|takeoverWithFabrc)$', 'WARNING'],
['^(powerOff)$', 'CRITICAL'], ['^(powerOff)$', 'CRITICAL'],
['powerOn', 'OK'], ['powerOn', 'OK'],
['standby', 'OK'], ['standby', 'OK']
], ],
oper => [ oper => [
['^(testing)$', 'WARNING'], ['^(testing)$', 'WARNING'],
@ -41,13 +41,13 @@ sub set_system {
['up', 'OK'], ['up', 'OK'],
['secondary', 'OK'], ['secondary', 'OK'],
['master', 'OK'], ['master', 'OK'],
['idle', 'OK'], ['idle', 'OK']
], ],
fan => [ fan => [
['^noStatus$', 'UNKNOWN'], ['noStatus', 'OK'],
['^notRunning$', 'CRITICAL'], ['^notRunning$', 'CRITICAL'],
['running', 'OK'], ['running', 'OK']
], ]
}; };
$self->{components_path} = 'network::alcatel::omniswitch::snmp::mode::components'; $self->{components_path} = 'network::alcatel::omniswitch::snmp::mode::components';
@ -61,7 +61,7 @@ sub snmp_execute {
$self->{results} = $self->{snmp}->get_multiple_table(oids => [ $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} }, { 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} },
@ -71,7 +71,7 @@ sub snmp_execute {
{ oid => $oids{aos6}->{chasEntPhysPower} }, { oid => $oids{aos6}->{chasEntPhysPower} },
{ oid => $oids{aos7}->{chasEntPhysAdminStatus} }, { oid => $oids{aos7}->{chasEntPhysAdminStatus} },
{ oid => $oids{aos7}->{chasEntPhysOperStatus} }, { oid => $oids{aos7}->{chasEntPhysOperStatus} },
{ oid => $oids{aos7}->{chasEntPhysPower} }, { oid => $oids{aos7}->{chasEntPhysPower} }
], return_type => 1); ], return_type => 1);
$self->{type} = 'aos6'; $self->{type} = 'aos6';

View File

@ -29,8 +29,7 @@ sub new {
my $self = $class->SUPER::new(package => __PACKAGE__, %options); my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class; bless $self, $class;
$self->{version} = '0.1'; $self->{modes} = {
%{$self->{modes}} = (
'cpu' => 'network::alcatel::omniswitch::snmp::mode::cpu', 'cpu' => 'network::alcatel::omniswitch::snmp::mode::cpu',
'hardware' => 'network::alcatel::omniswitch::snmp::mode::hardware', 'hardware' => 'network::alcatel::omniswitch::snmp::mode::hardware',
'interfaces' => 'snmp_standard::mode::interfaces', 'interfaces' => 'snmp_standard::mode::interfaces',
@ -38,8 +37,8 @@ sub new {
'list-spanning-trees' => 'snmp_standard::mode::listspanningtrees', 'list-spanning-trees' => 'snmp_standard::mode::listspanningtrees',
'flash-memory' => 'network::alcatel::omniswitch::snmp::mode::flashmemory', 'flash-memory' => 'network::alcatel::omniswitch::snmp::mode::flashmemory',
'memory' => 'network::alcatel::omniswitch::snmp::mode::memory', 'memory' => 'network::alcatel::omniswitch::snmp::mode::memory',
'spanning-tree' => 'snmp_standard::mode::spanningtree', 'spanning-tree' => 'snmp_standard::mode::spanningtree'
); };
return $self; return $self;
} }