diff --git a/apps/microsoft/exchange/local/mode/databases.pm b/apps/microsoft/exchange/local/mode/databases.pm index 1edc116b2..1c142dc95 100644 --- a/apps/microsoft/exchange/local/mode/databases.pm +++ b/apps/microsoft/exchange/local/mode/databases.pm @@ -27,7 +27,7 @@ use warnings; use centreon::plugins::misc; use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng); use centreon::common::powershell::exchange::databases; -use apps::microsoft::exchange::local::mode::resources::types qw($copystatus_contentindexstate); +use apps::microsoft::exchange::local::mode::resources::types qw($copystatus_contentindexstate $mapi_result); use JSON::XS; sub custom_mailflow_latency_perfdata { @@ -335,6 +335,8 @@ sub manage_selection { $db->{mounted} = $db->{mounted} =~ /True|1/i ? 1 : 0; $db->{copystatus_indexstate} = $copystatus_contentindexstate->{ $db->{copystatus_indexstate} } if (defined($db->{copystatus_indexstate})); + $db->{mapi_result} = $mapi_result->{ $db->{mapi_result} } + if (defined($db->{mapi_result})); $self->{databases}->{ $db->{database} . ':' . $db->{server} } = { database => $db->{database}, diff --git a/apps/microsoft/exchange/local/mode/resources/types.pm b/apps/microsoft/exchange/local/mode/resources/types.pm index e412665e7..f2c834356 100644 --- a/apps/microsoft/exchange/local/mode/resources/types.pm +++ b/apps/microsoft/exchange/local/mode/resources/types.pm @@ -27,11 +27,12 @@ use Exporter; our $queue_status; our $queue_delivery_type; our $copystatus_contentindexstate; +our $mapi_result; our @ISA = qw(Exporter); our @EXPORT_OK = qw( $queue_status $queue_delivery_type - $copystatus_contentindexstate + $copystatus_contentindexstate $mapi_result ); $queue_status = { @@ -87,4 +88,12 @@ $copystatus_contentindexstate = { 10 => 'DiskUnavailable' }; +$mapi_result = { + 0 => 'Undefined', + 1 => 'Success', + 2 => 'Failure', + 3 => 'MdbMoved', + 4 => 'StoreNotRunning' +}; + 1; diff --git a/centreon/common/powershell/exchange/databases.pm b/centreon/common/powershell/exchange/databases.pm index 86197a02e..04df0efb0 100644 --- a/centreon/common/powershell/exchange/databases.pm +++ b/centreon/common/powershell/exchange/databases.pm @@ -95,7 +95,7 @@ Foreach ($DB in $MountedDB) { $ps .= ' # Test Mapi Connectivity $MapiResult = test-mapiconnectivity -Database $DB.Name - $item.mapi_result = $MapiResult.Result + $item.mapi_result = $MapiResult.Result.Value.value__ '; }