diff --git a/.github/packaging/centreon-plugin.yaml.template b/.github/packaging/centreon-plugin.yaml.template index 976a58368..11abf0ccf 100644 --- a/.github/packaging/centreon-plugin.yaml.template +++ b/.github/packaging/centreon-plugin.yaml.template @@ -48,6 +48,9 @@ overrides: perl(POSIX), perl(Encode), perl(XML::LibXML), + perl(FindBin), + perl(lib), + perl(sort), @RPM_DEPENDENCIES@ ] conflicts: diff --git a/.github/scripts/test-all-plugins.py b/.github/scripts/test-all-plugins.py index b188923c3..f19eaa725 100644 --- a/.github/scripts/test-all-plugins.py +++ b/.github/scripts/test-all-plugins.py @@ -102,7 +102,7 @@ def remove_plugin(plugin, archi): print(f"Unknown architecture, expected deb or rpm, got {archi}. Exiting.") exit(1) # Remove cache files - tmp_files = glob.glob('/tmp/cache/*') + tmp_files = glob.glob('/dev/shm/*') for file in tmp_files: try: os.remove(file) @@ -122,9 +122,6 @@ if __name__ == '__main__': archi = sys.argv.pop(1) # expected either deb or rpm. script_name = sys.argv.pop(0) - # Create a directory for cache files - os.mkdir("/tmp/cache") - error_install = 0 error_tests = 0 error_purge = 0 diff --git a/packaging/centreon-plugin-Cloud-Aws-Apigateway-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Apigateway-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Apigateway-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Apigateway-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Apigateway-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Apigateway-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Apigateway-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Apigateway-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Backup-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Backup-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Backup-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Backup-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Backup-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Backup-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Backup-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Backup-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Billing-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Billing-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Billing-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Billing-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Billing-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Billing-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Billing-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Billing-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudfront-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Cloudfront-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Cloudfront-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudfront-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudfront-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Cloudfront-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Cloudfront-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudfront-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/deb.json index bc17ef2ad..ca10556df 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/rpm.json index bc30a2c0d..10fe65318 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudtrail-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudwatch-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Cloudwatch-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Cloudwatch-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudwatch-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudwatch-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Cloudwatch-Api/rpm.json index 5c2153a42..198e3f0b0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Cloudwatch-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudwatch-Api/rpm.json @@ -1,6 +1,7 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ], "replaces": ["centreon-plugin-Cloud-Aws-Api"] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api/rpm.json index 5c2153a42..198e3f0b0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Cloudwatchlogs-Api/rpm.json @@ -1,6 +1,7 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ], "replaces": ["centreon-plugin-Cloud-Aws-Api"] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Directconnect-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Directconnect-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Directconnect-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Directconnect-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Directconnect-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Directconnect-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Directconnect-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Directconnect-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Ebs-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Ebs-Api/deb.json index bc17ef2ad..ca10556df 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Ebs-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Ebs-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Ebs-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Ebs-Api/rpm.json index bc30a2c0d..10fe65318 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Ebs-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Ebs-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Ec2-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Ec2-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Ec2-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Ec2-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Ec2-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Ec2-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Ec2-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Ec2-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Efs-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Efs-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Efs-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Efs-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Efs-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Efs-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Efs-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Efs-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Elasticache-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Elasticache-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Elasticache-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Elasticache-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Elasticache-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Elasticache-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Elasticache-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Elasticache-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Elb-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Elb-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Elb-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Elb-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Elb-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Elb-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Elb-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Elb-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Elb-Application-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Elb-Application-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Elb-Application-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Elb-Application-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Elb-Application-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Elb-Application-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Elb-Application-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Elb-Application-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Elb-Network-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Elb-Network-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Elb-Network-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Elb-Network-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Elb-Network-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Elb-Network-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Elb-Network-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Elb-Network-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Fsx-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Fsx-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Fsx-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Fsx-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Fsx-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Fsx-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Fsx-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Fsx-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Health-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Health-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Health-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Health-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Health-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Health-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Health-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Health-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Kinesis-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Kinesis-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Kinesis-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Kinesis-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Kinesis-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Kinesis-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Kinesis-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Kinesis-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Lambda-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Lambda-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Lambda-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Lambda-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Lambda-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Lambda-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Lambda-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Lambda-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Rds-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Rds-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Rds-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Rds-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Rds-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Rds-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Rds-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Rds-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-S3-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-S3-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-S3-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-S3-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-S3-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-S3-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-S3-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-S3-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Ses-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Ses-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Ses-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Ses-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Ses-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Ses-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Ses-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Ses-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Sns-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Sns-Api/deb.json index bc17ef2ad..ca10556df 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Sns-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Sns-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Sns-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Sns-Api/rpm.json index bc30a2c0d..10fe65318 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Sns-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Sns-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Sqs-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Sqs-Api/deb.json index bc17ef2ad..ca10556df 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Sqs-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Sqs-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Sqs-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Sqs-Api/rpm.json index bc30a2c0d..10fe65318 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Sqs-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Sqs-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Transitgateway-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Transitgateway-Api/deb.json index 8133a85e5..6eb65ad6b 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Transitgateway-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Transitgateway-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Transitgateway-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Transitgateway-Api/rpm.json index e9dff7552..89678fed0 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Transitgateway-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Transitgateway-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Vpn-Api/deb.json b/packaging/centreon-plugin-Cloud-Aws-Vpn-Api/deb.json index bc17ef2ad..ca10556df 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Vpn-Api/deb.json +++ b/packaging/centreon-plugin-Cloud-Aws-Vpn-Api/deb.json @@ -1,5 +1,6 @@ { "dependencies": [ - "libdatetime-perl" + "libdatetime-perl", + "libpaws-perl" ] } diff --git a/packaging/centreon-plugin-Cloud-Aws-Vpn-Api/rpm.json b/packaging/centreon-plugin-Cloud-Aws-Vpn-Api/rpm.json index bc30a2c0d..10fe65318 100644 --- a/packaging/centreon-plugin-Cloud-Aws-Vpn-Api/rpm.json +++ b/packaging/centreon-plugin-Cloud-Aws-Vpn-Api/rpm.json @@ -1,5 +1,6 @@ { "dependencies": [ - "perl(DateTime)" + "perl(DateTime)", + "perl(Paws)" ] } diff --git a/tests/cloud/aws/cloudtrail/checktrailstatus.robot b/tests/cloud/aws/cloudtrail/checktrailstatus.robot new file mode 100644 index 000000000..4c785abf2 --- /dev/null +++ b/tests/cloud/aws/cloudtrail/checktrailstatus.robot @@ -0,0 +1,31 @@ +*** Settings *** +Documentation AWS CloudTrail plugin + +Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource + +Suite Setup Start Mockoon ${MOCKOON_JSON} +Suite Teardown Stop Mockoon +Test Timeout 120s + + +*** Variables *** +${MOCKOON_JSON} ${CURDIR}${/}cloud-aws-cloudtrail.json + +${CMD} ${CENTREON_PLUGINS} --plugin=cloud::aws::cloudtrail::plugin --custommode=paws --region=eu-west --aws-secret-key=secret --aws-access-key=key + + +*** Test Cases *** +AWS CloudTrail check trail status + [Documentation] Check AWS CloudTrail trail status + [Tags] cloud aws cloudtrail + + ${command} Catenate + ... ${CMD} + ... --mode=checktrailstatus + ... --endpoint=http://${HOSTNAME}:${APIPORT}/cloudtrail/gettrailstatus/${trailstatus} + ... --trail-name=trailname + Ctn Run Command And Check Result As Strings ${command} ${expected_result} + + Examples: tc trailstatus expected_result -- + ... 1 true OK: Trail is logging: 1 | 'trail_is_logging'=1;;;0; + ... 2 false CRITICAL: Trail is logging: 0 | 'trail_is_logging'=0;;;0; diff --git a/tests/cloud/aws/cloudtrail/cloud-aws-cloudtrail.json b/tests/cloud/aws/cloudtrail/cloud-aws-cloudtrail.json new file mode 100644 index 000000000..fc680bb46 --- /dev/null +++ b/tests/cloud/aws/cloudtrail/cloud-aws-cloudtrail.json @@ -0,0 +1,133 @@ +{ + "uuid": "e59ad81e-2050-480d-bbae-0e71c607c927", + "lastMigration": 32, + "name": "Aws cloudtrail", + "endpointPrefix": "", + "latency": 0, + "port": 3000, + "hostname": "", + "folders": [], + "routes": [ + { + "uuid": "b5e25f3a-a8e3-4128-9e45-f2654c5a599d", + "type": "http", + "documentation": "", + "method": "post", + "endpoint": "cloudtrail/gettrailstatus/:islogging", + "responses": [ + { + "uuid": "76483999-2022-4610-8e8c-9c0bd535e4c5", + "body": "{\r\n \"IsLogging\": {{ urlParam 'islogging' 'true' }},\r\n \"LatestCloudWatchLogsDeliveryError\": \"error\",\r\n \"LatestCloudWatchLogsDeliveryTime\": 1683298944.125,\r\n \"LatestDeliveryAttemptSucceeded\": \"2023-05-05T15:02:24Z\",\r\n \"LatestDeliveryAttemptTime\": \"2023-05-05T15:02:24Z\",\r\n \"LatestDeliveryError\": \"error\",\r\n \"LatestDeliveryTime\": 1683298944.125,\r\n \"LatestDigestDeliveryError\": \"error\",\r\n \"LatestDigestDeliveryTime\": 1683298944.125,\r\n \"LatestNotificationAttemptSucceeded\": \"2023-05-05T15:02:24Z\",\r\n \"LatestNotificationAttemptTime\": \"2023-05-05T15:02:24Z\",\r\n \"LatestNotificationError\": \"error\",\r\n \"LatestNotificationTime\": 1683298944.125,\r\n \"StartLoggingTime\": 1683298944.125,\r\n \"StopLoggingTime\": 1683298477.918,\r\n \"TimeLoggingStarted\": \"2023-05-05T15:02:24Z\",\r\n \"TimeLoggingStopped\": \"2023-05-05T14:54:37Z\"\r\n}", + "latency": 0, + "statusCode": 200, + "label": "", + "headers": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "bodyType": "INLINE", + "filePath": "", + "databucketID": "", + "sendFileAsBody": false, + "rules": [], + "rulesOperator": "OR", + "disableTemplating": false, + "fallbackTo404": false, + "default": true, + "crudKey": "id", + "callbacks": [] + } + ], + "responseMode": null + }, + { + "uuid": "77f82f1c-b06e-478a-8366-ab325830f00e", + "type": "http", + "documentation": "", + "method": "post", + "endpoint": "cloudtrail/events/AwsApiCall/:AwsApiCall/AwsServiceEvent/:AwsServiceEvent/AwsConsoleAction/:AwsConsoleAction/AwsConsoleSignIn/:AwsConsoleSignIn/NextToken/:NextToken", + "responses": [ + { + "uuid": "7dd41177-8d63-458a-abcc-b3af3ea8c9cd", + "body": "{\r\n\t\"Events\": [\r\n\t\t{{#each (dataRaw 'EventsData')}}\r\n\t\t {{#if (gt @index 0)}}\r\n\t\t ,\r\n\t\t {{/if}}\r\n \t\t{\r\n \t\t\t\"AccessKeyId\": \"{{AccessKeyId}}\",\r\n \t\t\t\"CloudTrailEvent\": \"{\\\"awsRegion\\\": \\\"eu-west-1\\\", {{#if Error}}\\\"errorCode\\\": \\\"{{ErrorCode}}\\\", \\\"errorMessage\\\": \\\"{{ErrorMessage}}\\\",{{/if}} \\\"eventCategory\\\": \\\"Management\\\", \\\"eventID\\\": \\\"{{EventId}}\\\", \\\"eventName\\\": \\\"{{EventName}}\\\", \\\"eventSource\\\": \\\"{{EventSource}}\\\", \\\"eventTime\\\": \\\"{{EventTime}}\\\", \\\"eventType\\\": \\\"{{EventType}}\\\", \\\"eventVersion\\\": \\\"1.08\\\", \\\"managementEvent\\\": true, \\\"readOnly\\\": true, \\\"recipientAccountId\\\": \\\"{{AccountId}}\\\", \\\"requestID\\\": \\\"{{ faker 'string.uuid' }}\\\", \\\"requestParameters\\\": null, \\\"responseElements\\\": null, \\\"sourceIPAddress\\\": \\\"{{ faker 'internet.ip' }}\\\", \\\"tlsDetails\\\": {\\\"cipherSuite\\\": \\\"ECDHE-RSA-AES128-GCM-SHA256\\\", \\\"clientProvidedHostHeader\\\": \\\"cloudtrail.eu-west-1.amazonaws.com\\\", \\\"tlsVersion\\\": \\\"TLSv1.2\\\"}, \\\"userAgent\\\": \\\"aws-cli/2.11.0 Python/3.11.2 Darwin/22.2.0 source/x86_64 prompt/off command/cloudtrail.lookup-events\\\", \\\"userIdentity\\\": {\\\"accessKeyId\\\": \\\"{{AccessKeyId}}\\\", \\\"accountId\\\": \\\"{{AccountId}}\\\", \\\"arn\\\": \\\"arn:aws:sts::{{AccountId}}:assumed-role/{{UserRole}}/{{UserName}}\\\", \\\"principalId\\\": \\\"{{PrincipalId}}:{{UserName}}\\\", \\\"sessionContext\\\": {\\\"attributes\\\": {\\\"creationDate\\\": \\\"{{ faker 'date.past' EventTime }}\\\", \\\"mfaAuthenticated\\\": \\\"false\\\"}, \\\"sessionIssuer\\\": {\\\"accountId\\\": \\\"{{AccountId}}\\\", \\\"arn\\\": \\\"arn:aws:iam::{{AccountId}}:role/{{UserRole}}\\\", \\\"principalId\\\": \\\"{{PrincipalId}}\\\", \\\"type\\\": \\\"Role\\\", \\\"userName\\\": \\\"{{UserRole}}\\\"}, \\\"webIdFederationData\\\": {}}, \\\"type\\\": \\\"{{ faker 'person.jobArea' }}\\\"}}\",\r\n \t\t\t\"EventId\": \"{{EventId}}\",\r\n \t\t\t\"EventName\": \"{{EventName}}\",\r\n \t\t\t\"EventSource\": \"{{EventSource}}\",\r\n \t\t\t\"EventTime\": \"{{EventTime}}\",\r\n \t\t\t\"ReadOnly\": \"true\",\r\n \t\t\t\"Resources\": [\r\n \t\t\t],\r\n \t\t\t\"Username\": \"{{UserName}}\"\r\n \t\t}\r\n\t\t{{/each}}\r\n\t]\r\n\t{{#if (gte (indexOf (urlParam 'NextToken') 'true' 0) 0)}}\r\n\t {{#unless (includes (stringify (body)) 'NextToken')}}\r\n\t\t ,\"NextToken\": \"{{ faker 'string.alphanumeric' 64 casing='upper' }}\"\r\n\t\t{{/unless}}\r\n\t{{/if}}\r\n}", + "latency": 0, + "statusCode": 200, + "label": "", + "headers": [], + "bodyType": "INLINE", + "filePath": "", + "databucketID": "c5kh", + "sendFileAsBody": false, + "rules": [], + "rulesOperator": "OR", + "disableTemplating": false, + "fallbackTo404": false, + "default": true, + "crudKey": "id", + "callbacks": [] + } + ], + "responseMode": null + } + ], + "rootChildren": [ + { + "type": "route", + "uuid": "b5e25f3a-a8e3-4128-9e45-f2654c5a599d" + }, + { + "type": "route", + "uuid": "77f82f1c-b06e-478a-8366-ab325830f00e" + } + ], + "proxyMode": false, + "proxyHost": "", + "proxyRemovePrefix": false, + "tlsOptions": { + "enabled": false, + "type": "CERT", + "pfxPath": "", + "certPath": "", + "keyPath": "", + "caPath": "", + "passphrase": "" + }, + "cors": true, + "headers": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "proxyReqHeaders": [ + { + "key": "", + "value": "" + } + ], + "proxyResHeaders": [ + { + "key": "", + "value": "" + } + ], + "data": [ + { + "uuid": "5dce6340-bade-4336-8041-50fd22570055", + "id": "nu28", + "name": "EventsTypeData", + "documentation": "", + "value": "[\n {\n \"name\": \"AwsApiCall\",\n \"error\": false\n },\n {\n \"name\": \"AwsServiceEvent\",\n \"error\": false\n },\n {\n \"name\": \"AwsConsoleAction\",\n \"error\": true,\n \t\"errorCode\": \"ThrottlingException\",\n \t\"errorMessage\": \"Rate exceeded error\"\n },\n {\n \"name\": \"AwsConsoleSignIn\",\n \"error\": true,\n \"errorCode\": \"LoginErrorException\",\n \"errorMessage\": \"Login error\"\n }\n]" + }, + { + "uuid": "76dec2a5-ff63-4e81-9611-94b900ab16e1", + "id": "c5kh", + "name": "EventsData", + "documentation": "", + "value": "[\n {{#each (dataRaw 'EventsTypeData')}}\n {{#if (gte @isEvent 1)}}\n ,\n {{/if}}\n {{setVar 'isEvent' (add (urlParam name) @isEvent)}}\n {{#repeat (urlParam name comma=true)}}\n {\n \"AccessKeyId\": \"{{ faker 'string.alphanumeric' 20 casing='upper' }}\",\n \"AccountId\": \"{{ faker 'string.numeric' 12 }}\",\n \"Error\": {{error}},\n {{#if error}}\n \"ErrorCode\": \"{{errorCode}}\",\n\t \"ErrorMessage\": \"{{errorMessage}}\",\n {{/if}}\n \"EventId\": \"{{ faker 'string.uuid' }}\",\n \"EventName\": \"{{oneOf (array 'LookupEvents' 'ListInstanceAssociations' 'AssumeRoleWithWebIdentity')}}\",\n \"EventSource\": \"{{oneOf (array 'cloudtrail.amazonaws.com' 'ssm.amazonaws.com' 'sts.amazonaws.com')}}\",\n \"EventTime\": \"{{ faker 'date.recent' }}\",\n \"EventType\": \"{{name}}\",\n \"PrincipalId\": \"{{ faker 'string.alphanumeric' 20 casing='upper' }}\",\n \"UserName\": \"{{ faker 'internet.userName' }}\",\n \"UserRole\": \"{{ faker 'person.jobType' }}\"\n }\n {{/repeat}}\n {{/each}}\n]" + } + ], + "callbacks": [] +} \ No newline at end of file diff --git a/tests/cloud/aws/cloudtrail/countevents.robot b/tests/cloud/aws/cloudtrail/countevents.robot new file mode 100644 index 000000000..e47a2ddc1 --- /dev/null +++ b/tests/cloud/aws/cloudtrail/countevents.robot @@ -0,0 +1,38 @@ +*** Settings *** +Documentation AWS CloudTrail plugin + +Resource ${CURDIR}${/}..${/}..${/}..${/}resources/import.resource + +Suite Setup Start Mockoon ${MOCKOON_JSON} +Suite Teardown Stop Mockoon +Test Timeout 120s + + +*** Variables *** +${MOCKOON_JSON} ${CURDIR}${/}cloud-aws-cloudtrail.json + +${CMD} ${CENTREON_PLUGINS} --plugin=cloud::aws::cloudtrail::plugin --custommode=paws --region=eu-west --aws-secret-key=secret --aws-access-key=key + + +*** Test Cases *** +AWS CloudTrail count events + [Documentation] Check AWS CloudTrail count events + [Tags] cloud aws cloudtrail + + ${command} Catenate + ... ${CMD} + ... --mode=countevents + ... --endpoint=http://localhost:3000/cloudtrail/events/AwsApiCall/${AwsApiCall}/AwsServiceEvent/${AwsServiceEvent}/AwsConsoleAction/${AwsConsoleAction}/AwsConsoleSignIn/${AwsConsoleSignIn}/NextToken/${NextToken} + ... ${extraoptions} + Ctn Run Command And Check Result As Strings ${command} ${expected_result} + + Examples: tc AwsApiCall AwsServiceEvent AwsConsoleAction AwsConsoleSignIn NextToken extraoptions expected_result -- + ... 1 4 2 1 3 false ${EMPTY} OK: Number of events: 10.00 | 'events_count'=10.00;;;0; + ... 2 4 2 1 3 true ${EMPTY} OK: Number of events: 20.00 | 'events_count'=20.00;;;0; + ... 3 4 2 1 3 false --event-type=AwsApiCall OK: Number of events: 4.00 | 'events_count'=4.00;;;0; + ... 4 4 2 1 3 false --event-type=AwsServiceEvent OK: Number of events: 2.00 | 'events_count'=2.00;;;0; + ... 5 4 2 1 3 false --delta=10 OK: Number of events: 10.00 | 'events_count'=10.00;;;0; + ... 6 4 2 1 3 false --error-message='Login error' OK: Number of events: 3.00 | 'events_count'=3.00;;;0; + ... 7 4 2 1 3 false --error-message='.*error' OK: Number of events: 4.00 | 'events_count'=4.00;;;0; + ... 8 4 2 1 3 false --warning-count=3 WARNING: Number of events: 10.00 | 'events_count'=10.00;;;0; + ... 9 4 2 1 3 false --critical-count=5 CRITICAL: Number of events: 10.00 | 'events_count'=10.00;;;0;