Herramientas de usuario

Herramientas del sitio


servidores:general:icinga

Icinga: instalación y notas

For anyone trying to install icinga2 on wheezy, here is a short howto. 
Hopefully it finds it's way via some scrapper onto some search engine. 
Feel free to re-publish etc.
---
// Standard disclaimer: This may destroy your computer, cause data loss, 
and ruin your life. You have been warned.
// After you've installed a Debian wheezy minimal install...
// disable recommends
# echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/02local
// add the repositories
# echo 'deb http://packages.icinga.org/debian icinga-wheezy-snapshots main
deb-src http://packages.icinga.org/debian icinga-wheezy-snapshots main
deb http://ftp.debian.org/debian wheezy-backports main' >> 
/etc/apt/sources.list
# wget -O - http://packages.icinga.org/icinga.key | apt-key add -
# apt-get update && apt-get upgrade
// install some packages
# apt-get install default-mta
# dpkg-reconfigure exim4-config
# apt-get install mysql-server
// install icinga2
# apt-get install icinga2-ido-mysql icinga2
// enable some necessary features
# icinga2-enable-feature ido-mysql
# icinga2-enable-feature command
// create the icinga2 DB
# mysql -u root -p
mysql> CREATE DATABASE icinga;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, 
EXECUTE ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga';
mysql> quit;
// populate the icinga2 DB
# cp /usr/share/icinga2-ido-mysql/schema/mysql.sql .
# sed -i "1iuse icinga;" mysql.sql
# mysql -u root -p < mysql.sql
// restart icinga2
# service icinga2 restart
// install icinga-web
# apt-get -t wheezy-backports install icinga-web
// You probably want to do:
# apt-get install nagios-plugins nagios-nrpe-plugin nagios-plugins-contrib
# chmod u+s /usr/lib/nagios/plugins/check_dhcp
// and maybe:
# apt-get install nagios-plugins-contrib
// If you want to control icinga2 from the web UI, you need to correct 
the file path:
// look for "icinga_pipe" in /etc/icinga-web/conf.d/access.xml
//                        <resource 
name="icinga_pipe">/var/run/icinga2/cmd/icinga2.cmd</resource>
//<!--                        <resource 
name="icinga_pipe">/var/lib/icinga/rw/icinga.cmd</resource> -->
// Then:
# /usr/lib/icinga-web/bin/clearcache.sh
// restart some daemons:
# service icinga2 restart && service apache2 restart
// Have a look at http://server/icinga-web/
---
Notes:
If you use a different username and password for the icinga2 database, 
you have to configure it yourself in: 
/etc/icinga2/features-enabled/ido-mysql.conf
It would be good if icinga2-ido-mysql was dependent on mysql-server.
The icinga-web database gets created by dbconfig upon install. icinga2 
does not create a database upon install. So you have to create and 
"import the schema" yourself. When trying to upgrade to the version in 
the snapshot repository, I found that it did seem to try to update the 
database. Though this fails because of existing indexes. I noticed this 
was the same with the upgrade for the icinga-web package. I think 
different SQL needs to be supplied for upgrades.

If some of those packaging issues were sorted out, then it would merely 
be configuring apt and installing packages. Pretty nice!

I'm happy to redo any of this and file bugs, but they probably already 
exist. Please let me know if I can be of help.

Bibliografía

servidores/general/icinga.txt · Última modificación: 2014/08/19 09:56 por fmolinuevo