diff --git a/apps/vmware/connector/mode/datastoreio.pm b/apps/vmware/connector/mode/datastoreio.pm index d0de14866..4d933a139 100644 --- a/apps/vmware/connector/mode/datastoreio.pm +++ b/apps/vmware/connector/mode/datastoreio.pm @@ -49,7 +49,7 @@ sub set_counters { ]; $self->{maps_counters}->{global} = [ - { label => 'total-read', nlabel => 'datastore.read.usage.bytesperseconds', set => { + { label => 'total-read', nlabel => 'datastore.read.usage.bytespersecond', set => { key_values => [ { name => 'read' } ], output_template => 'Total rate of reading data: %s %s/s', output_change_bytes => 1, @@ -59,7 +59,7 @@ sub set_counters { ], } }, - { label => 'total-write', nlabel => 'datastore.write.usage.bytesperseconds', set => { + { label => 'total-write', nlabel => 'datastore.write.usage.bytespersecond', set => { key_values => [ { name => 'write' } ], output_template => 'Total rate of writing data: %s %s/s', output_change_bytes => 1, @@ -80,7 +80,7 @@ sub set_counters { closure_custom_threshold_check => \&catalog_status_threshold, } }, - { label => 'read', nlabel => 'datastore.read.usage.bytesperseconds', set => { + { label => 'read', nlabel => 'datastore.read.usage.bytespersecond', set => { key_values => [ { name => 'read' } ], output_template => 'rate of reading data: %s %s/s', output_change_bytes => 1, @@ -90,7 +90,7 @@ sub set_counters { ], } }, - { label => 'write', nlabel => 'datastore.write.usage.bytesperseconds', set => { + { label => 'write', nlabel => 'datastore.write.usage.bytespersecond', set => { key_values => [ { name => 'write' } ], output_template => 'rate of writing data: %s %s/s', output_change_bytes => 1, diff --git a/apps/vmware/connector/mode/swaphost.pm b/apps/vmware/connector/mode/swaphost.pm index 514b1ea59..5f7f1c95d 100644 --- a/apps/vmware/connector/mode/swaphost.pm +++ b/apps/vmware/connector/mode/swaphost.pm @@ -56,7 +56,7 @@ sub set_counters { closure_custom_threshold_check => \&catalog_status_threshold, } }, - { label => 'swap-in', nlabel => 'host.swap.in.usage.bytesperseconds', set => { + { label => 'swap-in', nlabel => 'host.swap.in.usage.bytespersecond', set => { key_values => [ { name => 'swap_in' }, { name => 'display' } ], output_template => 'Swap In: %s %s/s', output_change_bytes => 1, @@ -66,7 +66,7 @@ sub set_counters { ], } }, - { label => 'swap-out', nlabel => 'host.swap.out.usage.bytesperseconds', set => { + { label => 'swap-out', nlabel => 'host.swap.out.usage.bytespersecond', set => { key_values => [ { name => 'swap_out' }, { name => 'display' } ], output_template => 'Swap Out: %s %s/s', output_change_bytes => 1, diff --git a/apps/vmware/connector/mode/swapvm.pm b/apps/vmware/connector/mode/swapvm.pm index deb149b3d..9a715ecae 100644 --- a/apps/vmware/connector/mode/swapvm.pm +++ b/apps/vmware/connector/mode/swapvm.pm @@ -57,7 +57,7 @@ sub set_counters { closure_custom_threshold_check => \&catalog_status_threshold, } }, - { label => 'swap-in', nlabel => 'vm.swap.in.usage.bytesperseconds', set => { + { label => 'swap-in', nlabel => 'vm.swap.in.usage.bytespersecond', set => { key_values => [ { name => 'swap_in' }, { name => 'display' } ], output_template => 'Swap In: %s %s/s', output_change_bytes => 1, @@ -67,7 +67,7 @@ sub set_counters { ], } }, - { label => 'swap-out', nlabel => 'vm.swap.out.usage.bytesperseconds', set => { + { label => 'swap-out', nlabel => 'vm.swap.out.usage.bytespersecond', set => { key_values => [ { name => 'swap_out' }, { name => 'display' } ], output_template => 'Swap Out: %s %s/s', output_change_bytes => 1, diff --git a/hardware/pdu/apc/snmp/mode/components/humidity.pm b/hardware/pdu/apc/snmp/mode/components/humidity.pm index 893665e6c..ea1ee4fb5 100644 --- a/hardware/pdu/apc/snmp/mode/components/humidity.pm +++ b/hardware/pdu/apc/snmp/mode/components/humidity.pm @@ -92,13 +92,17 @@ sub check { $self->{output}->output_add(severity => $exit2, short_msg => sprintf("Humidity '%s' value is %s %%", $result->{rPDU2SensorTempHumidityStatusName}, $value)); } - $self->{output}->perfdata_add(label => 'hum_' . $result->{rPDU2SensorTempHumidityStatusName}, unit => '%', - value => $value, - warning => $warn, - critical => $crit, - min => 0, max => 100); + $self->{output}->perfdata_add( + label => 'hum', unit => '%', + nlabel => 'hardware.sensor.humidity.percentage', + instances => $result->{rPDU2SensorTempHumidityStatusName}, + value => $value, + warning => $warn, + critical => $crit, + min => 0, max => 100 + ); } } } -1; \ No newline at end of file +1; diff --git a/hardware/pdu/apc/snmp/mode/components/temperature.pm b/hardware/pdu/apc/snmp/mode/components/temperature.pm index 4594c827c..91256a26c 100644 --- a/hardware/pdu/apc/snmp/mode/components/temperature.pm +++ b/hardware/pdu/apc/snmp/mode/components/temperature.pm @@ -92,12 +92,16 @@ sub check { $self->{output}->output_add(severity => $exit2, short_msg => sprintf("Temperature '%s' value is %s C", $result->{rPDU2SensorTempHumidityStatusName}, $value)); } - $self->{output}->perfdata_add(label => 'temp_' . $result->{rPDU2SensorTempHumidityStatusName}, unit => 'C', - value => $value, - warning => $warn, - critical => $crit); + $self->{output}->perfdata_add( + label => 'temp', unit => 'C', + nlabel => 'hardware.sensor.temperature.celsius', + instances => $result->{rPDU2SensorTempHumidityStatusName}, + value => $value, + warning => $warn, + critical => $crit + ); } } } -1; \ No newline at end of file +1; diff --git a/hardware/server/hp/ilo/xmlapi/mode/components/fan.pm b/hardware/server/hp/ilo/xmlapi/mode/components/fan.pm index 2037607e3..f568f292c 100644 --- a/hardware/server/hp/ilo/xmlapi/mode/components/fan.pm +++ b/hardware/server/hp/ilo/xmlapi/mode/components/fan.pm @@ -71,13 +71,16 @@ sub check { $self->{output}->output_add(severity => $exit2, short_msg => sprintf("Fan '%s' is %s %s", $result->{LABEL}->{VALUE}, $result->{SPEED}->{VALUE}, $unit)); } - $self->{output}->perfdata_add(label => 'fan_' . $instance, unit => $unit, - value => $result->{SPEED}->{VALUE}, - warning => $warn, - critical => $crit, - min => 0 - ); + $self->{output}->perfdata_add( + label => 'fan', unit => $unit, + nlabel => 'hardware.fan.speed.' . lc($result->{SPEED}->{UNIT}), + instances => $instance, + value => $result->{SPEED}->{VALUE}, + warning => $warn, + critical => $crit, + min => 0 + ); } } -1; \ No newline at end of file +1; diff --git a/hardware/server/hp/ilo/xmlapi/mode/components/temperature.pm b/hardware/server/hp/ilo/xmlapi/mode/components/temperature.pm index b54dcbdae..6f268072f 100644 --- a/hardware/server/hp/ilo/xmlapi/mode/components/temperature.pm +++ b/hardware/server/hp/ilo/xmlapi/mode/components/temperature.pm @@ -72,12 +72,15 @@ sub check { $self->{output}->output_add(severity => $exit2, short_msg => sprintf("Temperature '%s' is %s %s", $result->{LABEL}->{VALUE}, $result->{CURRENTREADING}->{VALUE}, $unit)); } - $self->{output}->perfdata_add(label => 'temp_' . $instance, unit => $unit, - value => $result->{CURRENTREADING}->{VALUE}, - warning => $warn, - critical => $crit, - ); + $self->{output}->perfdata_add( + label => 'temp', unit => $unit, + nlabel => 'hardware.temperature.' . lc($result->{CURRENTREADING}->{UNIT}), + instances => $instance, + value => $result->{CURRENTREADING}->{VALUE}, + warning => $warn, + critical => $crit, + ); } } -1; \ No newline at end of file +1; diff --git a/hardware/server/huawei/ibmc/snmp/mode/components/fan.pm b/hardware/server/huawei/ibmc/snmp/mode/components/fan.pm index 3f021b43a..c8f6caf2d 100644 --- a/hardware/server/huawei/ibmc/snmp/mode/components/fan.pm +++ b/hardware/server/huawei/ibmc/snmp/mode/components/fan.pm @@ -75,12 +75,11 @@ sub check { $self->{output}->output_add(severity => $exit, short_msg => sprintf("Fan '%s' speed is %s RPM", $result->{fanDevicename}, $result->{fanSpeed})); } - my $perf_label = $result->{fanDevicename}; - $perf_label =~ s/ /_/g; + $self->{output}->perfdata_add( label => 'speed', unit => 'rpm', nlabel => 'hardware.fan.speed.rpm', - instances => $perf_label, + instances => $result->{fanDevicename}, value => $result->{fanSpeed}, warning => $warn, critical => $crit, diff --git a/hardware/server/huawei/ibmc/snmp/mode/components/harddisk.pm b/hardware/server/huawei/ibmc/snmp/mode/components/harddisk.pm index 7f51c4389..0efcda209 100644 --- a/hardware/server/huawei/ibmc/snmp/mode/components/harddisk.pm +++ b/hardware/server/huawei/ibmc/snmp/mode/components/harddisk.pm @@ -75,12 +75,11 @@ sub check { $self->{output}->output_add(severity => $exit, short_msg => sprintf("Hard Disk '%s' temperature is %s celsius degrees", $result->{hardDiskDevicename}, $result->{hardDiskTemperature})); } - my $perf_label = $result->{hardDiskDevicename}; - $perf_label =~ s/ /_/g; + $self->{output}->perfdata_add( label => 'temperature', unit => 'C', nlabel => 'hardware.harddisk.temperature.celsius', - instances => $perf_label, + instances => $result->{hardDiskDevicename}, value => $result->{hardDiskTemperature}, warning => $warn, critical => $crit, diff --git a/hardware/server/huawei/ibmc/snmp/mode/components/psu.pm b/hardware/server/huawei/ibmc/snmp/mode/components/psu.pm index 93d940872..29ef12462 100644 --- a/hardware/server/huawei/ibmc/snmp/mode/components/psu.pm +++ b/hardware/server/huawei/ibmc/snmp/mode/components/psu.pm @@ -77,15 +77,17 @@ sub check { $self->{output}->output_add(severity => $exit, short_msg => sprintf("Power supply '%s' power is %s watts", $result->{powerSupplyDevicename}, $result->{powerSupplyInputPower})); } - my $perf_label = $result->{powerSupplyDevicename}; - $perf_label =~ s/ /_/g; - $self->{output}->perfdata_add(label => 'power_' . $perf_label, unit => 'W', - value => $result->{powerSupplyInputPower}, - warning => $warn, - critical => $crit, - min => 0, - max => $result->{powerSupplyPowerRating} - ); + + $self->{output}->perfdata_add( + label => 'power', unit => 'W', + nlabel => 'hardware.powersupply.power.watt', + instances => $result->{powerSupplyDevicename}, + value => $result->{powerSupplyInputPower}, + warning => $warn, + critical => $crit, + min => 0, + max => $result->{powerSupplyPowerRating} + ); } $self->{output}->output_add(long_msg => sprintf("Power supply '%s' status is '%s' [instance = %s]", @@ -100,4 +102,4 @@ sub check { } } -1; \ No newline at end of file +1; diff --git a/os/linux/local/mode/ntp.pm b/os/linux/local/mode/ntp.pm index a53bdaae5..354b733da 100644 --- a/os/linux/local/mode/ntp.pm +++ b/os/linux/local/mode/ntp.pm @@ -110,7 +110,7 @@ sub custom_offset_perfdata { ); } else { $self->{output}->perfdata_add( - label => 'offset' . $extra_label, unit => 'ms', + label => 'offset', unit => 'ms', instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display_absolute} : undef, value => $self->{result_values}->{offset_absolute}, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),