Icinga 2 Quick Start

My lab network has been missing monitoring for its entire existence, and a week ago, I would have considered it the only major software category not present. Some time ago, I made a screencast and blog post on installing Icinga with Postgres, but never got much further with actual usage. This week, I decided to try an Icinga install again.

Part of the motivation to try again, was stripped down How To from Digital Ocean (How To Use Icinga To Monitor Your Servers and Services On Ubuntu 14.04), which I followed and got a basic Icinga 1 install running. I had to dig to fill in some gaps, but came out with a much better understanding of Icinga itself.

Icinga 2 was recently released, and I decided to try for the ‘latest & greatest’ in my lab, since the knowledge was at least somewhat transferrable between Icinga and Nagios if I ever encountered them. I began by reading the Getting Started guide, but found the guide contained too many disclaimers and variations to be useful as a Quick Start. After burning through a few VMs, I parred down the content of the Getting Started section, in to a Quick Start Guide for Icinga 2 w/ Icinga Web.

I started with a fresh Minimal CentOS 6 install. The Icinga 2 packages require some elements from the EPEL Repository, so we add that first. Then we add the Icinga repository and sync the repo listings.

I struggled with access when I tried Icinga on PostgreSQL previously, so I opted for MySQL. This will install MySQL, start it, set it to start on boot, and allow you to configure a root password.

Now we are ready to actually install Icinga 2.

This will install Icinga 2, the Monitoring Plugins, and the IDO Utils for MySQL which will be needed later for Icinga-Web later.

Now we will install the web interface. I’m not quite bold enough to try the Experimental Icinga 2 UI, so we will just use the Icinga 1.x interface (1.x is not Classic).

Here we have installed the requisite packages (I found that php-mysql was not a dependency and had to be installed explicitly). Then we add the web server user to the icingacmd group. This gives the web server access to the file specified by “icinga_pipe” so we can control Icinga from the web interface.

If you navigate to http://server-address/icinga-web, you should be greeted by the login page. Default username and password on RedHat installs is root:password. If everything is working, you should have a few services being checked on the new server and be able to tell Icinga to run commands. (i.e.-run this check right now)

A quick comment on the configuration I discovered.

If you check out /usr/share/icinga2/include/command-plugins.conf, you’ll see that commands have an ‘arguments’ which has a command line flag and a variable. You can pass these in your checks by adding “vars.variable_name” in your Service Object.

The ‘command-plugins’ file and that tip should help you quickly get basic monitoring setup going.

Leave a Comment

Your email address will not be published. Required fields are marked *