Install Icinga2 and Icingaweb2 » History » Revision 2
Revision 1 (Jon Goldberg, 06/08/2017 07:27 PM) → Revision 2/16 (Jon Goldberg, 06/08/2017 07:33 PM)
{{last_updated_at}} by {{last_updated_by}} # Install Icinga2 and Icingaweb2 {{>toc}} ### Installation (Master Node) I followed this guide: <http://linoxide.com/ubuntu-how-to/install-icinga2-ubuntu-16-04/>. <http://linoxide.com/ubuntu-how-to/install-icinga2-ubuntu-16-04/>.\ Here's where I deviated from the guide: - I installed nagios-plugins - but in Ubuntu 16.04 this has Samba as a dependency. So then I also ran `apt remove samba-common samba-libs`. - I didn't install PHP 5.6 - Icingaweb2 is now PHP7-compatible. - I uncommented the second line in /etc/php/7.0/mods-available/zend-framework.ini, ran `phpenmod zend-framework` and restarted Apache (to work around this bug: <https://bugs.launchpad.net/ubuntu/+source/icingaweb2/+bug/1574250> ### Configuration - Run `icinga2 node wizard. `Select "N" to create a master node. - Enable the command module to allow issuing commands from Icingaweb2: `icinga2 feature enable command`; service icinga2 restart - Add an API user for remote checks. For instance, a user that can receive backupninja checks: <div class="code panel pdl" style="border-width: 1px;"> <div class="codeContent panelContent pdl"> ``` object ApiUser "backupninja" { password = "<redacted>" permissions = [ { permission = "actions/process-check-result" filter = {{ match("backupninja", service.display_name) }} } ] } ``` ### Install additional checks #### Install Plugins Place the following two scripts in your plugins directory (`/usr/lib/nagios/plugins`) and ensure they're executable: - **check\_drupal** - installs with the Drupal "nagios" plugin, also available [here](http://cgit.drupalcode.org/nagios/plain/nagios-plugin/check_drupal?id=7da732e2d4943ec5368243f4cd2e33eb02769f23). [here](http://cgit.drupalcode.org/nagios/plain/nagios-plugin/check_drupal?id=7da732e2d4943ec5368243f4cd2e33eb02769f23){.external-link}. - **check\_civicrm** - There are two scripts - one for Civi 4.6 and below, another for 4.7 and up. 4.7 version is available [here](https://github.com/PalanteJon/check_civicrm){.external-link}, 4.6 version is <span>[here](https://raw.githubusercontent.com/aghstrategies/com.aghstrategies.civimonitor/master/check_civicrm.php).</span> <span>[here](https://raw.githubusercontent.com/aghstrategies/com.aghstrategies.civimonitor/master/check_civicrm.php){.external-link}.</span> - <span>**check\_domain** - This does a WHOIS lookup to ensure domain names aren't about to expire. Install from [here](https://raw.githubusercontent.com/glensc/monitoring-plugin-check_domain/master/check_domain.sh).</span> [here](https://raw.githubusercontent.com/glensc/monitoring-plugin-check_domain/master/check_domain.sh){.external-link}.</span> - <span><span>**check\_rbl** - Check spam blacklists. File is [here](https://raw.githubusercontent.com/matteocorti/check_rbl/master/check_rbl), [here](https://raw.githubusercontent.com/matteocorti/check_rbl/master/check_rbl){.external-link}, also install dependencies: `apt </span></span>`apt install libreadonly-xs-perl libnagios-plugin-perl libdata-validate-ip-perl libdata-validate-domain-perl libnet-dns-perl` #### Define <span>Define CheckCommand and Service objects for the new plugins plugins\ </span> {#HowtoInstallIcinga2andIcingaweb2-DefineCheckCommandandServiceobjectsforthenewplugins} Copy <span>Copy the CheckCommand and Service files from `icinga.jmaconsulting.biz:/etc/icinga2/zones.d/global-templates/CheckCommands` and `icinga.jmaconsulting.biz:/etc/icinga2/conf.d/services`. See [[Add <span>`icinga.jmaconsulting.biz:/etc/icinga2/conf.d/services`</span>. See [Add New Checks to Icinga2]] Icinga2](Add-New-Checks-to-Icinga2_86674780.html) for details. details.\ </span> ### Set up vim syntax highlighting on the Icinga2 server ``` mkdir -p ~/.vim/{syntax,ftdetect} cd ~/.vim/syntax wget https://raw.githubusercontent.com/Icinga/icinga2/master/tools/syntax/vim/syntax/icinga2.vim cd ~/.vim/ftdetect wget https://raw.githubusercontent.com/Icinga/icinga2/master/tools/syntax/vim/ftdetect/icinga2.vim ```