change output for human and add filter metric for fsquota (#4009)
This commit is contained in:
parent
7f8ec50903
commit
e7c65871b2
|
@ -43,10 +43,11 @@ sub set_counters {
|
||||||
my $metric_label = lc($metric);
|
my $metric_label = lc($metric);
|
||||||
my $entry = { label => 'filesharequota' . '-' . $aggregation, set => {
|
my $entry = { label => 'filesharequota' . '-' . $aggregation, set => {
|
||||||
key_values => [ { name => $metric_label . '_' . $aggregation }, { name => 'display' }, { name => 'stat' } ],
|
key_values => [ { name => $metric_label . '_' . $aggregation }, { name => 'display' }, { name => 'stat' } ],
|
||||||
output_template => $metric . ': %s',
|
output_template => $metric . ': %s %s',
|
||||||
|
output_change_bytes => 1,
|
||||||
perfdatas => [
|
perfdatas => [
|
||||||
{ label => $metric_label . '_' . $aggregation, value => $metric_label . '_' . $aggregation ,
|
{ label => $metric_label . '_' . $aggregation, value => $metric_label . '_' . $aggregation ,
|
||||||
template => '%s', label_extra_instance => 1, instance_use => 'display',
|
template => '%s', unit => 'B', label_extra_instance => 1, instance_use => 'display',
|
||||||
min => 0 },
|
min => 0 },
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
@ -63,6 +64,7 @@ sub new {
|
||||||
|
|
||||||
$options{options}->add_options(arguments =>
|
$options{options}->add_options(arguments =>
|
||||||
{
|
{
|
||||||
|
"filter-dimension:s" => { name => 'filter_dimension' },
|
||||||
"resource:s@" => { name => 'resource' },
|
"resource:s@" => { name => 'resource' },
|
||||||
"resource-group:s" => { name => 'resource_group' },
|
"resource-group:s" => { name => 'resource_group' },
|
||||||
"resource-namespace:s" => { name => 'resource_namespace' }
|
"resource-namespace:s" => { name => 'resource_namespace' }
|
||||||
|
@ -84,6 +86,7 @@ sub check_options {
|
||||||
$self->{az_resource_group} = $self->{option_results}->{resource_group} if (defined($self->{option_results}->{resource_group}));
|
$self->{az_resource_group} = $self->{option_results}->{resource_group} if (defined($self->{option_results}->{resource_group}));
|
||||||
$self->{az_resource_type} = 'storageAccounts';
|
$self->{az_resource_type} = 'storageAccounts';
|
||||||
$self->{az_resource_namespace} = defined($self->{option_results}->{resource_namespace}) ? $self->{option_results}->{resource_namespace} : 'Microsoft.Storage';
|
$self->{az_resource_namespace} = defined($self->{option_results}->{resource_namespace}) ? $self->{option_results}->{resource_namespace} : 'Microsoft.Storage';
|
||||||
|
$self->{az_dimension} = $self->{option_results}->{filter_dimension} if (defined($self->{option_results}->{filter_dimension}));
|
||||||
$self->{az_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 3600;
|
$self->{az_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 3600;
|
||||||
$self->{az_interval} = defined($self->{option_results}->{interval}) ? $self->{option_results}->{interval} : "PT1H";
|
$self->{az_interval} = defined($self->{option_results}->{interval}) ? $self->{option_results}->{interval} : "PT1H";
|
||||||
$self->{az_aggregations} = ['Average'];
|
$self->{az_aggregations} = ['Average'];
|
||||||
|
@ -125,6 +128,7 @@ sub manage_selection {
|
||||||
resource_group => $resource_group,
|
resource_group => $resource_group,
|
||||||
resource_type => $self->{az_resource_type},
|
resource_type => $self->{az_resource_type},
|
||||||
resource_namespace => $self->{az_resource_namespace},
|
resource_namespace => $self->{az_resource_namespace},
|
||||||
|
dimension => $self->{az_dimension},
|
||||||
metrics => $self->{az_metrics},
|
metrics => $self->{az_metrics},
|
||||||
aggregations => $self->{az_aggregations},
|
aggregations => $self->{az_aggregations},
|
||||||
timeframe => $self->{az_timeframe},
|
timeframe => $self->{az_timeframe},
|
||||||
|
|
Loading…
Reference in New Issue