Monitoring Drupal » History » Version 2
Jon Goldberg, 04/30/2019 10:17 PM
| 1 | 1 | Jon Goldberg | {{last_updated_at}} by {{last_updated_by}} |
|---|---|---|---|
| 2 | # Monitoring Drupal |
||
| 3 | |||
| 4 | ### Install the Nagios Module |
||
| 5 | |||
| 6 | ```bash |
||
| 7 | drush pm-download nagios |
||
| 8 | drush -y pm-enable nagios |
||
| 9 | drush cache-clear all |
||
| 10 | ``` |
||
| 11 | |||
| 12 | ### Manual (Web UI) configuration |
||
| 13 | |||
| 14 | *Note: CLI configuration* *is much faster, see below.* |
||
| 15 | |||
| 16 | - Go to Drupal's **Configuration menu » Nagios Monitoring.** |
||
| 17 | - Insert a random Unique ID. |
||
| 18 | - Check "Enable status page?" |
||
| 19 | - Under "Thresholds", set "Cron duration" to "480" (8 hours) and |
||
| 20 | "Minimum report severity" to CRITICAL. |
||
| 21 | - Go to **Modules menu**. |
||
| 22 | - Next to "CiviCRM", check "Ignore from Nagios" and press "Save". |
||
| 23 | |||
| 24 | ### CLI Configuration |
||
| 25 | |||
| 26 | - Paste this on the command line: |
||
| 27 | |||
| 28 | ```bash |
||
| 29 | drush vset nagios_cron_duration '480' |
||
| 30 | drush vset nagios_enable_nagios 1 |
||
| 31 | drush vset nagios_enable_status_page 1 |
||
| 32 | drush vset nagios_enable_status_page_get 0 |
||
| 33 | drush vset nagios_func_cron 1 |
||
| 34 | drush vset nagios_func_modules 1 |
||
| 35 | drush vset nagios_func_nodes 1 |
||
| 36 | drush vset nagios_func_requirements 1 |
||
| 37 | drush vset nagios_func_session_anon 1 |
||
| 38 | drush vset nagios_func_session_auth 1 |
||
| 39 | drush vset nagios_func_themes 1 |
||
| 40 | drush vset nagios_func_users 1 |
||
| 41 | drush vset nagios_min_report_severity '2' |
||
| 42 | drush vset nagios_page_callback nagios_status_page |
||
| 43 | drush vset nagios_page_path nagios |
||
| 44 | drush vset nagios_show_outdated_names 1 |
||
| 45 | drush vset nagios_status_critical_value '2' |
||
| 46 | drush vset nagios_status_ok_value '0' |
||
| 47 | drush vset nagios_status_unknown_value '3' |
||
| 48 | drush vset nagios_status_warning_value '1' |
||
| 49 | drush vset --format=json nagios_ignored_modules '{"civicrm":true}' |
||
| 50 | # This sets a random site key |
||
| 51 | # Ensure pwgen is installed |
||
| 52 | drush vset nagios_ua `pwgen -s 32 1` |
||
| 53 | ``` |
||
| 54 | |||
| 55 | Icinga Configuration |
||
| 56 | -------------------- |
||
| 57 | |||
| 58 | - Log into the Icinga server: `ssh icinga` |
||
| 59 | - If necessary, define the new host by making a copy of an existing |
||
| 60 | host file in `/etc/icinga2/conf.d/hosts`. |
||
| 61 | - Add the |
||
| 62 | line: `vars.drupal_site_id = "<unique site id here>" (unique ID from /admin/config/system/nagios)` |
||
| 63 | - TODO: Indicate if SSL is required and how to indicate it. |
||
| 64 | - Test your syntax with: `service icinga2 checkconfig`. |
||
| 65 | - Restart Icinga: `service icinga2 restart` |
||
| 66 | 2 | Jon Goldberg | |
| 67 | ### Basic auth |
||
| 68 | If your site is behind basic auth, add this to the Icinga vhost configuration |
||
| 69 | ``` |
||
| 70 | basic_auth_user = "megaphone" |
||
| 71 | basic_auth_password = "megaphone" |
||
| 72 | ``` |