Preparations before installation:
1. I have already installed icinga and used mysql. check_mk to require that the full-featured Nagios be installed in advance. It seems that I am already full-featured. Now icinga is running normally.
2. Check whether the external command is normal. Open the web page, log on, check the ping service of localhost, and click the drop-down box in the upper right corner:
Click the submit button and perform subsequent operations. Then return to the page and find that the ping service is disabled.
So external command works normally.
3. Check python. Ubuntu server has been installed, which is just version 2.x.
python --versionPython 2.7.3
4. xinetd was installed before NSCA was installed.
Start installation:
1. Download
root@icinga:/opt# wget http://mathias-kettner.com/download/check_mk-1.2.2p1.tar.gz
2. decompress:
tar zxvf check_mk-1.2.2p1.tar.gz
3. Run the./setup. Sh program and enter the interactive installation process. The default value is generally used. The following are my default options:
You have chosen the following directories: Executable programs /usr/bin Check_MK configuration /etc/check_mk Check_MK software /usr/share/check_mk documentation /usr/share/doc/check_mk check manuals /usr/share/doc/check_mk/checks working directory of check_mk /var/lib/check_mk extensions for agents /usr/lib/check_mk_agent configuration dir for agents /etc/check_mk Name of Nagios user icinga User of Apache process www-data Common group of Nagios+Apache icinga-cmd Nagios binary /usr/local/icinga/bin/icinga Nagios main configuration file /usr/local/icinga/etc/icinga.cfg Nagios object directory /usr/local/icinga/etc/conf.d Nagios startskript /etc/init.d/icinga Nagios command pipe /usr/local/icinga/var/rw/icinga.cmd Check results directory /usr/local/icinga/var/spool/checkresults Nagios status file /usr/local/icinga/var/status.dat Path to check_icmp /usr/lib/nagios/plugins/check_icmp URL Prefix for Web addons / Apache config dir /etc/apache2/conf.d HTTP authentication file /usr/local/icinga/etc/htpasswd.users HTTP AuthName Icinga Access PNP4Nagios templates /usr/share/check_mk/pnp-templates compile livestatus module yes check_mk's binary modules /usr/lib/check_mk Unix socket for Livestatus /usr/local/icinga/var/rw/live Backends for other systems /usr/share/check_mk/livestatus Install Event Console no
This information already exists ~ /. Check_mk_setup.conf file. If you want to reinstall the file, you can delete the file first.
4. Restart The apache2 and icinga services and open the webpage: http: // 10.112.18.111/check_mk.
See the error message:
Check_mk: Incomplete Apache2 InstallationYou need mod_python in order to run the web interface of check_mk.Please install mod_python and restart Apache.
Now we will install the mod_python module of apache2.
apt-get install libapache2-mod-python
Restart apache2.
Now we can see the page, but there are two errors:
5. Install the agent for local monitoring regardless of the preceding error.
wget http://mathias-kettner.com/download/check-mk-agent_1.2.2p1-2_all.deb
dpkg -i check-mk-agent_1.2.2p1-2_all.deb Selecting previously unselected package check-mk-agent.(Reading database ... 65470 files and directories currently installed.)Unpacking check-mk-agent (from check-mk-agent_1.2.2p1-2_all.deb) ...Setting up check-mk-agent (1.2.2p1-2) ...Reloading xinetd...
6. Modify the host list of the monitor and edit the/etc/check_mk/Main. mk file. The content is as follows:
# Put your host names hereall_hosts = [ 'localhost' ]
7. Check that check_mk will read all hosts and perform detection. 11 detection services are created below.
cmk -Icpu.loads 1 new checkscpu.threads 1 new checksdf 2 new checksdiskstat 1 new checkskernel 3 new checkskernel.util 1 new checkslnx_if 1 new checksmem.used 1 new checksmounts 2 new checkstcp_conn_stats 1 new checksuptime 1 new checks
8. Then, use check_mk-O to automatically modify the configuration file of icinga:
check_mk -OGenerating Nagios configuration...OKValidating Nagios configuration...ERROR:Icinga 1.9.0Copyright (c) 2009-2013 Icinga Development Team (http://www.icinga.org)Copyright (c) 2009-2013 Nagios Core Development Team and Community ContributorsCopyright (c) 1999-2009 Ethan GalstadLast Modified: 05-07-2013License: GPLReading configuration data... Read main config file okay...Processing object config directory '/usr/local/icinga/etc/conf.d'...Processing object config file '/usr/local/icinga/etc/conf.d/check_mk_objects.cfg'...Processing object config file '/usr/local/icinga/etc/conf.d/check_mk_templates.cfg'...Processing object config file '/usr/local/icinga/etc/objects/commands.cfg'...Processing object config file '/usr/local/icinga/etc/objects/contacts.cfg'...Processing object config file '/usr/local/icinga/etc/objects/timeperiods.cfg'...Processing object config file '/usr/local/icinga/etc/objects/templates.cfg'...Processing object config file '/usr/local/icinga/etc/objects/localhost.cfg'...Warning: Duplicate definition found for host 'localhost' (config file '/usr/local/icinga/etc/objects/localhost.cfg', starting on line 23)Error: Could not add object property in file '/usr/local/icinga/etc/objects/localhost.cfg' on line 27. 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 are upgrading from a previous version of Icinga, you should be aware that some variables/definitions may have been removed or modified in this version. Make sure to read the HTML documentation regarding the config files, as well as the 'Whats New' section and the Changelog CHANGES section as well to find out what has changed.Nagios configuration is invalid. Rolling back.
An error is reported. Because icinga has localhost configuration by default. The simplest solution is to comment out the host definition of localhost in the following file.
/usr/local/icinga/etc/objects/localhost.cfg
#define host{ # use linux-server ; Name of host template to use # ; This host definition will inherit all variables that are defined # ; in (or inherited by) the linux-server host template definition. # host_name localhost # alias localhost # address 127.0.0.1 # }
Run check_mk-o again.
root@icinga:/etc/check_mk# check_mk -OGenerating Nagios configuration...OKValidating Nagios configuration...OKPrecompiling host checks...OKReloading Nagios...OK