@mattab opened this Issue on May 14th 2015 Owner

Let's create a new FAQ to document how to monitor that a Piwik server is running smoothly.

What do you think?

How do I monitor that Piwik service is up?

To monitor for Piwik service, setup the following checks:

  • Tracker API: request to /piwik.php should return http status 200
  • Core platform: request to /index.php?module=API&method=API.XXX should return http status 200

We recommend to use https:// in the checks URLs so you're also checking Piwik works over secured connection.

Likely the tool you use for monitoring will let you know the services Uptime (eg. 99%) which is useful metric.

@mattab commented on May 14th 2015 Owner

Notes

  • maybe we could create a new API for this purpose of monitoring, or simply use API.getPiwikVersion for now.
  • Note that HTTP 503 is returned when there is pending DB upgrade #7903
    or Piwik is in maintenance mode #7901
  • HTTP 500 error is returned when DB connection fails #7903
@mattab commented on July 15th 2015 Owner
@gaumondp commented on July 15th 2015

I read @mattab FAQ and was wondering if the check involved the database at all. If "MySQL has gone away" the test to index.php?module=API&method=API.getPiwikVersion would still work right ?

If it's the case (no DB call) I will create a new FC for a second test involving the DB.

I'm aware a check could be done directly to MySQL with monitoring tools but having the check from within Piwik would be more simple to setup I think.

@mattab commented on July 15th 2015 Owner

the index.php check will detect when Mysql server is down and http status should be 500

however the piwik.php check will still work when mysql is down, I looked whether we could provide a piwik.php check that detects the db is down, but it's not easy, so decided not to do it

@gaumondp commented on July 15th 2015

Ok then.

BTW, the FAQ seems incomplete. We need the &token_auth= . If not, we still get a 200-OK but also an error message saying we don't get view rights in the XML response :

`

`

@mattab commented on July 16th 2015 Owner

Thanks @gaumondp FAQ has been updated with token_auth

@mritzmann commented on December 12th 2017

Does the check also check whether the archiving job is running successfully?

@mattab commented on December 12th 2017 Owner

No it doesn't

This Issue was closed on July 15th 2015
Powered by GitHub Issue Mirror