mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
(plugin) storage::emc::isilon::snmp - mode hardware fix power component filter (#4428)
This commit is contained in:
parent
97d7a8ba6d
commit
8a4e3be5a7
@ -27,7 +27,7 @@ my $mapping = {
|
|||||||
diskLogicalNumber => { oid => '.1.3.6.1.4.1.12124.2.52.1.2' },
|
diskLogicalNumber => { oid => '.1.3.6.1.4.1.12124.2.52.1.2' },
|
||||||
diskChassisNumber => { oid => '.1.3.6.1.4.1.12124.2.52.1.3' },
|
diskChassisNumber => { oid => '.1.3.6.1.4.1.12124.2.52.1.3' },
|
||||||
diskDeviceName => { oid => '.1.3.6.1.4.1.12124.2.52.1.4' },
|
diskDeviceName => { oid => '.1.3.6.1.4.1.12124.2.52.1.4' },
|
||||||
diskStatus => { oid => '.1.3.6.1.4.1.12124.2.52.1.5' },
|
diskStatus => { oid => '.1.3.6.1.4.1.12124.2.52.1.5' }
|
||||||
};
|
};
|
||||||
my $oid_diskEntry = '.1.3.6.1.4.1.12124.2.52.1';
|
my $oid_diskEntry = '.1.3.6.1.4.1.12124.2.52.1';
|
||||||
|
|
||||||
@ -52,15 +52,20 @@ sub check {
|
|||||||
next if ($self->check_filter(section => 'disk', instance => $instance));
|
next if ($self->check_filter(section => 'disk', instance => $instance));
|
||||||
$self->{components}->{disk}->{total}++;
|
$self->{components}->{disk}->{total}++;
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("disk '%s' status is '%s' [instance = %s] [logical = %s] [chassis = %s]",
|
$self->{output}->output_add(
|
||||||
|
long_msg => sprintf(
|
||||||
|
"disk '%s' status is '%s' [instance: %s] [logical: %s] [chassis: %s]",
|
||||||
$result->{diskDeviceName}, $result->{diskStatus}, $instance,
|
$result->{diskDeviceName}, $result->{diskStatus}, $instance,
|
||||||
$result->{diskLogicalNumber}, $result->{diskChassisNumber}
|
$result->{diskLogicalNumber}, $result->{diskChassisNumber}
|
||||||
));
|
)
|
||||||
|
);
|
||||||
|
|
||||||
my $exit = $self->get_severity(section => 'disk', value => $result->{diskStatus});
|
my $exit = $self->get_severity(section => 'disk', value => $result->{diskStatus});
|
||||||
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("Disk '%s' status is '%s'", $result->{diskDeviceName}, $result->{diskStatus}));
|
severity => $exit,
|
||||||
|
short_msg => sprintf("Disk '%s' status is '%s'", $result->{diskDeviceName}, $result->{diskStatus})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,23 +52,30 @@ 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' is %s rpm [instance = %s] [description = %s]",
|
$self->{output}->output_add(
|
||||||
|
long_msg => sprintf(
|
||||||
|
"fan '%s' is %s rpm [instance = %s] [description = %s]",
|
||||||
$result->{fanName}, $result->{fanSpeed}, $instance,
|
$result->{fanName}, $result->{fanSpeed}, $instance,
|
||||||
$result->{fanDescription}));
|
$result->{fanDescription}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{fanSpeed});
|
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{fanSpeed});
|
||||||
|
|
||||||
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' is %s rpm", $result->{fanName}, $result->{fanSpeed}));
|
severity => $exit,
|
||||||
|
short_msg => sprintf("Fan '%s' is %s rpm", $result->{fanName}, $result->{fanSpeed})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => 'speed', unit => 'rpm',
|
label => 'speed', unit => 'rpm',
|
||||||
nlabel => 'hardware.fan.speed.rpm',
|
nlabel => 'hardware.fan.speed.rpm',
|
||||||
instances => $result->{fanName},
|
instances => $result->{fanName},
|
||||||
value => $result->{fanSpeed},
|
value => $result->{fanSpeed},
|
||||||
warning => $warn,
|
warning => $warn,
|
||||||
critical => $crit,
|
critical => $crit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ use warnings;
|
|||||||
my $mapping = {
|
my $mapping = {
|
||||||
powerSensorName => { oid => '.1.3.6.1.4.1.12124.2.55.1.2' },
|
powerSensorName => { oid => '.1.3.6.1.4.1.12124.2.55.1.2' },
|
||||||
powerSensorDescription => { oid => '.1.3.6.1.4.1.12124.2.55.1.3' },
|
powerSensorDescription => { oid => '.1.3.6.1.4.1.12124.2.55.1.3' },
|
||||||
powerSensorValue => { oid => '.1.3.6.1.4.1.12124.2.55.1.4' },
|
powerSensorValue => { oid => '.1.3.6.1.4.1.12124.2.55.1.4' }
|
||||||
};
|
};
|
||||||
|
|
||||||
my $oid_powerSensorEntry = '.1.3.6.1.4.1.12124.2.55.1';
|
my $oid_powerSensorEntry = '.1.3.6.1.4.1.12124.2.55.1';
|
||||||
@ -52,16 +52,23 @@ sub check {
|
|||||||
next if ($self->check_filter(section => 'power', instance => $instance));
|
next if ($self->check_filter(section => 'power', instance => $instance));
|
||||||
$self->{components}->{power}->{total}++;
|
$self->{components}->{power}->{total}++;
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("Power '%s' sensor is %s [instance = %s] [description = %s]",
|
$self->{output}->output_add(
|
||||||
|
long_msg => sprintf(
|
||||||
|
"power '%s' sensor is %s [instance: %s] [description: %s]",
|
||||||
$result->{powerSensorName}, $result->{powerSensorValue}, $instance,
|
$result->{powerSensorName}, $result->{powerSensorValue}, $instance,
|
||||||
$result->{powerSensorDescription}));
|
$result->{powerSensorDescription}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan', instance => $instance, value => $result->{powerSensorValue});
|
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'power', instance => $instance, value => $result->{powerSensorValue});
|
||||||
|
|
||||||
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 '%s' sensor is %s (Volt or Amp)", $result->{powerSensorName}, $result->{powerSensorValue}));
|
severity => $exit,
|
||||||
|
short_msg => sprintf("Power '%s' sensor is %s (Volt or Amp)", $result->{powerSensorName}, $result->{powerSensorValue})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => 'power',
|
label => 'power',
|
||||||
nlabel => 'hardware.power.sensor.count',
|
nlabel => 'hardware.power.sensor.count',
|
||||||
|
@ -26,7 +26,7 @@ use warnings;
|
|||||||
my $mapping = {
|
my $mapping = {
|
||||||
tempSensorName => { oid => '.1.3.6.1.4.1.12124.2.54.1.2' },
|
tempSensorName => { oid => '.1.3.6.1.4.1.12124.2.54.1.2' },
|
||||||
tempSensorDescription => { oid => '.1.3.6.1.4.1.12124.2.54.1.3' },
|
tempSensorDescription => { oid => '.1.3.6.1.4.1.12124.2.54.1.3' },
|
||||||
tempSensorValue => { oid => '.1.3.6.1.4.1.12124.2.54.1.4' },
|
tempSensorValue => { oid => '.1.3.6.1.4.1.12124.2.54.1.4' }
|
||||||
};
|
};
|
||||||
|
|
||||||
my $oid_tempSensorEntry = '.1.3.6.1.4.1.12124.2.54.1';
|
my $oid_tempSensorEntry = '.1.3.6.1.4.1.12124.2.54.1';
|
||||||
@ -52,23 +52,30 @@ sub check {
|
|||||||
next if ($self->check_filter(section => 'temperature', instance => $instance));
|
next if ($self->check_filter(section => 'temperature', instance => $instance));
|
||||||
$self->{components}->{temperature}->{total}++;
|
$self->{components}->{temperature}->{total}++;
|
||||||
|
|
||||||
$self->{output}->output_add(long_msg => sprintf("temperature '%s' is %s C [instance = %s] [description = %s]",
|
$self->{output}->output_add(
|
||||||
|
long_msg => sprintf(
|
||||||
|
"temperature '%s' is %s C [instance: %s] [description: %s]",
|
||||||
$result->{tempSensorName}, $result->{tempSensorValue}, $instance,
|
$result->{tempSensorName}, $result->{tempSensorValue}, $instance,
|
||||||
$result->{tempSensorDescription}));
|
$result->{tempSensorDescription}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{tempSensorValue});
|
my ($exit, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'temperature', instance => $instance, value => $result->{tempSensorValue});
|
||||||
|
|
||||||
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("Temperature '%s' is %s C", $result->{tempSensorName}, $result->{tempSensorValue}));
|
severity => $exit,
|
||||||
|
short_msg => sprintf("Temperature '%s' is %s C", $result->{tempSensorName}, $result->{tempSensorValue})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{output}->perfdata_add(
|
$self->{output}->perfdata_add(
|
||||||
label => 'temperature', unit => 'C',
|
label => 'temperature', unit => 'C',
|
||||||
nlabel => 'hardware.temperature.celsius',
|
nlabel => 'hardware.temperature.celsius',
|
||||||
instances => $result->{tempSensorName},
|
instances => $result->{tempSensorName},
|
||||||
value => $result->{tempSensorValue},
|
value => $result->{tempSensorValue},
|
||||||
warning => $warn,
|
warning => $warn,
|
||||||
critical => $crit,
|
critical => $crit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user