May 6, 2021

Icinga howto

Icinga is a fork of Nagios, a stalwart network monitoring system of yore. Icinga puts more features and a better interface together, but still reads old Nagios stuff.

Icinga howto on Debian Jessie

apt-get install php5 php5-cli php-pear php5-xmlrpc php5-xsl php5-gd php5-ldap php5-mysql mysql-server icinga-web-pnp icinga-web icinga

Now you can add hosts to monitor like:

This is on Debian Squeeze, but can work with tweaks on other distro’s:

apt-get install php5 php5-cli php-pear php5-xmlrpc php5-xsl php5-gd php5-ldap php5-mysql
echo "deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc/apt/sources.list.d/squeeze-backports.list
apt-get update
apt-get install icinga-web-pnp icinga-web
apt-get -t squeeze-backports install icinga-web icinga-web-pnp

Error: ido2dbCould not bind socket: Address already in use

icinga gives this error for some reason periodically, to fix it do:

rm var/lib/icinga/ido.sock
/etc/init.d/ido2db restart
ps aux | grep ido2db

You should now see a couple processes running like:

nagios    1079  0.0  0.0  32096   652 ?        Ss   07:03   0:00 /usr/sbin/ido2db -c /etc/icinga/ido2db.cfg

troubleshooting icinga config

If you try to start the daemon (or restart) with errors in the config files, it will just fail and probably not tell you why. If you run the verify option from the command line it will tell you which lines in the config it doesn’t like:

cd /etc/icinga
icinga -v icinga.cfg
  Processing object config file '/etc/icinga/objects/hostgroups_icinga.cfg'...
  Error: Unexpected token or statement in file '/etc/icinga/objects/hostgroups_icinga.cfg' on line 1.
  Error processing object config files!
  ***> One or more problems was encountered while processing the config files...
     Check your configuration file(s) to ensure that they contain valid
     directives and data definitions.

If you look on Line 1 of the hostgroups_icinga.cfg file in the objects subfolder you’ll find an error on line 1. Once you fix that you can start the daemon 🙂