Is there a way that I can be notified via email anytime the system status changes? (Or changes to something other than 'ok'.)
2 Answers
There is nothing such available at the moment as i am aware of which can be configured inside CiviCRM but can be developed by writing a small extension using hooks to implement schedule job.
But this can be implemented if you have nagios/icinga monitoring your server. You can install CIVICRM MONITORING FOR NAGIOS extension and configure nagios/icinga to send email.
Here's a one liner you can put in a cron script. You might want to make the call to mail
more robust or flesh the whole thing out a bit, but the gist is you can call api System.check and examine the severity level and if it's higher than 1 for any check then send you an email.
cv ev --user=admin "$checks = civicrm_api3('System', 'check', [])['values']; foreach($checks as $check) {if ($check['severity_id'] > 1) { mail('[email protected]', 'oh oh', print_r($checks, true)); break; }};"
Replace --user=admin
with a CMS username that has administer civicrm permission.