mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-26 23:24:27 +02:00
feat(cloud-aws) add s3 bucket discovery
This commit is contained in:
parent
54a8a34fdf
commit
d634fe4f3d
@ -44,7 +44,8 @@ sub new {
|
|||||||
VPN => $self->can('discover_vpn'),
|
VPN => $self->can('discover_vpn'),
|
||||||
KINESIS => $self->can('discover_kinesis_stream'),
|
KINESIS => $self->can('discover_kinesis_stream'),
|
||||||
DYNAMODB => $self->can('discover_dynamodb_table'),
|
DYNAMODB => $self->can('discover_dynamodb_table'),
|
||||||
APIGATEWAY => $self->can('discover_api')
|
APIGATEWAY => $self->can('discover_api'),
|
||||||
|
S3 => $self->can('discover_s3_bucket')
|
||||||
};
|
};
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
@ -214,6 +215,25 @@ sub discover_kinesis_stream {
|
|||||||
return @disco_data;
|
return @disco_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub discover_s3_bucket {
|
||||||
|
my (%options) = @_;
|
||||||
|
|
||||||
|
my @disco_data;
|
||||||
|
|
||||||
|
my $buckets = $options{custom}->discovery(region => $options{region},
|
||||||
|
service => 's3api', command => 'list-buckets');
|
||||||
|
|
||||||
|
foreach my $bucket (@{$buckets->{Buckets}}) {
|
||||||
|
my %bucket;
|
||||||
|
$bucket{type} = "s3_bucket";
|
||||||
|
$bucket{name} = $bucket->{Name};
|
||||||
|
$bucket{creation_date} = $bucket->{CreationDate};
|
||||||
|
push @disco_data, \%bucket;
|
||||||
|
}
|
||||||
|
|
||||||
|
return @disco_data;
|
||||||
|
}
|
||||||
|
|
||||||
sub discover_dynamodb_table {
|
sub discover_dynamodb_table {
|
||||||
my (%options) = @_;
|
my (%options) = @_;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user