Installation with OMD
Dieser Artikel wird nicht mehr gepflegt und ist unter Umständen nicht mehr gültig!
Today, the fastest way to get a working Nagios and Check_MK installation is using OMD. There is a free community version and a subscriber version with various additional features available. The difference between the versions is explained in detail here.
In this article we show you how to carry out the installation and to configure the first host and services.
1. Linux Installation
At first you need to install a basic linux system with a distribution of your choice. Supported Distributions are Debian, Ubuntu, CentOS, RedHat and SLES11. Before you choose a particular version, service pack and architecture you should check if a corresponding download package of OMD is available for that version. For most newer distributions this should be that case.
You can find an overview of available packages here:
Please note that OMD is installed to the /opt/omd directory, which on some linux installations might be on the root filesystem with limited disk space available. /opt/omd will contain your OMD software as well as your sites, potentially including a lot of data. So if you plan to build a large OMD site you might want to either mount a dedicated partition on /opt, or link it to some other directory on another partition with at least several GB disk space available. Note that very large sites with several 1000 hosts may require several 100GB of disk space when they also collect performance data.
2. Installing the OMD Package
2.1. Debian and Ubuntu
The easiest way is to use gdebi to install the package, since it automatically installs all packages the omd package depends on.
root@linux# gdebi omd-2013.08.27.mk_0.wheezy_amd64.deb
Since OMD requires two apache proxy modules, you will need to enable these afterwards:
root@linux# a2enmod proxy_http root@linux# /etc/init.d/apache2 restart
2.2. SLES 11
On SLES zypper is a convenient tool to install OMD and all the depending packages. If you need to install from DVDs, you must have the first SLES 11 DVD and also the first SLE 11 SDK DVD available. Also be careful to select the matching service pack of the DVDs and the OMD-package.
root@linux# zypper install omd-1.2.2p2.mk-sles11sp1-30.i586.rpm
2.3. RedHat and CentOS
On RedHat and CentOS you first need to install the epel repository. For CentOS 5 this can be done with the following command:
root@linux# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
To install the OMD package yum is the way to go.
root@linux# yum install --nogpgcheck omd-0.42-0.42-centos55.14.x86_64.rpm
3. Creating your first OMD site
OMD Sites are completely independent instances of OMD. You can have several sites on your OMD host, for example one for production use, one for configuration tests, and one for upgrade tests.
Creating your first OMD site is very easy. You just have to choose a site name, say prod. Then, as root user, you simply type
root@linux# omd create prod Adding /opt/omd/sites/prod/tmp to /etc/fstab. Restarting Apache...OK Creating temporary filesystem /omd/sites/prod/tmp...OK Created new site prod with version 2013.08.01.mmk. The site can be started with omd start prod. The default web UI is available at http://<yourhost>/prod/ The admin user for the web applications is omdadmin with password omd. Please do a su - prod for administration of this site.
A site user and group prod is created, as well as a home directory for the user in /omd/sites/prod. You should now switch to that user and start the site (even though sites can be started and maintained as the root user as well).
root@linux# su - prod user@host:~$ omd start Starting dedicated Apache for site prod...OK Starting Livestatus Proxy-Daemon...OK Starting rrdcached...OK Starting npcd...OK Starting nagios...OK Initializing Crontab...OK
Now you can already visit the Check_MK GUI of your site with your browser:
4. The omd-command
The omd command is used to create, start, stop and update sites, and to do many more things. omd can be executed as site user to modify just that site, or as root user. As the root user omd offers more option such as copying, renaming, disabling or uninstalling sites.
user@host:~$ omd Usage (called as site user): omd help Show general help omd version [SITE] Show version of OMD omd versions List installed OMD versions omd sites Show list of sites omd update Update site to other version of OMD omd start [SERVICE] Start services of one or all sites omd stop [SERVICE] Stop services of site(s) omd restart [SERVICE] Restart services of site(s) omd reload [SERVICE] Reload services of site(s) omd status [SERVICE] Show status of services of site(s) omd config ... Show and set site configuration parameters omd diff ([RELBASE]) Shows differences compared to the original version files omd umount Umount ramdisk volumes of site(s)
root@linux# omd Usage (called as root): omd help Show general help omd setup Prepare operating system for OMD (installs packages) omd uninstall Remove OMD and all sites! omd setversion VERSION Sets the default version of OMD which will be used by new sites omd version [SITE] Show version of OMD omd versions List installed OMD versions omd sites Show list of sites omd create SITE Create a new site (-u UID, -g GID) omd init SITE Populate site directory with default files and enable the site omd rm SITE Remove a site (and its data) omd disable SITE Disable a site (stop it, unmount tmpfs, remove Apache hook) omd enable SITE Enable a site (reenable a formerly disabled site) omd mv SITE NEWNAME Rename a site omd cp SITE NEWNAME Make a copy of a site omd update SITE Update site to other version of OMD omd start [SITE] [SERVICE] Start services of one or all sites omd stop [SITE] [SERVICE] Stop services of site(s) omd restart [SITE] [SERVICE] Restart services of site(s) omd reload [SITE] [SERVICE] Reload services of site(s) omd status [SITE] [SERVICE] Show status of services of site(s) omd config SITE ... Show and set site configuration parameters omd diff SITE ([RELBASE]) Shows differences compared to the original version files omd su SITE Run a shell as a site-user omd umount [SITE] Umount ramdisk volumes of site(s) General Options: -V <version> set specific version, useful in combination with update/create omd COMMAND -h, --help show available options of COMMAND
5. Configuring your site
To configure your site as a site user, you type:
user@host:~$ omd config
You get a simple graphical interface to the configuration options of your site.
5.2. Web GUI
5.4. Distributed Monitoring
6. Configuring the first host and checks
6.1. Installing the Check_MK Agent on your monitoring server
In order to do that you need to install the Check_MK Agent on the server, which is very easy. After verifying that you have installed xinetd, you can find agents for you linux distribution on the Check_MK Download Page, and simply install them with your package manager.
For a more detailed description of the installation process, see the article about Installing the Linux Agent.
6.2. Configuring your Host
To configure your first host, choose "Create New Host" in "Hosts & Folders" of the WATO Configuration Menu:
and enter the following information as marked (choose your own name for your monitoring server), and click on the Save & Go to Services button.
6.3. Configuring services on your host
At this point, I am sure you will notice the advantage of using Check_MK. Instead of configuring services for your hosts, by clicking the Save & Go to Services Button, Check_MK has automatically done an inventory of the services on your server already. As a result you see a list of the services found.
If you click on the Save Manual Check Configuration button, the services will be saved. After clicking Activate Changes at the left top of the page, a nagios configuration will be created, and Check_MK will regularly send the results to nagios.
From then, you can see the check results in the multisite GUI. That was easy, right ?