A German Nagios plugin---check_mk build

Source: Internet
Author: User

After two weeks of research and testing, the CHECK_MK touch 40% degrees, here a simple summary and share to everyone, there may be problems, please give us a lot of advice.


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7A/12/wKioL1ah7G-RsLRTAAAToeKzZOM882.png "title=" aa.png "Style=" float:right; "alt=" Wkiol1ah7g-rslrtaaatoekzzom882.png "/>

CHECK_MK installation



The 1th Chapter CHECK_MK Introduction




CHECK_MK is a general-purpose Nagios/icinga Data acquisition plug-in, consisting mainly of three sub-projects. It takes a new approach to collecting data from operating systems and network components and eliminating old-fashioned Nrpe, check_by_ssh, Nsclient, and Check_snmp. Its advantages are the ability to automatically detect monitoring items on the host and significantly reduce CPU usage on the monitor side. It follows CPL V2, is open source free software


2nd Chapter Working principle


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7A/12/wKioL1ah653x2qPsAAEEcGEMO-8681.png "title=" version. png "Style=" Float:none; "alt=" Wkiol1ah653x2qpsaaeecgemo-8681.png "/>


l Nagios each time an activity check is triggered for each check-in interval of the host being monitored. This proactive check will trigger the CHECK_MK plugin.

l CHECK_MK Connect to the destination host via TCP. The check_mk_agent on the target host retrieves all relevant data about the host and returns it as ASCII text to the server side (such a pattern is similar to Zabbix).

l CHECK_MK extract Performanca data directly back to RRD.

l CHECK_MK extracts the relevant data, compares the set of warning/critical thresholds, and then returns the check results of this host through Nagios's passive service check.

l because the CHECK_MK figure is more dazzling and its monitoring host is more convenient, similar to the cacti can be directly in the Web page to add, personally feel very good, first on some of my configuration completed the CHECK_MK monitoring diagram.


650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/7A/13/wKiom1ah7f-ikKtnAARnUj-9SXU609.png "title=" 2.png " Width= "650" height= "357" border= "0" hspace= "0" vspace= "0" style= "WIDTH:650PX;HEIGHT:357PX;" alt= " Wkiom1ah7f-ikktnaarnuj-9sxu609.png "/>


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7A/13/wKiom1ah61qD0Nq7AAZZ7IlURyM206.png "title=" 6.png " Width= "650" height= "355" border= "0" hspace= "0" vspace= "0" style= "width:650px;height:355px;" alt= " Wkiom1ah61qd0nq7aazz7ilurym206.png "/>


650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/7A/13/wKiom1ah60ex4_kCAAPutG8tO4c395.png "title=" 5.png " Width= "650" height= "359" border= "0" hspace= "0" vspace= "0" style= "WIDTH:650PX;HEIGHT:359PX;" alt= "wkiom1ah60ex4_ Kcaaputg8to4c395.png "/>




The 3rd chapter begins the installation of CHECK_MK


Nagios, did you install it?

Since CHECK_MK is Nagios's plugin, Nagios must be loaded, and there's not much to say about Nagios's installation.

If you see that your nagios is not yet installed, please stop and prepare for the Nagios environment, click to jump to Nagios installation tutorial (David_tang The old man wrote it in detail).

Well , I believe you have a nagios running now, so let's start installing CHECK_MK.



1, prepare the environment


BecauseCheck_mkis byPythonLanguage, so you have to preparepython  python2.3  python3 so make sure your   python  version, I built 2.6.6  version above, cause follow-up will know;

In addition , CHECK_MK needs to be run as a non-independent daemon, so install the Super Daemon xinetd.
Also, install Pnp4nagios,rrdtool(if the previous Nagios is already installed, you do not have to install it)


2. Download and install CHECK_MK

Cd/tmp/wget Http://mathias-kettner.com/download/check_mk-1.2.4p5.tar.gztar ZXVFP check_mk-1.2.4p5.tar.gzcd check_ mk-1.2.4./setup.sh

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/7A/13/wKiom1ah61uCNl1lAABIcvsHQsI920.png "style=" float: none; "title=" Installation process 1 "alt=" Wkiom1ah61ucnl1laabicvshqsi920.png "/>


650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7A/13/wKiom1ah61ujTHYiAACHa8sLRyQ941.png "style=" float: none; "title=" Installation process 2 "alt=" Wkiom1ah61ujthyiaacha8slryq941.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/7A/13/wKiom1ah612Q_eUmAAAdQbIAKP4173.png "title=" 11.png "Style=" Float:none; "alt=" Wkiom1ah612q_eumaaadqbiakp4173.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7A/13/wKiom1ah613SKRTNAACipBhVNFk839.png "style=" float: none; "Title=" ends the installation of "alt=" Wkiom1ah613skrtnaacipbhvnfk839.png "/>


The above I configured is not the default path, so you will see many paths are/usr/local/

In fact, the default path is not the case, I would like to let you use the default path

In fact, the above operation, all the way to meet the yes hit Yes, hit No on the line

Also tell a little secret:

In fact, when you execute the script setup.sh, it reads/root/.check_mk_setup.conf It's a hidden file,

If you think your path is not selected and want to re-select, then delete /root/.check_mk_setup.conf or modify the path directly inside , then you can re-execute the setup.sh .

when you're ready, restart HTTP and Nagios , and log in to http://ip address /check_mk to access it.






Common error:


Question 1:

650) this.width=650; "src=" http://s1.51cto.com/wyfs02/M01/7A/15/wKiom1ah9U_gdSWmAABMXRetEsM971.png "title=" HTTP Error "alt=" Wkiom1ah9u_gdswmaabmxretesm971.png "/>

Workaround:

Close SELinux can be

SELinux ( Security-enhanced Linux) Force mode is used by default after installation. This will cause an " internal Service error " when you try to get into Nagios 's CGI message.

if it is SELinux required when in mandatory security mode

Getenforce make SELinux in tolerated mode

Setenforce 0

if you want to permanently notconsistent it, you need to change /etc/selinux/config settings and restart the system.

do not close SELinux or permanently change the way it is to let CGI module in SELinux under Specify mandatory target mode:

Chcon-r-T httpd_sys_content_t/usr/local/nagios/sbin/

Chcon-r-T Httpd_sys_content_t/usr/local/nagios/share/



Question 2:


Visit page times wrong:

(The following error can only be displayed by Google Chrome, IE does not seem to have such a detailed error, only the hint is not accessible) because the Python module is missing .

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7A/15/wKiom1ah9a3h1AY-AAAXxWZAsqU245.png "title=" Issue 2 Error "alt=" wkiom1ah9a3h1ay-aaaxxwzasqu245.png "/> Solution: (or to solve this: Yum install Mod_python)

#wgethttp://archive.apache.org/dist/httpd/modpython/mod_python-3.3.1.tgz
#tar ZXVF mod_python-3.3.1.gz
#cd mod_python-3.3.1

#./configure--with-apxs=/usr/local/apache/bin/apxs--with-python=/usr/bin/python
#make
Apxs:Error:Command Failedwith rc=65536
MAKE[1]: * * * [Mod_python.so]error 1
MAKE[1]: Leaving directory '/ROOT/NDO/SRC/MOD_PYTHON-3.3.1/SRC '
Make: * * * [DO_DSO] Error 2
reason isApacheThe version is too highMod_pythonnot supported
#vim src/connobject.c
put! (b = = Apr_brigade_sentinel (b) | |instead! (b = = Apr_brigade_sentinel (bb) | |
#make Clean
#make
#make Install
in thehttpd.confIncrease in
LoadModule python_modulemodules/mod_python.so
RestartApache,re-access normal



Question 3:


The following occurs when you log on:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7A/15/wKiom1ah9i2QCi9rAAHfhG6zSDs852.png "title=" Aweg.png "alt=" Wkiom1ah9i2qci9raahfhg6zsds852.png "/>

Reasons and Solutions: Permission issues, according to the prompt to modify it, in my personal experience, if there are a large number of permissions problem error, it is recommended to reconfigure the installation, because you install the destruction of some of its structural things, even if you go to the one to get permission to do, In the future configuration process will still appear some headache errors, if your python Learning is very general, the default path to install! Unless you want to find yourself in trouble.


Question 4:

Missing items after login page


Abnormal diagram, is also the normal user login view after the image, Super Administrator login view


650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/7A/15/wKiom1ah9qzgIcQFAAAWUNSTD0A966.png "style=" float: Left; "title=" abnormal "alt=" wkiom1ah9qzgicqfaaawunstd0a966.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7A/14/wKioL1ah9uuCVCwPAABBR7zOs-I523.png "style=" float: right; "title=" normal "alt=" Wkiol1ah9uucvcwpaabbr7zos-i523.png "/>






The reason is that the user who is accessing is not a superuser, and it says no permissions. This is directly related to your creation of the Nagios Web login user name.

Workaround:

To Modify a configuration file: multisite.mk

Default path: /ETC/CHECK_MK/ETC/CHECK_MK

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7A/15/wKiom1ah9zfy8tiDAAAOufzXQ_Y117.png "title=" Rvad.png "alt=" Wkiom1ah9zfy8tidaaaoufzxq_y117.png "/>

Place the red box in the Nagiosadmin instead Nagios Web login user name, because Nagios the default Web the login user name is Nagiosadmin , so be sure to change it here! In short, this username must be consistent with Nagios 's Web user name.


Question 5:


Execution setup.sh times wrong:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/7A/15/wKiom1ah95Lzina-AAAKr2fUNLw455.png "title=" Weg.png "alt=" Wkiom1ah95lzina-aaakr2funlw455.png "/>


by reading the installation log:Livestatus.log learned that it was compile and install the times wrong, the error is not intercepted

Workaround : installation gcc-* libgcc-* can be


Question 6:


The most common problem :

CHECK_MK not send out the alarm message, one of the common reason is Python version low Python 2.6.6 can be sent and 2.6.5 but not out.

detailed solutions for sending out alarm messages I've already put it on the Internet. , then write it down in detail later.

Please refer to http://www.cnyunwei.com/thread-22737-1-1.html



This article from "Deciduous" blog, reproduced please contact the author!

A German Nagios plugin---check_mk build

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.