Project

General

Profile

Monitoring CiviCRM » History » Revision 6

Revision 5 (Jon Goldberg, 09/27/2018 02:38 PM) → Revision 6/7 (Jon Goldberg, 09/27/2018 02:49 PM)

{{last_updated_at}} by {{last_updated_by}} 
 # Monitoring CiviCRM 

 ### All versions 

 -     **NOTE**: The next two items use `drush` on Drupal. If using 
     Wordpress, substitute `wp cv civicrm-sql-query` for 
     `drush civicrm-sql-query`. 
 -     Determine if there's an existing administrative user with an API 

 ```bash     
 drush civicrm-sql-query 'SELECT display_name, api_key FROM civicrm_contact WHERE api_key IS NOT NULL;' 
 ``` 
 -     If so, grab that API key. If not, use `pwgen` or similar to generate 
     a random string, then update CiviCRM with it: 

 ```bash 
 drush civicrm-sql-query 'UPDATE civicrm_contact SET api_key = "<api key here>" WHERE id = 2;' 
 ``` 
 -     Get the site key: 

 ```bash 
 grep SITE_KEY sites/default/civicrm.settings.php #(Drupal) 
 grep SITE_KEY wp-content/plugins/civicrm/civicrm.settings.php #(Wordpress) 
 ``` 

 Icinga Configuration 
 -------------------- 

 -     Log into the Icinga server: `ssh icinga` 
 -     If necessary, define the new host by making a copy of an existing 
     host file in `/etc/icinga2/conf.d/hosts`. 
 -     Add the lines: 

 ``` 
 cms = "drupal"  
 crm_site_key = "<site key here>" 
 crm_api_key = "<api key here>" 
 ``` 
 -     Other valid values for CMS are "wordpress" and "joomla". 
 -     Test your syntax with: `service icinga2 checkconfig`. 
 -     Restart Icinga: `service icinga2 restart` 

 ### Shutting up specific messages from CLI 
 If you need to quiet a particular message from CiviCRM monitoring, you can use a command like this.    Severity level is 2 for notice, 3 for warning, 4 for critical. 
 ```bash 
 cv api StatusPreference.create name=checkVersion_upgrade hush_until=2018-10-04 ignore_severity=2 
 cv api StatusPreference.create name=checkVersion_patch hush_until=2018-10-04 ignore_severity=2 
 ```