Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Check API: Difference between revisions

From MoodleDocs
No edit summary
Line 59: Line 59:
These are environmental checks to make sure a Moodle instance is fully setup.
These are environmental checks to make sure a Moodle instance is fully setup.


== Security checks ==
=== Security checks ===


These are checks to make sure a Moodle instance is hardened correctly for you needs.
These are checks to make sure a Moodle instance is hardened correctly for you needs.
Line 66: Line 66:




== Performance checks ==
=== Performance checks ===


/report/performance/index.php
/report/performance/index.php
Line 72: Line 72:
Each check might exercise  
Each check might exercise  


== Health checks ==
=== Health checks ===


/report/status/index.php
/report/status/index.php


A Health check covers operational tests such as 'can moodle connect to ldap'. The main core health check is to ensure that cron is running regularly and there has been no failed tasks.
A Health check covers operational tests such as 'can moodle connect to ldap'. The main core health check is to ensure that cron is running regularly and there has been no failed tasks.

Revision as of 13:51, 26 January 2020

WARNING: Work in Progress

Checks

A Check is a runtime test to make sure something is working well. Checks can be used for a variety of purposes including:

  • configuration checks
  • security checks
  • performance checks
  • health checks

Moodle has had various types of checks for a long time but in 3.9 they were unified under a single Check API enabling plugins to cleanly define their own additional checks.

Result state of a check

Status Meaning Example
N/A This check doesn't apply - but we may still want to expose the check secure cookies setting is disabled because site is not https
Ok A component is configured, working and fast. ldap can bind and return value with low latency
Info A component is OK, and we may want to alert the admin to something non urgent such as a deprecation, or something which needs to be checked manually.
Unknown We don't yet know the state. eg it may be very expensive so it is run using the Task API and we are waiting for the answer. A complex user security report
Warning Something is not ideal and should be addressed, eg usability or the speed of the site may be affected, but it may self heal (eg a load spike) auth_ldap could bind but was slower than normal
Error Something is wrong and parts or all of the site are broken auth_ldap could not connect, so users cannot start new sessions
Critical An error which is affecting everyone in a major way Cannot read sitedata or the database


Check types and reports

Configuration checks

/admin/index.php?cache=1

/admin/environment.php

These are environmental checks to make sure a Moodle instance is fully setup.

Security checks

These are checks to make sure a Moodle instance is hardened correctly for you needs.

/report/security/index.php


Performance checks

/report/performance/index.php

Each check might exercise

Health checks

/report/status/index.php

A Health check covers operational tests such as 'can moodle connect to ldap'. The main core health check is to ensure that cron is running regularly and there has been no failed tasks.