..
..
..
If you found this page via Google, I would recommend to use check_mk_raw_centos instead. Using the 1.4 stable branch.
..
..
..
Use this guide to install the latest version of Check_MK and Nagios.
Prerequisites
yum install rrdtool perl-rrdtool
yum groupinstall development tools
yum install httpd php
yum install gd gd-devel php-gd openssl-devel net-snmp net-snmp-utils policycoreutils-python dejavu-fonts-common dejavu-sans-mono-fonts dejavu-lgc-sans-mono-fonts
useradd nagios groupadd nagcmd usermod -a -G nagcmd nagios usermod -G nagcmd apache
tar zxvf nagios-4.0.8.tar.gz
cd nagios-4.0.8 ./configure --with-command-group=nagcmd --prefix=/opt/nagios --exec-prefix=/opt/nagios make all make install make install-init make install-config make install-commandmode make install-webconf cp -R contrib/eventhandlers/ /opt/nagios/libexec/ chown -R nagios:nagios /opt/nagios/libexec/eventhandlers
/opt/nagios/bin/nagios -v /opt/nagios/etc/nagios.cfg service nagios start
$USER1$=/opt/nagios-plugins/libexec
htpasswd -c /opt/nagios/etc/htpasswd.users nagiosadmin
cd tar zxvf nagios-plugins-2.0.3.tar.gz cd /tmp/nagios-plugins-2.0.3 ./configure --with-nagios-user=nagios --with-nagios-group=nagios --prefix=/opt/nagios-plugins --exec-prefix=/opt/nagios-plugins make make install
chkconfig --add nagios chkconfig --level 35 nagios on systemctl enable httpd
firewall-cmd --permanent --zone public --add-service=http firewall-cmd --permanent --zone public --add-service=https firewall-cmd --reload
touch /var/www/html/index.html
service nagios restart systemctl start httpd
tar zxvf pnp4nagios.tgz
cd pnp4nagios-0.6.25 ./configure --prefix=/opt/pnp4nagios --exec-prefix=/opt/pnp4nagios make all make fullinstall
AuthUserFile /opt/nagios/etc/htpasswd.users
systemctl restart httpd
# # Bulk / NPCD mode # process_performance_data=1 # *** the template definition differs from the one in the original nagios.cfg # service_perfdata_file=/opt/pnp4nagios/var/service-perfdata service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$ service_perfdata_file_mode=a service_perfdata_file_processing_interval=15 service_perfdata_file_processing_command=process-service-perfdata-file # *** the template definition differs from the one in the original nagios.cfg # host_perfdata_file=/opt/pnp4nagios/var/host-perfdata host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$ host_perfdata_file_mode=a host_perfdata_file_processing_interval=15 host_perfdata_file_processing_command=process-host-perfdata-file
# # Bulk mode # define command { command_name process-service-perfdata-file command_line /opt/pnp4nagios/libexec/process_perfdata.pl --bulk /opt/pnp4nagios/var/service-perfdata } define command { command_name process-host-perfdata-file command_line /opt/pnp4nagios/libexec/process_perfdata.pl --bulk /opt/pnp4nagios/var/host-perfdata }
rm /opt/pnp4nagios/share/install.php
service nagios restart
yum install xinetd service xinetd start chkconfig xinetd on
tar zxvf check_mk-1.2.6p1.tar.gz
cd check_mk-1.2.6p1 ./setup.sh You have chosen the following directories: Executable programs /opt/check_mk/bin Check_MK configuration /opt/check_mk/etc Check_MK software /opt/check_mk/share documentation /opt/check_mk/share/doc check manuals /opt/check_mk/share/doc/check_mk/checks working directory of Check_MK /opt/check_mk/var/lib extensions for agents /usr/lib/check_mk_agent configuration dir for agents /etc/check_mk Name of Nagios user nagios User of Apache process apache Common group of Nagios+Apache nagcmd Nagios binary /opt/nagios/bin/nagios Nagios main configuration file /opt/nagios/etc/nagios.cfg Nagios object directory /opt/nagios/etc/check_mk.d Nagios startskript /etc/init.d/nagios Nagios command pipe /opt/nagios/var/rw/nagios.cmd Check results directory /opt/nagios/var/spool/checkresults Nagios status file /opt/nagios/var/status.dat Path to check_icmp /opt/nagios-plugins/libexec/check_icmp URL Prefix for Web addons / Apache config dir /etc/httpd/conf.modules.d HTTP authentication file /opt/nagios/etc/htpasswd.users HTTP AuthName Nagios Access PNP4Nagios templates /opt/pnp4nagios/share/templates RRD files /opt/pnp4nagios/var/perfdata rrdcached socket /tmp/rrdcached.sock compile livestatus module yes Nagios / Icinga version 4.0.8 check_mk's binary modules /opt/check_mk/lib Unix socket for Livestatus /opt/nagios/var/rw/live Backends for other systems /opt/check_mk/share/livestatus Install Event Console yes working directory of mkeventd /opt/mkeventd/lib Proceed with installation (y/n)? y (Compiling MK Livestatus....................................................) Installation completed successfully. Please restart Nagios and Apache in order to update/active check_mk's web pages. You can access the new Multisite GUI at http://localhost/check_mk/
The current version (1.2.6x) of Check_MK still needs the old mod_python.
yum install python-devel httpd-devel
tar zxvf mod_python-3.5.0.tgz
cd mod_python-3.5.0 ./configure make make install # Edit /usr/lib64/python2.7/site-packages/mod_python/version.py # Change version line to: version = "3.5.0" vi /usr/lib64/python2.7/site-packages/mod_python/version.py
# in /etc/httpd/conf.modules.d, create 00-python.conf with the following LoadModule line inside it LoadModule python_module modules/mod_python.so systemctl restart httpd
chkconfig --add mkeventd chkconfig --level 35 mkeventd on service mkeventd start
yum install xinetd cd check_mk-1.2.6p1 mkdir agents cd agents tar zxvf ../agents.tar.gz mkdir /opt/check_mk_agent cp check_mk_agent.linux /opt/check_mk_agent/bin/check_mk_agent cp xinetd.conf /etc/xinetd.d/check_mk_agent # Edit path and allowed hosts # server = /opt/check_mk_agent/bin/check_mk_agent # only_from = 127.0.0.1 vi /etc/xinetd.d/check_mk_agent systemctl enable xinetd systemctl start xinetd # Test agent nc 127.0.0.1 6556
/opt/check_mk/bin/cmk -R.
chown -R apache.nagcmd /opt/check_mk/etc chown -R nagios.nagcmd /opt/check_mk/var/lib/ chown -R apache.nagcmd /opt/check_mk/var/lib/wato chgrp -R nagcmd /opt/nagios/etc/ chown -R apache.nagcmd /opt/check_mk/var/lib/wato chmod g+w /opt/check_mk/etc chmod g+w /opt/check_mk/var/lib/ chmod g+w /opt/nagios/etc/
use_syslog=0
service nagios restart
Note: the EPEL version is older and might have some incompatibilities, you can also install the RPM provided with the Check_MK tar.gz
yum -y install check-mk-agent vi /etc/xinetd.d/check-mk-agent # change only_from firewall-cmd --permanent --zone trusted --add-service=checkmkagent firewall-cmd --reload systemctl enable xinetd systemctl restart xinetd