Project

General

Profile

Monitoring CiviCRM » History » Revision 5

Revision 4 (Jon Goldberg, 12/18/2017 10:16 PM) → Revision 5/7 (Jon Goldberg, 09/27/2018 02:38 PM)

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

 ### CiviCRM 4.6 and below 
 Install CiviMonitor: 

 -     Log into the website, browse to CiviCRM. 
 -     Go to **Administer menu > System Settings > Manage 
     Extensions**. 
     -     On Civi sites that have been updated from much older versions, 
         this may be **Administer menu > Customize Data and 
         Screens > Manage Extensions**. 
 -     Click on the "Add New" tab. 
 -     Click "Download" next to "CiviCRM Monitoring for Nagios". 
 -     Continue with the "All versions" directions. 

 ### 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 
 ```