Answers.Body: <p>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. </p>
  
  <p>But this can be implemented if you have nagios/icinga monitoring your server. You can install <a href="https://civicrm.org/extensions/civicrm-monitoring-nagios" rel="nofollow noreferrer">CIVICRM MONITORING FOR NAGIOS</a> extension and configure nagios/icinga to send email.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-02T14:54:31.133Z
Answers.LastActivityDate: 2020-04-02T14:54:31.133Z
Answers.UserDisplayName: Pradeep Nayak
Answers.Body: <p>Here's a one liner you can put in a cron script. You might want to make the call to <code>mail</code> 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.</p>
  
  <p><code>cv ev --user=admin "$checks = civicrm_api3('System', 'check', [])['values']; foreach($checks as $check) {if ($check['severity_id'] &gt; 1) { mail('admin@example.com', 'oh oh', print_r($checks, true)); break; }};"</code></p>
  
  <p>Replace <code>--user=admin</code> with a CMS username that has administer civicrm permission.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-02T16:14:31.460Z
Answers.LastActivityDate: 2020-04-02T16:14:31.460Z
Answers.UserDisplayName: Demerit
Body: <p>Is there a way that I can be notified via email anytime the system status changes? (Or changes to something other than 'ok'.)</p>
  
Tags: <email><admin><system-status>
Title: Get Admin email notifications for system status changes
ThreadText: # Get Admin email notifications for system status changes
  
  (Asked by: username_0 on 2020-04-02)
  
  Is there a way that I can be notified via email anytime the system status changes? (Or changes to something other than 'ok'.)
  
  **Tags:** email, admin, system-status
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-04-02. Score: 2
  
  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](https://civicrm.org/extensions/civicrm-monitoring-nagios) extension and configure nagios/icinga to send email.
  
  
  ---
  
  ### Answer by username_2 on 2020-04-02. Score: 1
  
  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('admin@example.com', 'oh oh', print_r($checks, true)); break; }};"`
  
  Replace `--user=admin` with a CMS username that has administer civicrm permission.
  
  
  ---
  
  