add new metrics qnap hardware

This commit is contained in:
garnier-quentin 2019-04-16 17:34:34 +02:00
parent 588a5dcd7b
commit 1c2f8aaee9
3 changed files with 25 additions and 13 deletions

View File

@ -89,11 +89,14 @@ sub check {
$self->{output}->output_add(severity => $exit2,
short_msg => sprintf("Disk '%s' temperature is %s degree centigrade", $result->{HdDescr}, $disk_temp));
}
$self->{output}->perfdata_add(label => 'temp_disk_' . $instance, unit => 'C',
value => $disk_temp
);
$self->{output}->perfdata_add(
label => 'temp_disk', unit => 'C',
nlabel => 'hardware.disk.temperature.celsius',
instances => $instance,
value => $disk_temp
);
}
}
}
1;
1;

View File

@ -61,9 +61,12 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("Fan '%s' speed is %s rpm", $fan_descr, $fan_speed_value));
}
$self->{output}->perfdata_add(label => 'fan_' . $instance, unit => 'rpm',
value => $fan_speed_value, min => 0
);
$self->{output}->perfdata_add(
label => 'fan', unit => 'rpm',
nlabel => 'hardware.fan.speed.rpm',
instances => $instance,
value => $fan_speed_value, min => 0
);
}
}
}

View File

@ -54,9 +54,12 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("CPU Temperature is '%s' degree centigrade", $value));
}
$self->{output}->perfdata_add(label => 'temp_cpu', unit => 'C',
value => $value
);
$self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => 'cpu',
value => $value
);
}
my $system_temp = defined($self->{results}->{$oid_SystemTemperature_entry}->{$oid_SystemTemperature}) ?
@ -71,9 +74,12 @@ sub check {
$self->{output}->output_add(severity => $exit,
short_msg => sprintf("System Temperature is '%s' degree centigrade", $value));
}
$self->{output}->perfdata_add(label => 'temp_system', unit => 'C',
value => $value
);
$self->{output}->perfdata_add(
label => 'temp', unit => 'C',
nlabel => 'hardware.temperature.celsius',
instances => 'system',
value => $value
);
}
}