From 0329aae838e6cc8c96516ae7fef1baa5294e965f Mon Sep 17 00:00:00 2001 From: omercier Date: Tue, 30 Jun 2020 11:16:02 +0200 Subject: [PATCH] add jboss jmx mbean for datasource mode The datasource mode returned an unknown status because the datasources were in another mbean. This addition shoud not break anything. --- apps/java/jboss/jmx/mode/datasourceusage.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/java/jboss/jmx/mode/datasourceusage.pm b/apps/java/jboss/jmx/mode/datasourceusage.pm index 5ff352517..f462a6e6c 100644 --- a/apps/java/jboss/jmx/mode/datasourceusage.pm +++ b/apps/java/jboss/jmx/mode/datasourceusage.pm @@ -99,13 +99,15 @@ sub manage_selection { [ { name => 'AvailableConnectionCount' }, { name => 'ConnectionCount' }, { name => 'ConnectionCreatedCount' }, { name => 'InUseConnectionCount' } ] }, { mbean => "jboss.as:data-source=*,statistics=pool,subsystem=datasources", attributes => [ { name => 'AvailableCount' }, { name => 'ActiveCount' }, { name => 'CreatedCount' }, { name => 'InUseCount' } ] }, + { mbean => "jboss.as.expr:xa-data-source=*,statistics=pool,subsystem=datasources", attributes => + [ { name => 'AvailableCount' }, { name => 'ActiveCount' }, { name => 'CreatedCount' }, { name => 'InUseCount' } ] }, ]; my $result = $options{custom}->get_attributes(request => $request, nothing_quit => 1); $self->{datasource} = {}; foreach my $key (keys %$result) { - $key =~ /(?:[:,])(?:name|data-source)=(.*?)(?:,|$)/; + $key =~ /(?:[:,])(?:name|data-source|xa-data-source)=(.*?)(?:,|$)/; my $ds_name = $1; $ds_name =~ s/^"(.*)"$/$1/;