mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 15:44:21 +02:00
enh(purestorage::flasharray): Extend perf counter of mode array (#5576)
Co-authored-by: Roman Morandell <46994680+rmorandell-pgum@users.noreply.github.com>
This commit is contained in:
parent
798659439d
commit
17b22d20f5
@ -27,8 +27,9 @@ use warnings;
|
||||
|
||||
sub custom_usage_output {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total});
|
||||
|
||||
my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value =>
|
||||
$self->{result_values}->{total});
|
||||
my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used});
|
||||
my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free});
|
||||
return sprintf(
|
||||
@ -51,97 +52,219 @@ sub prefix_array_output {
|
||||
return "Array '" . $options{instance_value}->{name} . "' ";
|
||||
}
|
||||
|
||||
sub custom_bytes_per_second_perfdata {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->{output}->perfdata_add(
|
||||
nlabel => $self->{nlabel},
|
||||
unit => 'B/s',
|
||||
instances => [ $self->{result_values}->{name}, $self->{result_values}->{resolution} ],
|
||||
value => $self->{result_values}->{ $self->{key_values}->[0]->{name} },
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}),
|
||||
min => 0
|
||||
);
|
||||
}
|
||||
|
||||
sub custom_packet_perfdata {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->{output}->perfdata_add(
|
||||
nlabel => $self->{nlabel},
|
||||
unit => 'B',
|
||||
instances => [ $self->{result_values}->{name}, $self->{result_values}->{resolution} ],
|
||||
value => $self->{result_values}->{ $self->{key_values}->[0]->{name} },
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}),
|
||||
min => 0
|
||||
);
|
||||
}
|
||||
|
||||
sub custom_packet_per_seconds {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->{output}->perfdata_add(
|
||||
nlabel => $self->{nlabel},
|
||||
unit => '/s',
|
||||
instances => [ $self->{result_values}->{name}, $self->{result_values}->{resolution} ],
|
||||
value => $self->{result_values}->{ $self->{key_values}->[0]->{name} },
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}),
|
||||
min => 0
|
||||
);
|
||||
}
|
||||
|
||||
sub set_counters {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{maps_counters_type} = [
|
||||
{
|
||||
name => 'arrays', type => 3, cb_prefix_output => 'prefix_array_output', cb_long_output => 'array_long_output', indent_long_output => ' ',
|
||||
message_multiple => 'All arrays are ok',
|
||||
group => [
|
||||
name => 'arrays',
|
||||
type => 3,
|
||||
cb_prefix_output => 'prefix_array_output',
|
||||
cb_long_output => 'array_long_output',
|
||||
indent_long_output => ' ',
|
||||
message_multiple => 'All arrays are ok',
|
||||
group => [
|
||||
{ name => 'space', type => 0, skipped_code => { -10 => 1 } },
|
||||
{ name => 'reduction', type => 0, skipped_code => { -10 => 1 } },
|
||||
{ name => 'perf', type => 0, skipped_code => { -10 => 1 } }
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
$self->{maps_counters}->{space} = [
|
||||
{ label => 'space-usage', nlabel => 'array.space.usage.bytes', set => {
|
||||
key_values => [ { name => 'used' }, { name => 'free' }, { name => 'prct_used' }, { name => 'prct_free' }, { name => 'total' } ],
|
||||
closure_custom_output => $self->can('custom_usage_output'),
|
||||
perfdatas => [
|
||||
{ template => '%d', min => 0, max => 'total', unit => 'B', cast_int => 1, label_extra_instance => 1 }
|
||||
key_values =>
|
||||
[ { name => 'used' },
|
||||
{ name => 'free' },
|
||||
{ name => 'prct_used' },
|
||||
{ name => 'prct_free' },
|
||||
{ name => 'total' } ],
|
||||
closure_custom_output => $self->can('custom_usage_output'),
|
||||
perfdatas =>
|
||||
[
|
||||
{ template => '%d',
|
||||
min => 0,
|
||||
max => 'total',
|
||||
unit => 'B',
|
||||
cast_int => 1,
|
||||
label_extra_instance => 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{ label => 'space-usage-free', display_ok => 0, nlabel => 'array.space.free.bytes', set => {
|
||||
key_values => [ { name => 'free' }, { name => 'used' }, { name => 'prct_used' }, { name => 'prct_free' }, { name => 'total' } ],
|
||||
closure_custom_output => $self->can('custom_usage_output'),
|
||||
perfdatas => [
|
||||
{ template => '%d', min => 0, max => 'total', unit => 'B', cast_int => 1, label_extra_instance => 1 }
|
||||
key_values =>
|
||||
[ { name => 'free' },
|
||||
{ name => 'used' },
|
||||
{ name => 'prct_used' },
|
||||
{ name => 'prct_free' },
|
||||
{ name => 'total' } ],
|
||||
closure_custom_output => $self->can('custom_usage_output'),
|
||||
perfdatas =>
|
||||
[
|
||||
{
|
||||
template => '%d',
|
||||
min => 0,
|
||||
max => 'total',
|
||||
unit => 'B',
|
||||
cast_int => 1,
|
||||
label_extra_instance => 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{ label => 'space-usage-prct', display_ok => 0, nlabel => 'array.space.usage.percentage', set => {
|
||||
key_values => [ { name => 'prct_used' }, { name => 'used' }, { name => 'free' }, { name => 'prct_free' }, { name => 'total' } ],
|
||||
closure_custom_output => $self->can('custom_usage_output'),
|
||||
perfdatas => [
|
||||
key_values =>
|
||||
[ { name => 'prct_used' },
|
||||
{ name => 'used' },
|
||||
{ name => 'free' },
|
||||
{ name => 'prct_free' },
|
||||
{ name => 'total' } ],
|
||||
closure_custom_output => $self->can('custom_usage_output'),
|
||||
perfdatas =>
|
||||
[
|
||||
{ template => '%.2f', min => 0, max => 100, unit => '%', label_extra_instance => 1 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
$self->{maps_counters}->{reduction} = [
|
||||
{ label => 'data-reduction', nlabel => 'array.data.reduction.count', set => {
|
||||
key_values => [ { name => 'data' } ],
|
||||
output_template => 'data reduction: %.3f',
|
||||
perfdatas => [
|
||||
{ template => '%.3f', min => 0, label_extra_instance => 1 }
|
||||
]
|
||||
}
|
||||
key_values => [ { name => 'data' } ],
|
||||
output_template => 'data reduction: %.3f',
|
||||
perfdatas => [
|
||||
{ template => '%.3f', min => 0, label_extra_instance => 1 }
|
||||
]
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
$self->{maps_counters}->{perf} = [
|
||||
{ label => 'read', nlabel => 'array.io.read.usage.bytespersecond', set => {
|
||||
key_values => [ { name => 'read_bytes' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'read: %s %s/s',
|
||||
output_change_bytes => 1,
|
||||
closure_custom_perfdata => sub {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{output}->perfdata_add(
|
||||
nlabel => $self->{nlabel},
|
||||
unit => 'B/s',
|
||||
instances => [$self->{result_values}->{name}, $self->{result_values}->{resolution}],
|
||||
value => $self->{result_values}->{read_bytes},
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}),
|
||||
min => 0
|
||||
);
|
||||
}
|
||||
}
|
||||
# read performance counters
|
||||
{ label => 'read-bytes', nlabel => 'array.io.read.usage.bytespersecond', set => {
|
||||
key_values => [ { name => 'read_bytes' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'read bytes: %s %s/s',
|
||||
output_change_bytes => 1,
|
||||
closure_custom_perfdata => $self->can('custom_bytes_per_second_perfdata')
|
||||
}
|
||||
},
|
||||
{ label => 'write', nlabel => 'array.io.write.usage.bytespersecond', set => {
|
||||
key_values => [ { name => 'write_bytes' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'write: %s %s/s',
|
||||
output_change_bytes => 1,
|
||||
closure_custom_perfdata => sub {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
$self->{output}->perfdata_add(
|
||||
nlabel => $self->{nlabel},
|
||||
unit => 'B/s',
|
||||
instances => [$self->{result_values}->{name}, $self->{result_values}->{resolution}],
|
||||
value => $self->{result_values}->{write_bytes},
|
||||
warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}),
|
||||
critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}),
|
||||
min => 0
|
||||
);
|
||||
}
|
||||
}
|
||||
{ label => 'bytes-per-read', nlabel => 'array.io.read.usage.bytesperread', set => {
|
||||
key_values => [ { name => 'bytes_per_read' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'bytes read: %s %s',
|
||||
output_change_bytes => 1,
|
||||
closure_custom_perfdata => $self->can('custom_packet_perfdata')
|
||||
}
|
||||
},
|
||||
{ label => 'reads-per-sec', nlabel => 'array.io.read.usage.readspersec', set => {
|
||||
key_values => [ { name => 'reads_per_sec' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'read: %s/s',
|
||||
closure_custom_perfdata => $self->can('custom_packet_per_seconds')
|
||||
}
|
||||
},
|
||||
{ label => 'service-usec-per-read-operation', nlabel => 'array.io.read.usage.serviceusecperreadop', set => {
|
||||
key_values =>
|
||||
[ { name => 'service_usec_per_read_op' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'service usec read operation: %s µs',
|
||||
closure_custom_perfdata => $self->can('custom_packet_perfdata')
|
||||
}
|
||||
},
|
||||
{ label => 'usec-per-read-operation', nlabel => 'array.io.read.usage.usecperreadop', set => {
|
||||
key_values => [ { name => 'usec_per_read_op' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'usec per read operation: %s µs',
|
||||
closure_custom_perfdata => $self->can('custom_packet_perfdata')
|
||||
}
|
||||
},
|
||||
{ label => 'queue-usec-per-read-operation', nlabel => 'array.io.read.usage.queueusecperreadop', set => {
|
||||
key_values =>
|
||||
[ { name => 'queue_usec_per_read_op' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'queue usec per read operation: %s µs',
|
||||
closure_custom_perfdata => $self->can('custom_packet_perfdata')
|
||||
}
|
||||
},
|
||||
# write performance counters
|
||||
{ label => 'write-bytes', nlabel => 'array.io.write.usage.bytespersecond', set => {
|
||||
key_values => [ { name => 'write_bytes' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'write bytes: %s %s/s',
|
||||
output_change_bytes => 1,
|
||||
closure_custom_perfdata => $self->can('custom_bytes_per_second_perfdata')
|
||||
}
|
||||
},
|
||||
{ label => 'bytes-per-write', nlabel => 'array.io.write.usage.bytesperwrite', set => {
|
||||
key_values => [ { name => 'bytes_per_write' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'bytes write: %s %s',
|
||||
output_change_bytes => 1,
|
||||
closure_custom_perfdata => $self->can('custom_packet_perfdata')
|
||||
}
|
||||
},
|
||||
{ label => 'writes-per-sec', nlabel => 'array.io.write.usage.writespersec', set => {
|
||||
key_values => [ { name => 'writes_per_sec' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'write: %s/s',
|
||||
closure_custom_perfdata => $self->can('custom_packet_per_seconds')
|
||||
}
|
||||
},
|
||||
{ label => 'service-usec-per-write-operation', nlabel => 'array.io.write.usage.serviceusecwriteop', set => {
|
||||
key_values =>
|
||||
[ { name => 'service_usec_per_write_op' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'service usec read operation: %s µs',
|
||||
closure_custom_perfdata => $self->can('custom_packet_perfdata')
|
||||
}
|
||||
},
|
||||
{ label => 'usec-per-write-operation', nlabel => 'array.io.write.usage.usecperwriteop', set => {
|
||||
key_values =>
|
||||
[ { name => 'usec_per_write_op' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'usec per write operation: %s µs',
|
||||
closure_custom_perfdata => $self->can('custom_packet_perfdata')
|
||||
}
|
||||
},
|
||||
{ label => 'queue-usec-per-write-operation', nlabel => 'array.io.write.usage.queueusecperwriteop', set => {
|
||||
key_values =>
|
||||
[ { name => 'queue_usec_per_write_op' }, { name => 'name' }, { name => 'resolution' } ],
|
||||
output_template => 'queue usec per write operation: %s µs',
|
||||
closure_custom_perfdata => $self->can('custom_packet_perfdata')
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
@ -150,20 +273,18 @@ sub new {
|
||||
my ($class, %options) = @_;
|
||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
|
||||
bless $self, $class;
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
|
||||
$options{options}->add_options(arguments => {
|
||||
'filter-id:s' => { name => 'filter_id' },
|
||||
'filter-name:s' => { name => 'filter_name' },
|
||||
'perf-resolution:s' => { name => 'perf_resolution' }
|
||||
'perf-resolution:s' => { name => 'perf_resolution' }
|
||||
});
|
||||
|
||||
|
||||
return $self;
|
||||
}
|
||||
|
||||
my $map_resolution = {
|
||||
'1s' => 1000, '30s' => 30000, '5m' => 300000,
|
||||
'30m' => 1800000, '2h' => 7200000, '8h' => 28800000,
|
||||
'24h' => 86400000
|
||||
'1s' => 1000, '30s' => 30000, '5m' => 300000, '30m' => 1800000, '2h' => 7200000, '8h' => 28800000, '24h' => 86400000
|
||||
};
|
||||
|
||||
sub check_options {
|
||||
@ -174,7 +295,8 @@ sub check_options {
|
||||
if (!defined($self->{option_results}->{perf_resolution}) || $self->{option_results}->{perf_resolution} eq '');
|
||||
|
||||
if (!defined($map_resolution->{ $self->{option_results}->{perf_resolution} })) {
|
||||
$self->{output}->add_option_msg(short_msg => 'Unsupported --perf-resolution value. Can be: 1s, 30s, 5m, 30m, 2h, 8h, 24h');
|
||||
$self->{output}->add_option_msg(short_msg =>
|
||||
'Unsupported --perf-resolution value. Can be: 1s, 30s, 5m, 30m, 2h, 8h, 24h');
|
||||
$self->{output}->option_exit();
|
||||
}
|
||||
}
|
||||
@ -183,7 +305,9 @@ sub manage_selection {
|
||||
my ($self, %options) = @_;
|
||||
|
||||
my $items = $options{custom}->request(endpoint => '/arrays/space');
|
||||
my $perfs = $options{custom}->request(endpoint => '/arrays/performance', get_param => ['resolution=' . $map_resolution->{ $self->{option_results}->{perf_resolution} }]);
|
||||
my $perfs = $options{custom}->request(endpoint => '/arrays/performance',
|
||||
get_param =>
|
||||
[ 'resolution=' . $map_resolution->{ $self->{option_results}->{perf_resolution} } ]);
|
||||
|
||||
#{
|
||||
# "capacity": 29159353378407,
|
||||
@ -213,28 +337,40 @@ sub manage_selection {
|
||||
$item->{name} !~ /$self->{option_results}->{filter_name}/);
|
||||
|
||||
$self->{arrays}->{ $item->{name} } = {
|
||||
name => $item->{name},
|
||||
name => $item->{name},
|
||||
reduction => {
|
||||
data => $item->{space}->{data_reduction}
|
||||
},
|
||||
space => {
|
||||
total => $item->{capacity},
|
||||
used => $item->{space}->{total_physical},
|
||||
free => $item->{capacity} - $item->{space}->{total_physical},
|
||||
space => {
|
||||
total => $item->{capacity},
|
||||
used => $item->{space}->{total_physical},
|
||||
free => $item->{capacity} - $item->{space}->{total_physical},
|
||||
prct_used => $item->{space}->{total_physical} * 100 / $item->{capacity},
|
||||
prct_free => (100 - ($item->{space}->{total_physical} * 100 / $item->{capacity}))
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
foreach my $perf (@$perfs) {
|
||||
next if (!defined($self->{arrays}->{ $perf->{name} }));
|
||||
|
||||
$self->{arrays}->{ $perf->{name} }->{perf} = {
|
||||
name => $perf->{name},
|
||||
resolution => $self->{option_results}->{perf_resolution},
|
||||
read_bytes => $perf->{read_bytes_per_sec},
|
||||
write_bytes => $perf->{write_bytes_per_sec}
|
||||
name => $perf->{name},
|
||||
resolution => $self->{option_results}->{perf_resolution},
|
||||
# read performance counters
|
||||
read_bytes => $perf->{read_bytes_per_sec},
|
||||
bytes_per_read => $perf->{bytes_per_read},
|
||||
reads_per_sec => $perf->{reads_per_sec},
|
||||
service_usec_per_read_op => $perf->{service_usec_per_read_op},
|
||||
usec_per_read_op => $perf->{usec_per_read_op},
|
||||
queue_usec_per_read_op => $perf->{queue_usec_per_read_op},
|
||||
# write performance counters
|
||||
write_bytes => $perf->{write_bytes_per_sec},
|
||||
bytes_per_write => $perf->{bytes_per_write},
|
||||
writes_per_sec => $perf->{writes_per_sec},
|
||||
service_usec_per_write_op => $perf->{service_usec_per_write_op},
|
||||
usec_per_write_op => $perf->{usec_per_write_op},
|
||||
queue_usec_per_write_op => $perf->{queue_usec_per_write_op},
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -271,7 +407,10 @@ Can be: C<1s>, C<30s>, C<5m>, C<30m>, C<2h>, C<8h>, C<24h> (default: C<5m>).
|
||||
|
||||
Thresholds.
|
||||
Can be: 'space-usage' (B), 'space-usage-free' (B), 'space-usage-prct' (%),
|
||||
'data-reduction', 'read', 'write'.
|
||||
'data-reduction', 'read-bytes' (B/s), 'bytes-per-read' (B), 'reads-per-sec', 'service-usec-per-read-operation' (µs),
|
||||
'usec-per-read-operation' (µs), 'queue-usec-per-read-operation' (µs)
|
||||
'write-bytes' (B/s), 'bytes-per-write' (B), 'writes-per-sec', 'service-usec-per-write-operation' (µs),
|
||||
'usec-per-write-operation' (µs), 'queue-usec-per-write-operation' (µs).
|
||||
|
||||
=back
|
||||
|
||||
|
@ -280,7 +280,9 @@ UninterrupibleSleep
|
||||
uniq
|
||||
uptime
|
||||
--urlpath
|
||||
µs
|
||||
usage-prct
|
||||
usec
|
||||
userpass
|
||||
--use-ucd
|
||||
v1
|
||||
|
@ -0,0 +1,213 @@
|
||||
{
|
||||
"uuid": "c9b3b02f-191c-4d8a-b857-a8348adb19ce",
|
||||
"lastMigration": 32,
|
||||
"name": "Mockoonarray",
|
||||
"endpointPrefix": "",
|
||||
"latency": 0,
|
||||
"port": 3001,
|
||||
"hostname": "",
|
||||
"folders": [],
|
||||
"routes": [
|
||||
{
|
||||
"uuid": "a0d08805-6167-49f6-9243-38f13da8eefc",
|
||||
"type": "http",
|
||||
"documentation": "",
|
||||
"method": "post",
|
||||
"endpoint": "api/2.5/login",
|
||||
"responses": [
|
||||
{
|
||||
"uuid": "31fd12ed-865b-469b-9047-96ed7f0b0cc6",
|
||||
"body": "{}",
|
||||
"latency": 0,
|
||||
"statusCode": 200,
|
||||
"label": "",
|
||||
"headers": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "x-auth-token",
|
||||
"value": "token"
|
||||
}
|
||||
],
|
||||
"bodyType": "INLINE",
|
||||
"filePath": "",
|
||||
"databucketID": "",
|
||||
"sendFileAsBody": false,
|
||||
"rules": [],
|
||||
"rulesOperator": "OR",
|
||||
"disableTemplating": false,
|
||||
"fallbackTo404": false,
|
||||
"default": true,
|
||||
"crudKey": "id",
|
||||
"callbacks": []
|
||||
}
|
||||
],
|
||||
"responseMode": null
|
||||
},
|
||||
{
|
||||
"uuid": "691523da-693b-4c88-8835-8a46815f7c07",
|
||||
"type": "http",
|
||||
"documentation": "",
|
||||
"method": "get",
|
||||
"endpoint": "api/2.5/arrays/space",
|
||||
"responses": [
|
||||
{
|
||||
"uuid": "c91a64e2-6228-4554-b6d2-3101fc98aa11",
|
||||
"body": "{\r\n \"more_items_remaining\": false,\r\n \"total_item_count\": 0,\r\n \"continuation_token\": \"string\",\r\n \"errors\": [\r\n {\r\n \"context\": \"<object_name>\",\r\n \"message\": \"Object does not exist.\",\r\n \"location_context\": {\r\n \"id\": \"string\",\r\n \"name\": \"string\",\r\n \"resource_type\": \"string\"\r\n }\r\n }\r\n ],\r\n \"items\": [\r\n {\r\n \"id\": \"string\",\r\n \"name\": \"array-1\",\r\n \"capacity\": 10995116277760,\r\n \"parity\": 0.99,\r\n \"space\": {\r\n \"data_reduction\": 0,\r\n \"shared\": 111863360624,\r\n \"snapshots\": 0,\r\n \"system\": 0,\r\n \"thin_provisioning\": 0,\r\n \"total_physical\": 0,\r\n \"total_provisioned\": 19937690345472,\r\n \"total_reduction\": 0,\r\n \"unique\": 0,\r\n \"virtual\": 0,\r\n \"used_provisioned\": 19937690345472,\r\n \"total_used\": 0,\r\n \"shared_effective\": 0,\r\n \"snapshots_effective\": 0,\r\n \"unique_effective\": 0,\r\n \"total_effective\": 0,\r\n \"replication\": 0,\r\n \"footprint\": 0\r\n },\r\n \"time\": 0,\r\n \"context\": {\r\n \"id\": \"string\",\r\n \"name\": \"string\"\r\n }\r\n }\r\n ]\r\n}",
|
||||
"latency": 0,
|
||||
"statusCode": 200,
|
||||
"label": "",
|
||||
"headers": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "Api-token",
|
||||
"value": "token"
|
||||
}
|
||||
],
|
||||
"bodyType": "INLINE",
|
||||
"filePath": "",
|
||||
"databucketID": "",
|
||||
"sendFileAsBody": false,
|
||||
"rules": [
|
||||
{
|
||||
"target": "query",
|
||||
"modifier": "",
|
||||
"value": "300000",
|
||||
"invert": false,
|
||||
"operator": "equals"
|
||||
}
|
||||
],
|
||||
"rulesOperator": "OR",
|
||||
"disableTemplating": false,
|
||||
"fallbackTo404": false,
|
||||
"default": true,
|
||||
"crudKey": "id",
|
||||
"callbacks": []
|
||||
}
|
||||
],
|
||||
"responseMode": null
|
||||
},
|
||||
{
|
||||
"uuid": "08407b06-7357-4373-a47f-4384b0ae794c",
|
||||
"type": "http",
|
||||
"documentation": "",
|
||||
"method": "get",
|
||||
"endpoint": "api/2.5/arrays/performance",
|
||||
"responses": [
|
||||
{
|
||||
"uuid": "5d21658f-d789-48a5-8616-ea9dbf784443",
|
||||
"body": "{\r\n \"continuation_token\":null,\r\n \"items\":[\r\n {\r\n \"san_usec_per_mirrored_write_op\":0,\r\n \"queue_usec_per_mirrored_write_op\":0,\r\n \"qos_rate_limit_usec_per_mirrored_write_op\":0,\r\n \"service_usec_per_mirrored_write_op\":0,\r\n \"bytes_per_mirrored_write\":0,\r\n \"mirrored_write_bytes_per_sec\":0,\r\n \"mirrored_writes_per_sec\":0,\r\n \"usec_per_mirrored_write_op\":0,\r\n \"time\":1728906220000,\r\n \"name\":\"array-1\",\r\n \"id\":\"ad78f444-4841-4814-3a35-4c3a650dba10\",\r\n \"bytes_per_read\":0,\r\n \"bytes_per_write\":0,\r\n \"bytes_per_op\":0,\r\n \"service_usec_per_read_op_cache_reduction\":null,\r\n \"read_bytes_per_sec\":96748,\r\n \"write_bytes_per_sec\":45754,\r\n \"usec_per_read_op\":171,\r\n \"usec_per_write_op\":190,\r\n \"reads_per_sec\":6,\r\n \"writes_per_sec\":2,\r\n \"queue_usec_per_read_op\":2,\r\n \"queue_usec_per_write_op\":2,\r\n \"qos_rate_limit_usec_per_read_op\":0,\r\n \"qos_rate_limit_usec_per_write_op\":0,\r\n \"san_usec_per_read_op\":30,\r\n \"san_usec_per_write_op\":51,\r\n \"service_usec_per_read_op\":169,\r\n \"service_usec_per_write_op\":188\r\n }\r\n ],\r\n \"more_items_remaining\":null,\r\n \"total\":[\r\n ],\r\n \"total_item_count\":null\r\n}",
|
||||
"latency": 0,
|
||||
"statusCode": 200,
|
||||
"label": "",
|
||||
"headers": [
|
||||
{
|
||||
"key": "Accept",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "Api-token",
|
||||
"value": "token"
|
||||
}
|
||||
],
|
||||
"bodyType": "INLINE",
|
||||
"filePath": "",
|
||||
"databucketID": "",
|
||||
"sendFileAsBody": false,
|
||||
"rules": [
|
||||
{
|
||||
"target": "query",
|
||||
"modifier": "",
|
||||
"value": "300000",
|
||||
"invert": false,
|
||||
"operator": "equals"
|
||||
}
|
||||
],
|
||||
"rulesOperator": "OR",
|
||||
"disableTemplating": false,
|
||||
"fallbackTo404": false,
|
||||
"default": true,
|
||||
"crudKey": "id",
|
||||
"callbacks": []
|
||||
}
|
||||
],
|
||||
"responseMode": null
|
||||
}
|
||||
],
|
||||
"rootChildren": [
|
||||
{
|
||||
"type": "route",
|
||||
"uuid": "a0d08805-6167-49f6-9243-38f13da8eefc"
|
||||
},
|
||||
{
|
||||
"type": "route",
|
||||
"uuid": "691523da-693b-4c88-8835-8a46815f7c07"
|
||||
},
|
||||
{
|
||||
"type": "route",
|
||||
"uuid": "08407b06-7357-4373-a47f-4384b0ae794c"
|
||||
}
|
||||
],
|
||||
"proxyMode": false,
|
||||
"proxyHost": "",
|
||||
"proxyRemovePrefix": false,
|
||||
"tlsOptions": {
|
||||
"enabled": false,
|
||||
"type": "CERT",
|
||||
"pfxPath": "",
|
||||
"certPath": "",
|
||||
"keyPath": "",
|
||||
"caPath": "",
|
||||
"passphrase": ""
|
||||
},
|
||||
"cors": true,
|
||||
"headers": [
|
||||
{
|
||||
"key": "Content-Type",
|
||||
"value": "application/json"
|
||||
},
|
||||
{
|
||||
"key": "Access-Control-Allow-Origin",
|
||||
"value": "*"
|
||||
},
|
||||
{
|
||||
"key": "Access-Control-Allow-Methods",
|
||||
"value": "GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS"
|
||||
},
|
||||
{
|
||||
"key": "Access-Control-Allow-Headers",
|
||||
"value": "Content-Type, Origin, Accept, Authorization, Content-Length, X-Requested-With"
|
||||
}
|
||||
],
|
||||
"proxyReqHeaders": [
|
||||
{
|
||||
"key": "",
|
||||
"value": ""
|
||||
}
|
||||
],
|
||||
"proxyResHeaders": [
|
||||
{
|
||||
"key": "",
|
||||
"value": ""
|
||||
}
|
||||
],
|
||||
"data": [],
|
||||
"callbacks": []
|
||||
}
|
39
tests/storage/purestorage/flasharray/v2/restapi/array.robot
Normal file
39
tests/storage/purestorage/flasharray/v2/restapi/array.robot
Normal file
@ -0,0 +1,39 @@
|
||||
*** Settings ***
|
||||
|
||||
Resource ${CURDIR}${/}..${/}..${/}..${/}..${/}..${/}resources/import.resource
|
||||
|
||||
Suite Setup Start Mockoon ${MOCKOON_JSON}
|
||||
Suite Teardown Stop Mockoon
|
||||
Test Timeout 120s
|
||||
|
||||
** Variables ***
|
||||
${MOCKOON_JSON} ${CURDIR}${/}Mockoonarray.json
|
||||
|
||||
|
||||
${CMD} ${CENTREON_PLUGINS}
|
||||
... --plugin=storage::purestorage::flasharray::v2::restapi::plugin
|
||||
... --mode=arrays
|
||||
... --hostname=${HOSTNAME}
|
||||
... --proto='http'
|
||||
... --api-token='token'
|
||||
... --api-version='2.5'
|
||||
... --port=${APIPORT}
|
||||
|
||||
*** Test Cases ***
|
||||
arrays ${tc}
|
||||
[Tags] storage purestorage flasharray restapi
|
||||
${command} Catenate
|
||||
... ${CMD}
|
||||
... ${extra_options}
|
||||
Ctn Run Command And Check Result As Strings ${command} ${expected_result}
|
||||
|
||||
Examples: tc extra_options expected_result --
|
||||
... 1 ${EMPTY} OK: Array 'array-1' space usage total: 10.00 TB used: 0.00 B (0.00%) free: 10.00 TB (100.00%) - data reduction: 0.000 - read bytes: 94.48 KB/s, bytes read: 0.00 B, read: 6/s, service usec read operation: 169 µs, usec per read operation: 171 µs, queue usec per read operation: 2 µs, write bytes: 44.68 KB/s, bytes write: 0.00 B, write: 2/s, service usec read operation: 188 µs, usec per write operation: 190 µs, queue usec per write operation: 2 µs | 'array-1#array.space.usage.bytes'=0B;;;0;10995116277760 'array-1#array.space.free.bytes'=10995116277760B;;;0;10995116277760 'array-1#array.space.usage.percentage'=0.00%;;;0;100 'array-1#array.data.reduction.count'=0.000;;;0; 'array-1~5m#array.io.read.usage.bytespersecond'=96748B/s;;;0; 'array-1~5m#array.io.read.usage.bytesperread'=0B;;;0; 'array-1~5m#array.io.read.usage.readspersec'=6/s;;;0; 'array-1~5m#array.io.read.usage.serviceusecperreadop'=169B;;;0; 'array-1~5m#array.io.read.usage.usecperreadop'=171B;;;0; 'array-1~5m#array.io.read.usage.queueusecperreadop'=2B;;;0; 'array-1~5m#array.io.write.usage.bytespersecond'=45754B/s;;;0; 'array-1~5m#array.io.write.usage.bytesperwrite'=0B;;;0; 'array-1~5m#array.io.write.usage.writespersec'=2/s;;;0; 'array-1~5m#array.io.write.usage.serviceusecwriteop'=188B;;;0; 'array-1~5m#array.io.write.usage.usecperwriteop'=190B;;;0; 'array-1~5m#array.io.write.usage.queueusecperwriteop'=2B;;;0;
|
||||
... 2 --filter-counters='data-reduction' OK: Array 'array-1' data reduction: 0.000 | 'array-1#array.data.reduction.count'=0.000;;;0;
|
||||
... 3 --perf-resolution='5m' OK: Array 'array-1' space usage total: 10.00 TB used: 0.00 B (0.00%) free: 10.00 TB (100.00%) - data reduction: 0.000 - read bytes: 94.48 KB/s, bytes read: 0.00 B, read: 6/s, service usec read operation: 169 µs, usec per read operation: 171 µs, queue usec per read operation: 2 µs, write bytes: 44.68 KB/s, bytes write: 0.00 B, write: 2/s, service usec read operation: 188 µs, usec per write operation: 190 µs, queue usec per write operation: 2 µs | 'array-1#array.space.usage.bytes'=0B;;;0;10995116277760 'array-1#array.space.free.bytes'=10995116277760B;;;0;10995116277760 'array-1#array.space.usage.percentage'=0.00%;;;0;100 'array-1#array.data.reduction.count'=0.000;;;0; 'array-1~5m#array.io.read.usage.bytespersecond'=96748B/s;;;0; 'array-1~5m#array.io.read.usage.bytesperread'=0B;;;0; 'array-1~5m#array.io.read.usage.readspersec'=6/s;;;0; 'array-1~5m#array.io.read.usage.serviceusecperreadop'=169B;;;0; 'array-1~5m#array.io.read.usage.usecperreadop'=171B;;;0; 'array-1~5m#array.io.read.usage.queueusecperreadop'=2B;;;0; 'array-1~5m#array.io.write.usage.bytespersecond'=45754B/s;;;0; 'array-1~5m#array.io.write.usage.bytesperwrite'=0B;;;0; 'array-1~5m#array.io.write.usage.writespersec'=2/s;;;0; 'array-1~5m#array.io.write.usage.serviceusecwriteop'=188B;;;0; 'array-1~5m#array.io.write.usage.usecperwriteop'=190B;;;0; 'array-1~5m#array.io.write.usage.queueusecperwriteop'=2B;;;0;
|
||||
... 4 --warning-data-reduction=10 --critical-data-reduction='' OK: Array 'array-1' space usage total: 10.00 TB used: 0.00 B (0.00%) free: 10.00 TB (100.00%) - data reduction: 0.000 - read bytes: 94.48 KB/s, bytes read: 0.00 B, read: 6/s, service usec read operation: 169 µs, usec per read operation: 171 µs, queue usec per read operation: 2 µs, write bytes: 44.68 KB/s, bytes write: 0.00 B, write: 2/s, service usec read operation: 188 µs, usec per write operation: 190 µs, queue usec per write operation: 2 µs | 'array-1#array.space.usage.bytes'=0B;;;0;10995116277760 'array-1#array.space.free.bytes'=10995116277760B;;;0;10995116277760 'array-1#array.space.usage.percentage'=0.00%;;;0;100 'array-1#array.data.reduction.count'=0.000;0:10;;0; 'array-1~5m#array.io.read.usage.bytespersecond'=96748B/s;;;0; 'array-1~5m#array.io.read.usage.bytesperread'=0B;;;0; 'array-1~5m#array.io.read.usage.readspersec'=6/s;;;0; 'array-1~5m#array.io.read.usage.serviceusecperreadop'=169B;;;0; 'array-1~5m#array.io.read.usage.usecperreadop'=171B;;;0; 'array-1~5m#array.io.read.usage.queueusecperreadop'=2B;;;0; 'array-1~5m#array.io.write.usage.bytespersecond'=45754B/s;;;0; 'array-1~5m#array.io.write.usage.bytesperwrite'=0B;;;0; 'array-1~5m#array.io.write.usage.writespersec'=2/s;;;0; 'array-1~5m#array.io.write.usage.serviceusecwriteop'=188B;;;0; 'array-1~5m#array.io.write.usage.usecperwriteop'=190B;;;0; 'array-1~5m#array.io.write.usage.queueusecperwriteop'=2B;;;0;
|
||||
... 5 --warning-space-usage=3 --critical-space-usage=10 OK: Array 'array-1' space usage total: 10.00 TB used: 0.00 B (0.00%) free: 10.00 TB (100.00%) - data reduction: 0.000 - read bytes: 94.48 KB/s, bytes read: 0.00 B, read: 6/s, service usec read operation: 169 µs, usec per read operation: 171 µs, queue usec per read operation: 2 µs, write bytes: 44.68 KB/s, bytes write: 0.00 B, write: 2/s, service usec read operation: 188 µs, usec per write operation: 190 µs, queue usec per write operation: 2 µs | 'array-1#array.space.usage.bytes'=0B;0:3;0:10;0;10995116277760 'array-1#array.space.free.bytes'=10995116277760B;;;0;10995116277760 'array-1#array.space.usage.percentage'=0.00%;;;0;100 'array-1#array.data.reduction.count'=0.000;;;0; 'array-1~5m#array.io.read.usage.bytespersecond'=96748B/s;;;0; 'array-1~5m#array.io.read.usage.bytesperread'=0B;;;0; 'array-1~5m#array.io.read.usage.readspersec'=6/s;;;0; 'array-1~5m#array.io.read.usage.serviceusecperreadop'=169B;;;0; 'array-1~5m#array.io.read.usage.usecperreadop'=171B;;;0; 'array-1~5m#array.io.read.usage.queueusecperreadop'=2B;;;0; 'array-1~5m#array.io.write.usage.bytespersecond'=45754B/s;;;0; 'array-1~5m#array.io.write.usage.bytesperwrite'=0B;;;0; 'array-1~5m#array.io.write.usage.writespersec'=2/s;;;0; 'array-1~5m#array.io.write.usage.serviceusecwriteop'=188B;;;0; 'array-1~5m#array.io.write.usage.usecperwriteop'=190B;;;0; 'array-1~5m#array.io.write.usage.queueusecperwriteop'=2B;;;0;
|
||||
... 6 --warning-space-usage-free=3 --critical-space-usage-free=0 CRITICAL: Array 'array-1' space usage total: 10.00 TB used: 0.00 B (0.00%) free: 10.00 TB (100.00%) | 'array-1#array.space.usage.bytes'=0B;;;0;10995116277760 'array-1#array.space.free.bytes'=10995116277760B;0:3;0:0;0;10995116277760 'array-1#array.space.usage.percentage'=0.00%;;;0;100 'array-1#array.data.reduction.count'=0.000;;;0; 'array-1~5m#array.io.read.usage.bytespersecond'=96748B/s;;;0; 'array-1~5m#array.io.read.usage.bytesperread'=0B;;;0; 'array-1~5m#array.io.read.usage.readspersec'=6/s;;;0; 'array-1~5m#array.io.read.usage.serviceusecperreadop'=169B;;;0; 'array-1~5m#array.io.read.usage.usecperreadop'=171B;;;0; 'array-1~5m#array.io.read.usage.queueusecperreadop'=2B;;;0; 'array-1~5m#array.io.write.usage.bytespersecond'=45754B/s;;;0; 'array-1~5m#array.io.write.usage.bytesperwrite'=0B;;;0; 'array-1~5m#array.io.write.usage.writespersec'=2/s;;;0; 'array-1~5m#array.io.write.usage.serviceusecwriteop'=188B;;;0; 'array-1~5m#array.io.write.usage.usecperwriteop'=190B;;;0; 'array-1~5m#array.io.write.usage.queueusecperwriteop'=2B;;;0;
|
||||
... 7 --warning-queue-usec-per-write-operation=0 --critical-queue-usec-per-write-operation=200 WARNING: Array 'array-1' queue usec per write operation: 2 µs | 'array-1#array.space.usage.bytes'=0B;;;0;10995116277760 'array-1#array.space.free.bytes'=10995116277760B;;;0;10995116277760 'array-1#array.space.usage.percentage'=0.00%;;;0;100 'array-1#array.data.reduction.count'=0.000;;;0; 'array-1~5m#array.io.read.usage.bytespersecond'=96748B/s;;;0; 'array-1~5m#array.io.read.usage.bytesperread'=0B;;;0; 'array-1~5m#array.io.read.usage.readspersec'=6/s;;;0; 'array-1~5m#array.io.read.usage.serviceusecperreadop'=169B;;;0; 'array-1~5m#array.io.read.usage.usecperreadop'=171B;;;0; 'array-1~5m#array.io.read.usage.queueusecperreadop'=2B;;;0; 'array-1~5m#array.io.write.usage.bytespersecond'=45754B/s;;;0; 'array-1~5m#array.io.write.usage.bytesperwrite'=0B;;;0; 'array-1~5m#array.io.write.usage.writespersec'=2/s;;;0; 'array-1~5m#array.io.write.usage.serviceusecwriteop'=188B;;;0; 'array-1~5m#array.io.write.usage.usecperwriteop'=190B;;;0; 'array-1~5m#array.io.write.usage.queueusecperwriteop'=2B;0:0;0:200;0;
|
||||
... 8 --warning-queue-usec-per-read-operation=0 --critical-queue-usec-per-read-operation='' WARNING: Array 'array-1' queue usec per read operation: 2 µs | 'array-1#array.space.usage.bytes'=0B;;;0;10995116277760 'array-1#array.space.free.bytes'=10995116277760B;;;0;10995116277760 'array-1#array.space.usage.percentage'=0.00%;;;0;100 'array-1#array.data.reduction.count'=0.000;;;0; 'array-1~5m#array.io.read.usage.bytespersecond'=96748B/s;;;0; 'array-1~5m#array.io.read.usage.bytesperread'=0B;;;0; 'array-1~5m#array.io.read.usage.readspersec'=6/s;;;0; 'array-1~5m#array.io.read.usage.serviceusecperreadop'=169B;;;0; 'array-1~5m#array.io.read.usage.usecperreadop'=171B;;;0; 'array-1~5m#array.io.read.usage.queueusecperreadop'=2B;0:0;;0; 'array-1~5m#array.io.write.usage.bytespersecond'=45754B/s;;;0; 'array-1~5m#array.io.write.usage.bytesperwrite'=0B;;;0; 'array-1~5m#array.io.write.usage.writespersec'=2/s;;;0; 'array-1~5m#array.io.write.usage.serviceusecwriteop'=188B;;;0; 'array-1~5m#array.io.write.usage.usecperwriteop'=190B;;;0; 'array-1~5m#array.io.write.usage.queueusecperwriteop'=2B;;;0;
|
||||
... 9 --warning-writes-per-sec=1 --critical-writes-per-sec=0 CRITICAL: Array 'array-1' write: 2/s | 'array-1#array.space.usage.bytes'=0B;;;0;10995116277760 'array-1#array.space.free.bytes'=10995116277760B;;;0;10995116277760 'array-1#array.space.usage.percentage'=0.00%;;;0;100 'array-1#array.data.reduction.count'=0.000;;;0; 'array-1~5m#array.io.read.usage.bytespersecond'=96748B/s;;;0; 'array-1~5m#array.io.read.usage.bytesperread'=0B;;;0; 'array-1~5m#array.io.read.usage.readspersec'=6/s;;;0; 'array-1~5m#array.io.read.usage.serviceusecperreadop'=169B;;;0; 'array-1~5m#array.io.read.usage.usecperreadop'=171B;;;0; 'array-1~5m#array.io.read.usage.queueusecperreadop'=2B;;;0; 'array-1~5m#array.io.write.usage.bytespersecond'=45754B/s;;;0; 'array-1~5m#array.io.write.usage.bytesperwrite'=0B;;;0; 'array-1~5m#array.io.write.usage.writespersec'=2/s;0:1;0:0;0; 'array-1~5m#array.io.write.usage.serviceusecwriteop'=188B;;;0; 'array-1~5m#array.io.write.usage.usecperwriteop'=190B;;;0; 'array-1~5m#array.io.write.usage.queueusecperwriteop'=2B;;;0;
|
Loading…
x
Reference in New Issue
Block a user