Nagios4.3.1 Monitoring Centos6.7

Source: Internet
Author: User
Tags install openssl

Previous Nagios monitors the installation process that has been written to Nagios in Windows and is no longer duplicated here.



Detection of Linux based on Npre

Install Nrpe on a Linux host and let the server Check_nrpe communicate with Nrpe via port 5666

NRPE (Nagios Remote Plugin Executor) is the daemon that runs the instrumentation command on the remote server, which allows the Nagios monitoring side to trigger the detection command on the remote host based on the installation and outputs the test results to the monitoring side. And the execution of the overhead is much lower than the SSH-based detection method, and the detection process and the need for the remote host system account information, and its schedule is higher than the SSH detection mode

Pre-Installation Preparation
Adjust system time
Download nagios-plugins-2.2.1.tar.gz
https://www.nagios.org/downloads/nagios-plugins/
Download nrpe-3.1.0.tar.gz

=============================================================
Configuring the monitored end Nagios Client

1. Installing the Nrpe and Nagios plugins
[email protected] ~]# yum install OpenSSL openssl-devel xinetd gcc make

[Email protected] ~]# Useradd Nagios
[Email protected] ~]# tar xvf nagios-plugins-2.2.1.tar.gz
[Email protected] ~]# CD nagios-plugins-2.2.1
[[email protected] nagios-plugins-2.2.1]#./configure && make && make install

[Email protected] ~]# tar xvf nrpe-2.13.tar.gz
[Email protected] ~]# CD nrpe-2.13
[[email protected] nrpe-2.13]#./configure && make && make install
[email protected] nrpe-2.13]# make Install-daemon-config
[email protected] nrpe-2.13]# make install-xinetd
[Email protected] nrpe-2.13]# Vim/etc/xinetd.d/nrpe
# Default:on
# Description:nrpe (Nagios Remote Plugin Executor)
Service Nrpe
{
Flags = Reuse
Socket_type = Stream
Port = 5666
wait = no
user = Nagios
Group = Nagios
Server =/usr/local/nagios/bin/nrpe
Server_args =-c/usr/local/nagios/etc/nrpe.cfg--inetd
Log_on_failure + = USERID
Disable = no
Only_from = 127.0.0.1 10.200.1.23//10.200.1.23 is the Nagios Monitoring Center address #而且中间必须是空格
}
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/99/B2/wKiom1lLX1jBE5GnAABJ23cdj8A115.jpg "title=" Nrep content. jpg "alt=" wkiom1llx1jbe5gnaabj23cdj8a115.jpg "/>[[email protected] nrpe-2.12]# vim/etc/services
Nrpe 5666/tcp # Nrpe//Add this line
[Email protected] nrpe-2.13]# service xinetd restart
[Email protected] nrpe-2.13]# chkconfig xinetd on #添加开机自启动
[Email protected] nrpe-2.13]# chkconfig--list xinetd #查看2345是否on

[Email protected] nrpe-2.13]# NETSTAT-TUNPL | grep 5666
TCP 0 0::: 5666:::* LISTEN 2818/xinetd
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/99/B2/wKioL1lLXvLzJXD5AAAZG5claE4175.jpg "title=" View 5666-port. jpg "alt=" wkiol1llxvlzjxd5aaazg5clae4175.jpg "/>
2. Configure monitoring of local private resources
[Email protected] nrpe-2.12]# vim/usr/local/nagios/etc/nrpe.cfg
Command[check_users]=/usr/local/nagios/libexec/check_users-w 5-c 10
Command[check_load]=/usr/local/nagios/libexec/check_load-w 15,10,5-c 30,25,20
Command[check_root]=/usr/local/nagios/libexec/check_disk-w 20%-C 10%-p/dev/mapper/vg01-lv_root
Command[check_home]=/usr/local/nagios/libexec/check_disk-w 20%-C 10%-p/dev/mapper/vg01-lv_home
Command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs-w 5-c 10-s Z
Command[check_total_procs]=/usr/local/nagios/libexec/check_procs-w 150-C 200
Command[check_swap]=/usr/local/nagios/libexec/check_swap-w 50%-C 40%
[Email protected] ~]# service xinetd restart

Open port 5666 and restart firewall
[Email protected]/]# Vim/etc/sysconfig/iptables
-A input-m state--state new-m tcp-p TCP--dport 5666-j ACCEPT
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/99/B9/wKioL1lLhfqwO-IFAABqgtLbHfc701.jpg "title=" 5666-port. jpg "alt=" wkiol1llhfqwo-ifaabqgtlbhfc701.jpg "/>

[Email protected]/]# service iptables restart

[[email protected] ~]# NETSTAT-TNLP View listening port 5666 has already turned on the XINETD service

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/99/B9/wKiom1lLhoTzW4wVAACOqQ4ycy0580.jpg "title=" 5666-Port xinetd service. jpg "alt=" wkiom1llhotzw4wvaacoqq4ycy0580.jpg "/>


========================================================
Configuring Monitoring Center Nagios Server
1. Install the Nrpe plug-in and test
[[Email protected] ~# tar xvf nrpe-2.13.tar.gz//Only need Check_nrpe plug-in
[[email protected] nrpe-2.13]#./configure && make all && make install
[Email protected] ~]#/usr/local/nagios/libexec/check_nrpe-h 10.200.1.24
NRPE v2.13


Defining hosts and defining services
[Email protected] local]# cd/etc/nagios/
Edit Nagiios.cfg
Add Cfg_file=/etc/nagios/objects/centos6.cfg Save after exit
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/99/B9/wKiom1lLii3DsYr_AACasnT4rNM249.jpg "title=" Qq20170622171255.jpg "alt=" wkiom1llii3dsyr_aacasnt4rnm249.jpg "/> Switch to [[email protected] nagios]# CD objects/
[Email protected] objects]# vim cnetos6.cfg #新增centos6. cfg file
Fill in the content:
# Define A host for the Local machine

Define Host{
Use Linux-server
HOST_NAME CENTOS6 #监控端显示名称
Alias web-10.200.1.24
Address 10.200.1.24 #被监控端IP
}

# Define a service to check the disk space of the root partition
# on the local machine. Warning If < 20% free, critical if
# < 10% free space on partition.
Define Service{
Use Local-service
HOST_NAME CENTOS6
Service_description Root Partition
Check_command Check_nrpe!check_root
}

# Define a service to check the swap usage of the local machine.
# Critical if less than 10% of swap are free, warning if less than 20% are free
Define Service{
Use Local-service
HOST_NAME CENTOS6
Service_description Swap Usage
Check_command Check_nrpe!check_swap
}

# Define a service to check the number of currently running procs
# on the local machine. Warning if > processes, critical if
# > users.
Define Service{
Use Local-service
HOST_NAME CENTOS6
Service_description Total Processes
Check_command Check_nrpe!check_total_procs
}

#保存后退出

/usr/local/nagios/bin/nagios-v/etc/nagios/nagios.cfg #可验证语法是否错误


Restart Nagios service after test pass

#service Nagios Restart

650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/99/BA/wKioL1lLkJ6w8JOkAAA4KKzF4rY651.jpg "title=" Qq20170622174031.jpg "alt=" Wkiol1llkj6w8jokaaa4kkzf4ry651.jpg "/>


Under/usr/local/nagios/libexec, use the Cher_nrpe-h 10.200.1.24 Test link to display a version number indicating that the link is ok

650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/99/BB/wKioL1lLlV6RuZ7NAAAhXViLuI8144.jpg "title=" Qq20170622175847.jpg "alt=" Wkiol1lllv6ruz7naaahxvilui8144.jpg "/>



Restart complete Open the Monitoring Web interface, you can see that CENTOS6 is already in the monitoring list

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/99/BA/wKiom1lLkSfRPKqGAAKFP1YOA_I839.jpg-wh_500x0-wm_ 3-wmp_4-s_3608943419.jpg "title=" qq20170622174221.jpg "alt=" Wkiom1llksfrpkqgaakfp1yoa_i839.jpg-wh_50 "/>




This article is from the "CENTOS6 use Xtrabackup" blog, be sure to keep this source http://9052426.blog.51cto.com/9042426/1941052

Nagios4.3.1 Monitoring Centos6.7

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.