The JasperReports Server diagnostic feature exposes a set of managed beans (MBeans), each with a number of JMX attributes. By default, all attributes of all MBeans are available. If you would like to limit what is exposed, you can exclude any of the attributes or entire beans through the following configuration file:
.../WEB-INF/applicationContext-diagnostic.xml
|
•
|
To exclude an attribute, locate the MBean where it is defined and uncomment it from the excludedDiagnosticAttributes property. For example, if you want to hide sensitive information about your internal database, modify the diagnosticRepositoryDatabaseInfoCe MBean as follows: |
<bean id="diagnosticRepositoryDatabaseInfoCe" class=
"com.jaspersoft.jasperserver.api.logging.diagnostic.jmx.DiagnosticDynamicMBean">
<property name="diagnosticServices">
<set>
<ref bean="repositoryDatabaseInfo"/>
</set>
</property>
<property name="excludedDiagnosticAttributes">
<set>
<value>DatabaseProductName</value>
<value>DatabaseProductVersion</value>
<value>DriverName</value>
<value>SQLKeywords</value>
<value>URL</value>
<value>UserName</value>
<value>JDBCMajorVersion</value>
<value>JDBCMinorVersion</value>
<!--
<value>MaxRowSize</value>
<value>MaxStatementLength</value>
<value>MaxConnections</value>
<value>MaxCharLiteralLength</value>
<value>MaxColumnsInTable</value>
<value>MaxColumnsInSelect</value>
<value>MaxColumnsInGroupBy</value>
<value>MaxColumnNameLength</value>
-->
</set>
</property>
</bean>
|
|
•
|
To exclude an entire bean, comment it out or remove it from the list of beans in the diagnosticExportingMBeansMap. For example, instead of excluding selected attributes, you could remove the entire repository database MBean as follows: |
<util:map id="diagnosticExportingMBeansMap" >
<entry key="jasperserver:name=Users" value-ref="${bean.diagnosticUsers}"/>
<entry key="jasperserver:name=Reports" value-ref="${bean.diagnosticReports}"/>
<entry key="jasperserver:name=Scheduler" value-ref="${bean.diagnosticScheduler}"/>
<entry key="jasperserver:name=Settings" value-ref="${bean.diagnosticSettings}"/>
<entry key="jasperserver:name=Repository" value-ref="${bean.diagnosticRepository}"/>
<entry key="jasperserver:name=About" value-ref="${bean.diagnosticJSAbout}"/>
<entry key="jasperserver:name=HibernateStatics"
value-ref="${bean.diagnosticHibernate}"/>
<entry key="jasperserver:name=EhCache"
value-ref="${bean.diagnosticEhCache}"/>
<entry key="jasperserver:name=ExternalInfo"
value-ref="${bean.diagnosticExternalInfo}"/>
<!--
<entry key="jasperserver:name=RepositoryDatabase"
value-ref="${bean.diagnosticRepositoryDatabaseInfo}"/>
-->
</util:map>
|
Disabling the Diagnostic Subsystem
By default the JMX diagnostic subsystem is always enabled, but external access is password-protected and requires opening the diagnostic port in your firewall as described in Exposing Diagnostics Through Jaspersoft's JMX Agent. If you wish to disable all external access, see Disabling Remote Connections to the JMX Agent.
Internally, the diagnostics subsystem is passive and has no performance impact until it is accessed in a report through the diagnostic data source. However, if you wish to disable the entire diagnostic subsystem, rename or remove the following files:
|
•
|
applicationContext-diagnostic.xml |
|
•
|
applicationContext-diagnostic-pro.xml |
In that case, the diagnostic data source, the sample report, and the sample Topic described in Using the Diagnostic Data In Reportswill not function either. They can be deleted from the repository.