centos7_check_mk
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | centos7_check_mk [2021/10/09 15:14] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | ..\\ | ||
+ | ..\\ | ||
+ | ..\\ | ||
+ | **If you found this page via Google, I would recommend to use [[check_mk_raw_centos]] instead. Using the 1.4 stable branch.**\\ | ||
+ | ..\\ | ||
+ | ..\\ | ||
+ | ..\\ | ||
+ | |||
+ | |||
+ | |||
+ | ====== Check_MK monitoring (from source) - CentOS7 ====== | ||
+ | Use this guide to install the latest version of Check_MK and Nagios. | ||
+ | |||
+ | Prerequisites | ||
+ | * EPEL repository | ||
+ | * Disable SELinux. Normally i would let SELinux be enabled, but with a monitoring system it is one of the few exceptions I make. This service does too many things SELinux doesn' | ||
+ | |||
+ | ====Install packages==== | ||
+ | * Install rrdtool: < | ||
+ | * Install development tools: < | ||
+ | * Install apache & php. < | ||
+ | * Install other requirements. < | ||
+ | ====Install Nagios 4==== | ||
+ | * Create user and group.< | ||
+ | groupadd nagcmd | ||
+ | usermod -a -G nagcmd nagios | ||
+ | usermod -G nagcmd apache</ | ||
+ | * Download latest version. | ||
+ | * Extract. < | ||
+ | * Compile Nagios 4. < | ||
+ | ./configure --with-command-group=nagcmd --prefix=/ | ||
+ | make all | ||
+ | make install | ||
+ | make install-init | ||
+ | make install-config | ||
+ | make install-commandmode | ||
+ | make install-webconf | ||
+ | cp -R contrib/ | ||
+ | chown -R nagios: | ||
+ | * Test and start Nagios, it still uses legacy init:< | ||
+ | service nagios start</ | ||
+ | * Edit **/ | ||
+ | * Add a default user for Web Interface Access < | ||
+ | * Download latest Nagios plugins. | ||
+ | * Install Nagios Plugins: < | ||
+ | tar zxvf nagios-plugins-2.0.3.tar.gz | ||
+ | cd / | ||
+ | ./configure --with-nagios-user=nagios --with-nagios-group=nagios --prefix=/ | ||
+ | make | ||
+ | make install</ | ||
+ | ====Configure services and firewall==== | ||
+ | * Service setup. < | ||
+ | chkconfig --level 35 nagios on | ||
+ | systemctl enable httpd</ | ||
+ | * Open port 80 / 443: < | ||
+ | firewall-cmd --permanent --zone public --add-service=https | ||
+ | firewall-cmd --reload</ | ||
+ | * Give the Nagios localhost http check something. < | ||
+ | * Start Apache, restart Nagios, it should be running on your webserver /nagios < | ||
+ | systemctl start httpd</ | ||
+ | ====Install PNP4Nagios==== | ||
+ | * Download the latest PNP4nagios. | ||
+ | * Extract. < | ||
+ | * Compile.< | ||
+ | ./configure --prefix=/ | ||
+ | make all | ||
+ | make fullinstall</ | ||
+ | * Configure apache, edit **/ | ||
+ | * Restart apache. < | ||
+ | * Configure Nagios to use PNP4nagios. Edit **/ | ||
+ | # Bulk / NPCD mode | ||
+ | # | ||
+ | |||
+ | process_performance_data=1 | ||
+ | |||
+ | # *** the template definition differs from the one in the original nagios.cfg | ||
+ | # | ||
+ | service_perfdata_file=/ | ||
+ | service_perfdata_file_template=DATATYPE:: | ||
+ | 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=/ | ||
+ | host_perfdata_file_template=DATATYPE:: | ||
+ | host_perfdata_file_mode=a | ||
+ | host_perfdata_file_processing_interval=15 | ||
+ | host_perfdata_file_processing_command=process-host-perfdata-file</ | ||
+ | * Edit **/ | ||
+ | # Bulk mode | ||
+ | # | ||
+ | define command { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | define command { | ||
+ | | ||
+ | | ||
+ | }</ | ||
+ | |||
+ | * Remove install file. < | ||
+ | * Restart nagios. < | ||
+ | * Open /pnp4nagios on your webserver, it might take a while before data has been processed and images are shown. | ||
+ | |||
+ | ====Install Check_MK==== | ||
+ | * Install xinetd. < | ||
+ | service xinetd start | ||
+ | chkconfig xinetd on</ | ||
+ | * Download latest Check_MK version. | ||
+ | * Extract. < | ||
+ | * Compile. < | ||
+ | ./setup.sh | ||
+ | |||
+ | You have chosen the following directories: | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | check manuals | ||
+ | | ||
+ | | ||
+ | | ||
+ | Name of Nagios user | ||
+ | User of Apache process | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | Check results directory | ||
+ | | ||
+ | Path to check_icmp | ||
+ | URL Prefix for Web addons | ||
+ | | ||
+ | HTTP authentication file / | ||
+ | HTTP AuthName | ||
+ | | ||
+ | RRD files / | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | Unix socket for Livestatus | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Proceed with installation (y/n)? y | ||
+ | (Compiling MK Livestatus....................................................) | ||
+ | Installation completed successfully. | ||
+ | Please restart Nagios and Apache in order to update/ | ||
+ | |||
+ | You can access the new Multisite GUI at http:// | ||
+ | |||
+ | </ | ||
+ | ====mod_python==== | ||
+ | The current version (1.2.6x) of Check_MK still needs the old mod_python. | ||
+ | * Install development tools:< | ||
+ | * Download latest modpython source code. | ||
+ | * Extract:< | ||
+ | * Install:< | ||
+ | ./configure | ||
+ | make | ||
+ | make install | ||
+ | |||
+ | # Edit / | ||
+ | # Change version line to: version = " | ||
+ | vi / | ||
+ | * Configure and Apache:< | ||
+ | LoadModule python_module modules/ | ||
+ | |||
+ | systemctl restart httpd</ | ||
+ | ====Check_MK Config==== | ||
+ | * Enable and Start mkeventd:< | ||
+ | chkconfig --level 35 mkeventd on | ||
+ | service mkeventd start</ | ||
+ | * Install Check_MK client on host. < | ||
+ | |||
+ | cd check_mk-1.2.6p1 | ||
+ | mkdir agents | ||
+ | cd agents | ||
+ | tar zxvf ../ | ||
+ | |||
+ | mkdir / | ||
+ | cp check_mk_agent.linux / | ||
+ | |||
+ | cp xinetd.conf / | ||
+ | # Edit path and allowed hosts | ||
+ | # server | ||
+ | # only_from | ||
+ | vi / | ||
+ | |||
+ | systemctl enable xinetd | ||
+ | systemctl start xinetd | ||
+ | |||
+ | |||
+ | |||
+ | # Test agent | ||
+ | nc 127.0.0.1 6556 | ||
+ | |||
+ | </ | ||
+ | * Configure monitoring host in Check_MK itself, add host, IP-address 127.0.0.1. | ||
+ | * Remove localhost from **/ | ||
+ | ====Set rights to enable config ' | ||
+ | * Modify rights:< | ||
+ | chown -R nagios.nagcmd / | ||
+ | chown -R apache.nagcmd / | ||
+ | chgrp -R nagcmd / | ||
+ | chown -R apache.nagcmd / | ||
+ | |||
+ | chmod g+w / | ||
+ | chmod g+w / | ||
+ | chmod g+w / | ||
+ | ====Modify template==== | ||
+ | * Nagios warns about obsoleted feature, remove **failure_prediction_enabled** from template file **/ | ||
+ | ====Disable Nagios logging to syslog==== | ||
+ | * Edit **/ | ||
+ | * Restart nagios. < | ||
+ | |||
+ | |||
+ | ====Quick start agent setup==== | ||
+ | **Note: the EPEL version is older and might have some incompatibilities, | ||
+ | |||
+ | * Install check_mk agent via EPEL:< | ||
+ | vi / | ||
+ | |||
+ | firewall-cmd --permanent --zone trusted --add-service=checkmkagent | ||
+ | firewall-cmd --reload | ||
+ | |||
+ | systemctl enable xinetd | ||
+ | systemctl restart xinetd</ | ||
+ | |||
+ | ====Upgrade Check_MK==== | ||
+ | * Download latest tar.gz | ||
+ | * Extract | ||
+ | * Run ./setup.sh | ||
+ | * Restart nagios and apache | ||
+ | * Fix notifications (see above), after run cmk -O (captital o) | ||
+ | |||
+ | {{tag> | ||