From 293759c1aed8ae92a3791fb48cb088d6bc7305e7 Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 28 Mar 2015 18:02:09 +0100 Subject: [PATCH] Refs #6231 --- apps/lmsensors/mode/fan.pm | 2 +- apps/lmsensors/mode/misc.pm | 4 ++-- apps/lmsensors/mode/temperature.pm | 2 +- apps/lmsensors/mode/voltage.pm | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/lmsensors/mode/fan.pm b/apps/lmsensors/mode/fan.pm index 22060a0ea..6aac312a0 100644 --- a/apps/lmsensors/mode/fan.pm +++ b/apps/lmsensors/mode/fan.pm @@ -112,7 +112,7 @@ sub run { my $label = 'sensor_fan'; my $extra_label = ''; - $extra_label = '_' . $SensorDesc if (!defined($self->{option_results}->{sensor}) || defined($self->{option_results}->{use_regexp})); + $extra_label = '_' . $SensorId . "_" . $SensorDesc if (!defined($self->{option_results}->{sensor}) || defined($self->{option_results}->{use_regexp})); $self->{output}->perfdata_add(label => $label . $extra_label, value => $SensorValue, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), diff --git a/apps/lmsensors/mode/misc.pm b/apps/lmsensors/mode/misc.pm index 08dc3c27b..69cef93c0 100644 --- a/apps/lmsensors/mode/misc.pm +++ b/apps/lmsensors/mode/misc.pm @@ -98,7 +98,7 @@ sub run { foreach my $SensorId (sort @{$self->{Sensor_id_selected}}) { my $SensorDesc = $SensorValueResult->{$oid_SensorDesc . '.' . $SensorId}; - my $SensorValue = $SensorValueResult->{$oid_SensorValue . '.' . $SensorId}; + my $SensorValue = $SensorValueResult->{$oid_SensorValue . '.' . $SensorId} / 1000; my $exit = $self->{perfdata}->threshold_check(value => $SensorValue, threshold => [ { label => 'critical', 'exit_litteral' => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); @@ -112,7 +112,7 @@ sub run { my $label = 'sensor_misc'; my $extra_label = ''; - $extra_label = '_' . $SensorDesc if (!defined($self->{option_results}->{sensor}) || defined($self->{option_results}->{use_regexp})); + $extra_label = '_' . $SensorId . "_" . $SensorDesc if (!defined($self->{option_results}->{sensor}) || defined($self->{option_results}->{use_regexp})); $self->{output}->perfdata_add(label => $label . $extra_label, value => $SensorValue, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), diff --git a/apps/lmsensors/mode/temperature.pm b/apps/lmsensors/mode/temperature.pm index 9730bd200..0560fe336 100644 --- a/apps/lmsensors/mode/temperature.pm +++ b/apps/lmsensors/mode/temperature.pm @@ -112,7 +112,7 @@ sub run { my $label = 'sensor_temperature'; my $extra_label = ''; - $extra_label = '_' . $SensorDesc if (!defined($self->{option_results}->{sensor}) || defined($self->{option_results}->{use_regexp})); + $extra_label = '_' . $SensorId . "_" . $SensorDesc if (!defined($self->{option_results}->{sensor}) || defined($self->{option_results}->{use_regexp})); $self->{output}->perfdata_add(label => $label . $extra_label, value => $SensorValue, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), diff --git a/apps/lmsensors/mode/voltage.pm b/apps/lmsensors/mode/voltage.pm index 2b71c4810..c9f64644a 100644 --- a/apps/lmsensors/mode/voltage.pm +++ b/apps/lmsensors/mode/voltage.pm @@ -112,7 +112,7 @@ sub run { my $label = 'sensor_voltage'; my $extra_label = ''; - $extra_label = '_' . $SensorDesc if (!defined($self->{option_results}->{sensor}) || defined($self->{option_results}->{use_regexp})); + $extra_label = '_' . $SensorId . "_" . $SensorDesc if (!defined($self->{option_results}->{sensor}) || defined($self->{option_results}->{use_regexp})); $self->{output}->perfdata_add(label => $label . $extra_label, unit => 'V', value => $SensorValue, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'),