mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-28 16:14:21 +02:00
+ Fix #640
This commit is contained in:
parent
266a584aa5
commit
95afb0bb04
@ -30,6 +30,8 @@ use centreon::plugins::misc;
|
|||||||
my %unit_managed = (
|
my %unit_managed = (
|
||||||
3 => 1, # tenThousandthsOfInches(3), -- .0001
|
3 => 1, # tenThousandthsOfInches(3), -- .0001
|
||||||
4 => 1, # micrometers(4),
|
4 => 1, # micrometers(4),
|
||||||
|
7 => 1, # impressions(7),
|
||||||
|
8 => 1, # sheets(8),
|
||||||
12 => 1, # thousandthsOfOunces(12),
|
12 => 1, # thousandthsOfOunces(12),
|
||||||
13 => 1, # tenthsOfGrams(13),
|
13 => 1, # tenthsOfGrams(13),
|
||||||
14 => 1, # hundrethsOfFluidOunces(14),
|
14 => 1, # hundrethsOfFluidOunces(14),
|
||||||
@ -128,7 +130,7 @@ sub run {
|
|||||||
$prct_value = $current_value * 100 / $max_value;
|
$prct_value = $current_value * 100 / $max_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $exit = $self->{perfdata}->threshold_check(value => $prct_value, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
my $exit = $self->{perfdata}->threshold_check(value => $prct_value, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]);
|
||||||
$self->{output}->output_add(long_msg => sprintf("Marker supply '%s': %.2f %% [instance: '%s']", $descr, $prct_value, $hrDeviceIndex . '.' . $prtMarkerSuppliesIndex));
|
$self->{output}->output_add(long_msg => sprintf("Marker supply '%s': %.2f %% [instance: '%s']", $descr, $prct_value, $hrDeviceIndex . '.' . $prtMarkerSuppliesIndex));
|
||||||
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(severity => $exit,
|
||||||
@ -136,8 +138,9 @@ sub run {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $label = $descr;
|
my $label = $descr;
|
||||||
if ($result->{$oid_prtMarkerSuppliesColorantIndex . '.' . $instance} != 0) {
|
if ($result->{$oid_prtMarkerSuppliesColorantIndex . '.' . $instance} != 0 &&
|
||||||
$label = $result2->{$oid_prtMarkerColorantValue . '.' . $hrDeviceIndex . '.' . $result->{$oid_prtMarkerSuppliesColorantIndex . '.' . $instance}};
|
defined($result2->{$oid_prtMarkerColorantValue . '.' . $hrDeviceIndex . '.' . $result->{$oid_prtMarkerSuppliesColorantIndex . '.' . $instance}})) {
|
||||||
|
$label .= '#' . $result2->{$oid_prtMarkerColorantValue . '.' . $hrDeviceIndex . '.' . $result->{$oid_prtMarkerSuppliesColorantIndex . '.' . $instance}};
|
||||||
if (defined($perf_label->{$label})) {
|
if (defined($perf_label->{$label})) {
|
||||||
$label .= '#' . $hrDeviceIndex . '#' . $prtMarkerSuppliesIndex;
|
$label .= '#' . $hrDeviceIndex . '#' . $prtMarkerSuppliesIndex;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user