I want to monitor my Geonetwork 2.10.4 from the load balancer with the URL www.example.com/geonetwork/monitor/healthcheck (slow) or www.example.com/geonetwork/criticalhealthcheck (fast). When I access these URLs, I need to log in. The load balancer cannot do this. Therefore I want to whitelist the URLs for the load balancer.
The documentation of Geonetwork 2.10.4 contains the following text.
"By default the /monitor/* urls are protected and may only be accessed by an ‘’administrator” or ‘’monitor’‘, however it is possible in the web.xml to provide a whitelist of URLs or IP addresses of monitoring servers that are permitted to access the monitoring data without needing an administration account."
Unfortunately, it doesn't say how to do that.
Removing/commenting the following text from web.xml
<!-- Only allow administrators or localhost access to the monitoring metrics -->
<filter>
<filter-name>MetricsRegistryInitializerFilter</filter-name>
<filter-class>org.fao.geonet.monitor.webapp.MetricsRegistryInitializerFilter</filter-class>
</filter>
results in the Tomcat error
Jul 18, 2018 12:00:36 PM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/geonetwork]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Filter mapping specifies an unknown filter name MetricsRegistryInitializerFilter
at org.apache.catalina.core.StandardContext.validateFilterMap(StandardContext.java:3111)
at org.apache.catalina.core.StandardContext.addFilterMap(StandardContext.java:3076)
at org.apache.catalina.deploy.WebXml.configureContext(WebXml.java:1265)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1331)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:863)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:371)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5401)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Jul 18, 2018 12:00:36 PM org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying web application archive /var/lib/tomcat7/webapps/geonetwork.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/geonetwork]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
at java.lang.Thread.run(Thread.java:748)
https://geonetwork-opensource.org/manuals/2.10.4/eng/users/admin/monitoring/index.html