fix azure plugin typos, helpers and other (#1159)
* fix several typos * fix several typos, helpers, and other
This commit is contained in:
parent
edad8be10e
commit
0b6dc7ccb6
|
@ -85,7 +85,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"filter-metric:s" => { name => 'filter_metric' },
|
||||
});
|
||||
|
||||
|
|
|
@ -164,9 +164,9 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"filter-metric:s" => { name => 'filter_metric' },
|
||||
"per-sec" => { name => 'per_sec' },
|
||||
"per-sec" => { name => 'per_sec' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
@ -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}}) {
|
||||
|
|
|
@ -33,8 +33,8 @@ sub new {
|
|||
$self->{version} = '1.0';
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -123,9 +123,9 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"filter-metric:s" => { name => 'filter_metric' },
|
||||
"per-sec" => { name => 'per_sec' },
|
||||
"per-sec" => { name => 'per_sec' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -93,8 +93,8 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-type:s" => { name => 'resource_type' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-type:s" => { name => 'resource_type' },
|
||||
"resource-namespace:s" => { name => 'resource_namespace' },
|
||||
"metric:s@" => { name => 'metric' },
|
||||
});
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ sub new {
|
|||
$self->{version} = '1.0';
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"location:s" => { name => 'location' },
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"location:s" => { name => 'location' },
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -33,10 +33,10 @@ sub new {
|
|||
$self->{version} = '1.0';
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"location:s" => { name => 'location' },
|
||||
"filter-type:s" => { name => 'filter_type' },
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"location:s" => { name => 'location' },
|
||||
"filter-type:s" => { name => 'filter_type' },
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -33,9 +33,9 @@ sub new {
|
|||
$self->{version} = '1.0';
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"location:s" => { name => 'location' },
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"location:s" => { name => 'location' },
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -168,9 +168,9 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"filter-metric:s" => { name => 'filter_metric' },
|
||||
"per-sec" => { name => 'per_sec' },
|
||||
"per-sec" => { name => 'per_sec' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
@ -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;
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -66,7 +66,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -66,7 +66,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -65,7 +65,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -65,7 +65,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
@ -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
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
@ -176,7 +176,7 @@ perl centreon_plugins.pl --plugin=cloud::azure::storage::storageaccount::plugin
|
|||
--resource='/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Storage/storageAccounts/xxx/fileServices/default'
|
||||
--aggregation='average' --critical-filecapacity-average='10' --verbose
|
||||
|
||||
Default aggregation: 'average' /Total and average are valid.
|
||||
Default aggregation: 'average' / Total and average are valid.
|
||||
|
||||
=over 8
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -65,7 +65,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -33,9 +33,9 @@ sub new {
|
|||
$self->{version} = '1.0';
|
||||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"location:s" => { name => 'location' },
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"location:s" => { name => 'location' },
|
||||
"filter-name:s" => { name => 'filter_name' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -66,7 +66,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
@ -176,7 +176,7 @@ perl centreon_plugins.pl --plugin=cloud::azure::storage::storageaccount::plugin
|
|||
--resource='/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Storage/storageAccounts/xxx/queueServices/default'
|
||||
--aggregation='average' --critical-queuecapacity-average='10' --verbose
|
||||
|
||||
Default aggregation: 'average' /Total and average are valid.
|
||||
Default aggregation: 'average' / Total and average are valid.
|
||||
|
||||
=over 8
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -65,7 +65,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -66,7 +66,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
@ -176,7 +176,7 @@ perl centreon_plugins.pl --plugin=cloud::azure::storage::storageaccount::plugin
|
|||
--resource='/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Storage/storageAccounts/xxx/tableServices/default'
|
||||
--aggregation='average' --critical-tablecapacity-average='10' --verbose
|
||||
|
||||
Default aggregation: 'average' /Total and average are valid.
|
||||
Default aggregation: 'average' / Total and average are valid.
|
||||
|
||||
=over 8
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -65,7 +65,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -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 },
|
||||
],
|
||||
}
|
||||
};
|
||||
|
@ -69,7 +69,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-namespace:s" => { name => 'resource_namespace' },
|
||||
});
|
||||
|
||||
|
|
|
@ -123,9 +123,9 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-namespace:s" => { name => 'resource_namespace' },
|
||||
"per-sec" => { name => 'per_sec' },
|
||||
"per-sec" => { name => 'per_sec' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
|
@ -71,7 +71,7 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-namespace:s" => { name => 'resource_namespace' },
|
||||
"filter-metric:s" => { name => 'filter_metric' },
|
||||
});
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
@ -125,10 +125,10 @@ sub new {
|
|||
$options{options}->add_options(arguments =>
|
||||
{
|
||||
"resource:s@" => { name => 'resource' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-group:s" => { name => 'resource_group' },
|
||||
"resource-namespace:s" => { name => 'resource_namespace' },
|
||||
"filter-metric:s" => { name => 'filter_metric' },
|
||||
"per-sec" => { name => 'per_sec' },
|
||||
"per-sec" => { name => 'per_sec' },
|
||||
});
|
||||
|
||||
return $self;
|
||||
|
|
Loading…
Reference in New Issue