Hello
I found a bug when try this connector with centreon :
sudo -u centreon ./centreon_azure_database_mariadb_api.pl --plugin=cloud::azure::database::mariadb::plugin --resource=mydb --resource-group=Myressourcegroup --subscription='SUBID' --tenant='TenantID' --client-id='clientID' --client-secret=Secret --custommode=api --mode=cpu
this return :
Use of uninitialized value $options{"resource_type"} in concatenation (.) or string at ./centreon_azure_database_mariadb_api.pl line 8854.
UNKNOWN: Management endpoint API returns error code 'InvalidResourceType' (add --debug option for detailed message)
error can be differend when using --resource=
I debug the script and join a working version:
There is two error in every mode in fonction check_options
I replace this code :
my $resource_type = $self->{option_results}->{resource_type};
if ($resource =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/Microsoft\.DBforMariaDB\/(.*)\/(.*)$/) {
$resource_group = $1;
$resource_type = 'servers';
$resource = $3;
}
by
``
my $resource_type = "servers";
if ($resource =~ /^\/subscriptions\/.*\/resourceGroups\/(.*)\/providers\/Microsoft\.DBForMariaDB\/servers\/(.*)$/) {
$resource_group = $1;
$resource = $2;
}
Hello I found a bug when try this connector with centreon :
sudo -u centreon ./centreon_azure_database_mariadb_api.pl --plugin=cloud::azure::database::mariadb::plugin --resource=mydb --resource-group=Myressourcegroup --subscription='SUBID' --tenant='TenantID' --client-id='clientID' --client-secret=Secret --custommode=api --mode=cpu
this return : Use of uninitialized value $options{"resource_type"} in concatenation (.) or string at ./centreon_azure_database_mariadb_api.pl line 8854. UNKNOWN: Management endpoint API returns error code 'InvalidResourceType' (add --debug option for detailed message)
error can be differend when using --resource=
I debug the script and join a working version: There is two error in every mode in fonction check_options
I replace this code :
by ``
I hope this can help . Regards. DESMAREST JULIEN centreon_azure_database_mariadb_api.zip