We have our Piwik instances on an autoscaling group behind an ELB load balancer.
Today our AWS system went into freefall launching and terminating instances in an infinite loop.
On debugging we realised that we'd been using index.php to do a health check. Because the version had been upgraded Piwik was now returning a 302 for index.php to prompt to run the upgrade process. AWS ELB only recognises 200 as healthy.
We've changed the ELB to point to plugins/Diagnostics/DiagnosticReport.php instead, which gave a stable 200 response in both scenarios. However I'm sure this is far from robust.
Is it possible to provide a reliable URL on which load balancers (and other monitoring systems) can health check Piwik from?
You could probably use http://example.org/config/global.ini.php or http://example.org/config/config.ini.php since it is unlikely that we will remove those files anytime soon. We do have some monitoring running as well but I do not know what we use for our health checks. We do not really have this problem that they could go into freefall launching and terminating.
What exactly did you want to test here? Just whether the webserver is running in general?
Thanks for the response.
I'll try those pages.
Yes we just want to know if the server is up and running.
The problem is manifest when using health checks with autoscaling. If the health check fails then autoscaling kills the instance and creates a new one. But the health check will always fail if the page doesn't return a 200 (for whatever reason).
what URL should we use for a health check if we put matomo behind a load balancer? This thread was unfortunately not useful so far.
and expect http code
You could for example create a site for ELB and use the tracking API for this like
http://yourdomain.com/matomo.php?rec=1&idsite=1&action_name=foo&send_image=1 this will also test DB connection basically.