fix azure plugin typos, helpers and other (#1159)

* fix several typos

* fix several typos, helpers, and other
This commit is contained in:
Colin Gagnaire 2018-09-28 16:56:17 +02:00 committed by GitHub
parent edad8be10e
commit 0b6dc7ccb6
29 changed files with 58 additions and 58 deletions

View File

@ -198,7 +198,7 @@ sub check_options {
$self->{az_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 900;
$self->{az_interval} = defined($self->{option_results}->{interval}) ? $self->{option_results}->{interval} : "PT5M";
$self->{az_aggregations} = ['Total', 'Average'];
$self->{az_aggregations} = ['Average'];
if (defined($self->{option_results}->{aggregation})) {
$self->{az_aggregations} = [];
foreach my $stat (@{$self->{option_results}->{aggregation}}) {

View File

@ -172,12 +172,12 @@ Filter resource name (Can be a regexp).
=item B<--warning-*>
Threshold warning.
Can be: 'items'.
Can be: 'total', 'compute', 'storage', 'network'.
=item B<--critical-*>
Threshold critical.
Can be: 'items'.
Can be: 'total', 'compute', 'storage', 'network'.
=back

View File

@ -187,7 +187,7 @@ sub check_options {
$self->{az_resource_group} = '';
$self->{az_resource_type} = 'networkInterfaces';
$self->{az_resource_namespace} = 'Microsoft.Compute';
$self->{az_resource_namespace} = 'Microsoft.Network';
foreach my $resource (@{$self->{option_results}->{resource}}) {
push @{$self->{az_resource}}, $resource;

View File

@ -32,7 +32,7 @@ sub new {
$self->{version} = '0.1';
%{ $self->{modes} } = (
'list-resources' => 'cloud::azure::network::networkinterface::mode::listresources',
'throughput' => 'cloud::azure::network::networkinterface::mode::traffic',
'traffic' => 'cloud::azure::network::networkinterface::mode::traffic',
);
$self->{custom_modes}{azcli} = 'cloud::azure::custom::azcli';

View File

@ -167,13 +167,13 @@ Example:
Using resource name :
perl centreon_plugins.pl --plugin=cloud::azure::storage::storageaccount::plugin --custommode=azcli --mode=blob-capacity
--resource=MYFILER --resource-group=MYHOSTGROUP --aggregation='total' --critical-blobcapacity-total='10' --verbose
--resource=MYFILER --resource-group=MYHOSTGROUP --aggregation='total' --critical-blobcount-total='10' --verbose
Using resource id :
perl centreon_plugins.pl --plugin=cloud::azure::storage::storageaccount::plugin --custommode=azcli --mode=blob-capacity
--resource='/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Storage/storageAccounts/xxx/blobServices/default'
--aggregation='total' --critical-blobcapacity-total='10' --verbose
--aggregation='total' --critical-blobcount-total='10' --verbose
Default aggregation: 'total' / Only total is valid.
@ -187,11 +187,11 @@ Set resource name or id (Required).
Set resource group (Required if resource's name is used).
=item B<--warning-blobcapacity-total>
=item B<--warning-blobcount-total>
Thresholds warning
=item B<--critical-blobcapacity-total>
=item B<--critical-blobcount-total>
Thresholds critical

View File

@ -47,11 +47,11 @@ sub set_counters {
my $metric_label = lc($metric);
my $entry = { label => $metric_label . '-' . $aggregation, set => {
key_values => [ { name => $metric_label . '_' . $aggregation }, { name => 'display' }, { name => 'stat' } ],
output_template => $metric . ': %.2f',
output_template => $metric . ': %.2f %%',
perfdatas => [
{ label => $metric_label . '_' . $aggregation, value => $metric_label . '_' . $aggregation . '_absolute',
template => '%.2f', label_extra_instance => 1, instance_use => 'display_absolute',
min => 0 },
unit => '%', min => 0, max => 100 },
],
}
};

View File

@ -82,10 +82,10 @@ sub custom_usage_output {
if (defined($instance_mode->{option_results}->{per_sec})) {
my ($value, $unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{value_per_sec});
$msg = $self->{result_values}->{metric_name} . ": " . $value . $unit . "/s";
$msg = $self->{result_values}->{metric_name} . ": " . $value . ' ' . $unit . "/s";
} else {
my ($value, $unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{value});
$msg = $self->{result_values}->{metric_name} . ": " . $value . $unit;
$msg = $self->{result_values}->{metric_name} . ": " . $value . ' ' . $unit;
}
return $msg;
}