In this tutorial, we will install an open source monitoring system ICINGA2, on ubuntu 14.04. Firstly we will configure some basic configuration to monitor network and services of host resources via the web interface.
We would be needing one server and no. of clients that we want to monitor. Here we are using Icinga version 2.x. Icinga Monitoring tool is completely plug-in based.
Why this tutorial?
I know there are some official tutorials available for its installation, but here are some tweaks which will make your work easier.
So lets begin.
Step 1: Add the Icinga repository and install icinga2.
“Installation of Icinga is complete now we have to install web interface of Icinga.”
Step 1: Clone Icinga web repository from Github.
# git clone git://git.icinga.org/icingaweb2.git
Step 2: Move cloned directory to /usr/share/icingaweb and navigate to it.
# mv icingaweb2 /usr/share/icingaweb
# cd /usr/share/icingaweb
Step 3: Install lamp server
# tasksel install lamp-server
Step 4: Configure apache, run the following command and copy paste the generated output in sites-enabled.
# ./bin/icingacli setup config webserver apache --document-root /usr/share/icingaweb/public
# service apache2 restart
# a2enmod rewrite
# service apache2 restart
Step 5: Create a directory in which icinga web will keep all of its authentication files
# mkdir /etc/icingaweb2
Step 6: Change its permission to 777
# chmod 777 -R /etc/icingaweb2
Step 7: Open your browser and navigate tolocalhost/icingaweb2/setup.
It will ask for setup token, you can generate it by running the following command on the terminal.
su www-data --shell=/bin/bash -c "mkdir -m 2770 /etc/icingaweb2; head -c 12 /dev/urandom | base64 | tee /etc/icingaweb2/setup.token; chmod 0660 /etc/icingaweb2/setup.token;";
In next screen it will be asking to resolve some problems like, time zone and some php dependencies, change time zone to “Asia/Kolkata” in /etc/php5/apache2/php.ini file
Download the require plugin and store it in /usr/lib/nagios/plugins.
Add execute permission to it
# chmod +x /var//lib/nagios/plugins/<filemame>
For using particular plugin, you have define its command in /etc/icinga2/conf.d/commands.conf
object CheckCommand "<identification name>"{
import "plugin-check-command"
command = [ PluginDir + "/<file name stored in plugin directory>" ]
arguments = {
/*define all require arguments*/
"-H" = "$address$" }
}
Configuring /etc/icinga2/conf.d/services.conf for using it for the host you want to monitor.
apply Service "<name you want to display for this service on interface>" {
import "generic-service"
check_command = "identification name"
assign where host.name == "icinga-3"
}
Now we have to define our host named icinga-3 in /etc/icinga2/conf.d/host.conf
khizer@ubuntu:~$ ./bin/icingacli setup config webserver apache –document-root /usr/share/icingaweb/public
-bash: ./bin/icingacli: No such file or directory
problem here ! the local host not found , error 404 😦
Hi!
I installed icinga2 on debian 7.8. When i entering into the web interface there ar no any hosts. Can you help me, please?
khizer@ubuntu:~$ ./bin/icingacli setup config webserver apache –document-root /usr/share/icingaweb/public
-bash: ./bin/icingacli: No such file or directory
Please help about the above
Quite helpful, thanks a lot!
You forgot one step in your guide, the schema needs to be populated via a SQL script:
mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql
Otherwise, thank you! Condensed the install documentation from icinga's site down considerably. 😀