fix(alcatel/omniswitch): mode hardware - change default threshold for fan noStatus (#3393)
This commit is contained in:
parent
af568240a4
commit
f0fc71242a
|
@ -48,12 +48,15 @@ sub check {
|
|||
|
||||
next if ($self->check_filter(section => 'backplane', instance => $instance));
|
||||
$self->{components}->{backplane}->{total}++;
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus})
|
||||
);
|
||||
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
|
||||
if ($result->{chasEntPhysPower} > 0) {
|
||||
$self->{output}->perfdata_add(
|
||||
label => "power", unit => 'W',
|
||||
|
@ -66,19 +69,27 @@ sub check {
|
|||
|
||||
my $exit = $self->get_severity(label => 'admin', section => 'backplane.admin', value => $result->{chasEntPhysAdminStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("backplane '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"backplane '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}
|
||||
)
|
||||
);
|
||||
next;
|
||||
}
|
||||
|
||||
$exit = $self->get_severity(label => 'oper', section => 'backplane.oper', value => $result->{chasEntPhysOperStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("backplane '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"backplane '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,11 +49,14 @@ sub check {
|
|||
next if ($self->check_filter(section => 'chassis', instance => $instance));
|
||||
$self->{components}->{chassis}->{total}++;
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus})
|
||||
);
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
|
||||
if ($result->{chasEntPhysPower} > 0) {
|
||||
$self->{output}->perfdata_add(
|
||||
label => "power", unit => 'W',
|
||||
|
@ -66,19 +69,27 @@ sub check {
|
|||
|
||||
my $exit = $self->get_severity(label => 'admin', section => 'chassis.admin', value => $result->{chasEntPhysAdminStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("chassis '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"chassis '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}
|
||||
)
|
||||
);
|
||||
next;
|
||||
}
|
||||
|
||||
$exit = $self->get_severity(label => 'oper', section => 'chassis.oper', value => $result->{chasEntPhysOperStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("chassis '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"chassis '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,10 +49,13 @@ sub check {
|
|||
next if ($self->check_filter(section => 'container', instance => $instance));
|
||||
$self->{components}->{container}->{total}++;
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus})
|
||||
);
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
|
||||
if ($result->{chasEntPhysPower} > 0) {
|
||||
$self->{output}->perfdata_add(
|
||||
|
@ -66,19 +69,27 @@ sub check {
|
|||
|
||||
my $exit = $self->get_severity(label => 'admin', section => 'container.admin', value => $result->{chasEntPhysAdminStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("container '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"container '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}
|
||||
)
|
||||
);
|
||||
next;
|
||||
}
|
||||
|
||||
$exit = $self->get_severity(label => 'oper', section => 'container.oper', value => $result->{chasEntPhysOperStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("container '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"container '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ use network::alcatel::omniswitch::snmp::mode::components::resources qw(%oids $ma
|
|||
my %fan_status = (
|
||||
0 => 'noStatus',
|
||||
1 => 'notRunning',
|
||||
2 => 'running',
|
||||
2 => 'running'
|
||||
);
|
||||
|
||||
sub load {}
|
||||
|
@ -38,7 +38,7 @@ sub check {
|
|||
$self->{output}->output_add(long_msg => "Checking fan");
|
||||
$self->{components}->{fan} = {name => 'fans', total => 0, skip => 0};
|
||||
return if ($self->check_filter(section => 'fan'));
|
||||
|
||||
|
||||
my @instances = ();
|
||||
foreach my $key (keys %{$self->{results}->{$oids{common}->{entPhysicalClass}}}) {
|
||||
if ($self->{results}->{$oids{common}->{entPhysicalClass}}->{$key} == 7) {
|
||||
|
@ -46,20 +46,23 @@ sub check {
|
|||
push @instances, $1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach my $instance (@instances) {
|
||||
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);
|
||||
|
||||
|
||||
next if ($self->check_filter(section => 'fan', instance => $instance));
|
||||
$self->{components}->{fan}->{total}++;
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus})
|
||||
);
|
||||
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
|
||||
if ($result->{chasEntPhysPower} > 0) {
|
||||
$self->{output}->perfdata_add(
|
||||
label => "power", unit => 'W',
|
||||
|
@ -72,22 +75,30 @@ sub check {
|
|||
|
||||
my $exit = $self->get_severity(label => 'admin', section => 'fan.admin', value => $result->{chasEntPhysAdminStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("fan '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"fan '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}
|
||||
)
|
||||
);
|
||||
next;
|
||||
}
|
||||
|
||||
$exit = $self->get_severity(label => 'oper', section => 'fan.oper', value => $result->{chasEntPhysOperStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("fan '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"fan '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach my $key (keys %{$self->{results}->{$oids{$self->{type}}->{alaChasEntPhysFanStatus}}}) {
|
||||
next if ($key !~ /^$oids{$self->{type}}->{alaChasEntPhysFanStatus}\.(.*?)\.(.*?)$/);
|
||||
my ($phys_index, $loc_index) = ($1, $2);
|
||||
|
@ -96,20 +107,27 @@ sub check {
|
|||
$self->{results}->{entity}->{$oids{common}->{entPhysicalDescr} . '.' . $phys_index} : 'unknown';
|
||||
my $name = defined($self->{results}->{entity}->{$oids{common}->{entPhysicalName} . '.' . $phys_index}) ?
|
||||
$self->{results}->{entity}->{$oids{common}->{entPhysicalName} . '.' . $phys_index} : 'unknown';
|
||||
|
||||
|
||||
next if ($self->check_filter(section => 'fan', instance => $phys_index . '.' . $loc_index));
|
||||
$self->{components}->{fan}->{total}++;
|
||||
|
||||
$self->{output}->output_add(long_msg => sprintf("fan '%s/%s' [instance: %s] status is %s",
|
||||
$name, $descr, $phys_index . '.' . $loc_index,
|
||||
$fan_status{$status})
|
||||
);
|
||||
|
||||
$self->{output}->output_add(
|
||||
long_msg => sprintf(
|
||||
"fan '%s/%s' [instance: %s] status is %s",
|
||||
$name, $descr, $phys_index . '.' . $loc_index,
|
||||
$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)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("fan '%s/%s/%s' status is %s",
|
||||
$name, $descr, $phys_index . '.' . $loc_index,
|
||||
$fan_status{$status}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"fan '%s/%s/%s' status is %s",
|
||||
$name, $descr, $phys_index . '.' . $loc_index,
|
||||
$fan_status{$status}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,16 +43,19 @@ sub check {
|
|||
|
||||
foreach my $instance (@instances) {
|
||||
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);
|
||||
|
||||
|
||||
next if ($self->check_filter(section => 'module', instance => $instance));
|
||||
$self->{components}->{module}->{total}++;
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus})
|
||||
);
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
|
||||
if ($result->{chasEntPhysPower} > 0) {
|
||||
$self->{output}->perfdata_add(
|
||||
|
@ -63,22 +66,30 @@ sub check {
|
|||
min => 0
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
my $exit = $self->get_severity(label => 'admin', section => 'module.admin', value => $result->{chasEntPhysAdminStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("module '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"module '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}
|
||||
)
|
||||
);
|
||||
next;
|
||||
}
|
||||
|
||||
$exit = $self->get_severity(label => 'oper', section => 'module.oper', value => $result->{chasEntPhysOperStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("module '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"module '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,17 +43,20 @@ sub check {
|
|||
|
||||
foreach my $instance (@instances) {
|
||||
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);
|
||||
|
||||
|
||||
next if ($self->check_filter(section => 'other', instance => $instance));
|
||||
$self->{components}->{other}->{total}++;
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus})
|
||||
);
|
||||
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
|
||||
if ($result->{chasEntPhysPower} > 0) {
|
||||
$self->{output}->perfdata_add(
|
||||
label => "power", unit => 'W',
|
||||
|
@ -66,19 +69,27 @@ sub check {
|
|||
|
||||
my $exit = $self->get_severity(label => 'admin', section => 'other.admin', value => $result->{chasEntPhysAdminStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("other '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"other '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}
|
||||
)
|
||||
);
|
||||
next;
|
||||
}
|
||||
|
||||
$exit = $self->get_severity(label => 'oper', section => 'other.oper', value => $result->{chasEntPhysOperStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("other '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"other '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,12 +48,15 @@ sub check {
|
|||
|
||||
next if ($self->check_filter(section => 'port', instance => $instance));
|
||||
$self->{components}->{port}->{total}++;
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus})
|
||||
);
|
||||
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
|
||||
if ($result->{chasEntPhysPower} > 0) {
|
||||
$self->{output}->perfdata_add(
|
||||
label => "power", unit => 'W',
|
||||
|
@ -66,19 +69,27 @@ sub check {
|
|||
|
||||
my $exit = $self->get_severity(label => 'admin', section => 'port.admin', value => $result->{chasEntPhysAdminStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("port '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"port '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}
|
||||
)
|
||||
);
|
||||
next;
|
||||
}
|
||||
|
||||
$exit = $self->get_severity(label => 'oper', section => 'port.oper', value => $result->{chasEntPhysOperStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("port '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"port '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,11 +49,14 @@ sub check {
|
|||
next if ($self->check_filter(section => 'psu', instance => $instance));
|
||||
$self->{components}->{psu}->{total}++;
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus})
|
||||
);
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
|
||||
if ($result->{chasEntPhysPower} > 0) {
|
||||
$self->{output}->perfdata_add(
|
||||
label => "power", unit => 'W',
|
||||
|
@ -66,19 +69,27 @@ sub check {
|
|||
|
||||
my $exit = $self->get_severity(label => 'admin', section => 'psu.admin', value => $result->{chasEntPhysAdminStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("power supply '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"power supply '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}
|
||||
)
|
||||
);
|
||||
next;
|
||||
}
|
||||
|
||||
$exit = $self->get_severity(label => 'oper', section => 'psu.oper', value => $result->{chasEntPhysOperStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("power supply '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"power supply '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $
|
|||
8 => 'sensor',
|
||||
9 => 'module',
|
||||
10 => 'port',
|
||||
11 => 'stack',
|
||||
11 => 'stack'
|
||||
);
|
||||
|
||||
%phys_oper_status = (
|
||||
|
@ -57,7 +57,7 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $
|
|||
7 => 'unpowered',
|
||||
8 => 'master',
|
||||
9 => 'idle',
|
||||
10 => 'pwrsave',
|
||||
10 => 'pwrsave'
|
||||
);
|
||||
|
||||
%phys_admin_status = (
|
||||
|
@ -71,14 +71,14 @@ our @EXPORT_OK = qw(%physical_class %phys_oper_status %phys_admin_status %oids $
|
|||
8 => 'resetWithFabric',
|
||||
9 => 'takeoverWithFabrc',
|
||||
10 => 'vcTakeover',
|
||||
11 => 'resetVcAll',
|
||||
11 => 'resetVcAll'
|
||||
);
|
||||
|
||||
%oids = (
|
||||
common => {
|
||||
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',
|
||||
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 => {
|
||||
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',
|
||||
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 => {
|
||||
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',
|
||||
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} },
|
||||
chasEntPhysAdminStatus => { oid => $oids{aos6}->{chasEntPhysAdminStatus}, map => \%phys_admin_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 => {
|
||||
entPhysicalDescr => { oid => $oids{common}->{entPhysicalDescr} },
|
||||
entPhysicalName => { oid => $oids{common}->{entPhysicalName} },
|
||||
chasEntPhysAdminStatus => { oid => $oids{aos7}->{chasEntPhysAdminStatus}, map => \%phys_admin_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;
|
||||
|
|
|
@ -48,12 +48,15 @@ sub check {
|
|||
|
||||
next if ($self->check_filter(section => 'sensor', instance => $instance));
|
||||
$self->{components}->{sensor}->{total}++;
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus})
|
||||
);
|
||||
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
|
||||
if ($result->{chasEntPhysPower} > 0) {
|
||||
$self->{output}->perfdata_add(
|
||||
label => "power", unit => 'W',
|
||||
|
@ -66,19 +69,27 @@ sub check {
|
|||
|
||||
my $exit = $self->get_severity(label => 'admin', section => 'sensor.admin', value => $result->{chasEntPhysAdminStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("sensor '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"sensor '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}
|
||||
)
|
||||
);
|
||||
next;
|
||||
}
|
||||
|
||||
$exit = $self->get_severity(label => 'oper', section => 'sensor.oper', value => $result->{chasEntPhysOperStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("sensor '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"sensor '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,11 +49,14 @@ sub check {
|
|||
next if ($self->check_filter(section => 'stack', instance => $instance));
|
||||
$self->{components}->{stack}->{total}++;
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus})
|
||||
);
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
|
||||
if ($result->{chasEntPhysPower} > 0) {
|
||||
$self->{output}->perfdata_add(
|
||||
label => "power", unit => 'W',
|
||||
|
@ -66,19 +69,27 @@ sub check {
|
|||
|
||||
my $exit = $self->get_severity(label => 'admin', section => 'stack.admin', value => $result->{chasEntPhysAdminStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("stack '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"stack '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}
|
||||
)
|
||||
);
|
||||
next;
|
||||
}
|
||||
|
||||
$exit = $self->get_severity(label => 'oper', section => 'stack.oper', value => $result->{chasEntPhysOperStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("stack '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"stack '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,11 +49,14 @@ sub check {
|
|||
next if ($self->check_filter(section => 'unknown', instance => $instance));
|
||||
$self->{components}->{unknown}->{total}++;
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus})
|
||||
);
|
||||
|
||||
$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->{chasEntPhysAdminStatus}, $result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
|
||||
if ($result->{chasEntPhysPower} > 0) {
|
||||
$self->{output}->perfdata_add(
|
||||
label => "power", unit => 'W',
|
||||
|
@ -66,19 +69,27 @@ sub check {
|
|||
|
||||
my $exit = $self->get_severity(label => 'admin', section => 'unknown.admin', value => $result->{chasEntPhysAdminStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("unknown '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"unknown '%s/%s/%s' admin status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysAdminStatus}
|
||||
)
|
||||
);
|
||||
next;
|
||||
}
|
||||
|
||||
$exit = $self->get_severity(label => 'oper', section => 'unknown.oper', value => $result->{chasEntPhysOperStatus});
|
||||
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(severity => $exit,
|
||||
short_msg => sprintf("unknown '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}));
|
||||
$self->{output}->output_add(
|
||||
severity => $exit,
|
||||
short_msg => sprintf(
|
||||
"unknown '%s/%s/%s' operational status is %s",
|
||||
$result->{entPhysicalName}, $result->{entPhysicalDescr}, $instance,
|
||||
$result->{chasEntPhysOperStatus}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ sub set_system {
|
|||
['^(reset|takeover|resetWithFabric|takeoverWithFabrc)$', 'WARNING'],
|
||||
['^(powerOff)$', 'CRITICAL'],
|
||||
['powerOn', 'OK'],
|
||||
['standby', 'OK'],
|
||||
['standby', 'OK']
|
||||
],
|
||||
oper => [
|
||||
['^(testing)$', 'WARNING'],
|
||||
|
@ -41,13 +41,13 @@ sub set_system {
|
|||
['up', 'OK'],
|
||||
['secondary', 'OK'],
|
||||
['master', 'OK'],
|
||||
['idle', 'OK'],
|
||||
['idle', 'OK']
|
||||
],
|
||||
fan => [
|
||||
['^noStatus$', 'UNKNOWN'],
|
||||
['noStatus', 'OK'],
|
||||
['^notRunning$', 'CRITICAL'],
|
||||
['running', 'OK'],
|
||||
],
|
||||
['running', 'OK']
|
||||
]
|
||||
};
|
||||
|
||||
$self->{components_path} = 'network::alcatel::omniswitch::snmp::mode::components';
|
||||
|
@ -61,7 +61,7 @@ sub snmp_execute {
|
|||
$self->{results} = $self->{snmp}->get_multiple_table(oids => [
|
||||
{ oid => $oids{common}->{entPhysicalClass} },
|
||||
{ oid => $oids{aos6}->{alaChasEntPhysFanStatus} },
|
||||
{ oid => $oids{aos7}->{alaChasEntPhysFanStatus} },
|
||||
{ oid => $oids{aos7}->{alaChasEntPhysFanStatus} }
|
||||
]);
|
||||
$self->{results}->{entity} = $self->{snmp}->get_multiple_table(oids => [
|
||||
{ oid => $oids{common}->{entPhysicalDescr} },
|
||||
|
@ -71,7 +71,7 @@ sub snmp_execute {
|
|||
{ oid => $oids{aos6}->{chasEntPhysPower} },
|
||||
{ oid => $oids{aos7}->{chasEntPhysAdminStatus} },
|
||||
{ oid => $oids{aos7}->{chasEntPhysOperStatus} },
|
||||
{ oid => $oids{aos7}->{chasEntPhysPower} },
|
||||
{ oid => $oids{aos7}->{chasEntPhysPower} }
|
||||
], return_type => 1);
|
||||
|
||||
$self->{type} = 'aos6';
|
||||
|
|
|
@ -29,17 +29,16 @@ sub new {
|
|||
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
|
||||
bless $self, $class;
|
||||
|
||||
$self->{version} = '0.1';
|
||||
%{$self->{modes}} = (
|
||||
'cpu' => 'network::alcatel::omniswitch::snmp::mode::cpu',
|
||||
'hardware' => 'network::alcatel::omniswitch::snmp::mode::hardware',
|
||||
'interfaces' => 'snmp_standard::mode::interfaces',
|
||||
'list-interfaces' => 'snmp_standard::mode::listinterfaces',
|
||||
'list-spanning-trees' => 'snmp_standard::mode::listspanningtrees',
|
||||
'flash-memory' => 'network::alcatel::omniswitch::snmp::mode::flashmemory',
|
||||
'memory' => 'network::alcatel::omniswitch::snmp::mode::memory',
|
||||
'spanning-tree' => 'snmp_standard::mode::spanningtree',
|
||||
);
|
||||
$self->{modes} = {
|
||||
'cpu' => 'network::alcatel::omniswitch::snmp::mode::cpu',
|
||||
'hardware' => 'network::alcatel::omniswitch::snmp::mode::hardware',
|
||||
'interfaces' => 'snmp_standard::mode::interfaces',
|
||||
'list-interfaces' => 'snmp_standard::mode::listinterfaces',
|
||||
'list-spanning-trees' => 'snmp_standard::mode::listspanningtrees',
|
||||
'flash-memory' => 'network::alcatel::omniswitch::snmp::mode::flashmemory',
|
||||
'memory' => 'network::alcatel::omniswitch::snmp::mode::memory',
|
||||
'spanning-tree' => 'snmp_standard::mode::spanningtree'
|
||||
};
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue