+ correct few things after quentin feeback

thanks Quentin
This commit is contained in:
Sims24 2016-05-04 16:37:07 +02:00
parent 26f63ca6b5
commit 08453c9f7f
1 changed files with 2 additions and 7 deletions

View File

@ -49,7 +49,7 @@ sub set_counters {
sub custom_usage_perfdata {
my ($self, %options) = @_;
my $label = 'tbs_' . $self->{result_values}->{display} . '_used';
my $label = 'tbs_' . $self->{result_values}->{display} . '_usage';
my $value_perf = $self->{result_values}->{used};
if (defined($instance_mode->{option_results}->{free})) {
$label = 'tbs_' . $self->{result_values}->{display} . '_free';
@ -108,12 +108,7 @@ sub custom_usage_calc {
$self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total};
$self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used};
$self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used};
# snapshot can be over 100%
if ($self->{result_values}->{free} < 0) {
$self->{result_values}->{free} = 0;
$self->{result_values}->{prct_free} = 0;
}
return 0;
}