Monitoring CiviCRM » History » Revision 2
Revision 1 (Jon Goldberg, 06/09/2017 02:44 PM) → Revision 2/7 (Jon Goldberg, 06/09/2017 03:03 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 key: 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: ``` vars.cms = "drupal" vars.crm_site_key = "<site key here>" vars.crm_api_key = "<api key here>" ``` - Other valid values for CMS are "wordpress" and "joomla". - TODO: Indicate if SSL is required and how to indicate it. - Test your syntax with: `service icinga2 checkconfig`. - Restart Icinga: `service icinga2 restart`