Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Nagios+Nrpe monitors other hosts

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article is about how Nagios+Nrpe monitors other hosts. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Monitor the running status of the machine and the Mysq host

Required package: nagios-plugins-2.1.1.tar.gz

Nrpe-2.15.tar.gz

Server side: server1.example.com 172.25.254.1

New monitoring terminal: server2.example.com 172.25.254.2

Experimental premise:

/ etc/init.d/httpd start

/ etc/init.d/nagios start

/ etc/init.d/mysqld start## if the transformation cannot be enabled, cd / var/lib/mysql/, and then rm-rf mysql.sock starts again

Chkconfig httpd on

Chkconfig mysqld on

The browser logs in to 172.25.38.6/nagios to check the service status.

1. New monitor configuration (server2)

1.1 .tar zxf nrpe-2.15.tar.gz

Tar zxf nagios-plugins-2.1.1.tar.gz # nagios plug-in installation

Cd nagios-plugins-2.1.1

Yum install gcc-y openssl-devel mysql-devel

Useradd-M-d / usr/local/nagios nagios # # id number is not required to be 900, because it is set on the server, so it is better to be unified.

1.2. / configure-with-nagios-user=nagios-with-nagios-group=nagios

Make

Make install

1.3 chown nagios.nagios / usr/local/nagios

Chown-R nagios.nagios / usr/local/nagios/libexec

Yum install xinetd

1.4 cd nrpe-2.15

. / configure

Make all

Make install-plugin

Make install-daemon

Make install-daemon-config

Make install-xinetd

Cd / etc/xinetd.d/

1.5 vim nrpe

# nrpe service listening port

1.6 vim / etc/services

Join

1.7 cd.. / etc/

Vim nrpe.cfg

# Root zone monitoring

/ etc/init.d/xinetd start

1.8 cd / usr/local/nagios/libexec/

Scp check_nrpe root@172.25.254.1:/usr/local/nagios/libexec/

two。 Server-side configuration (server1)

2.1 [root@server1 libexec] # ll check_nrpe

-rwxr-xr-x 1 root root 76769 Jul 23 10:02 check_nrpe

[root@server1 libexec] # chown nagios:nagios check_nrpe## change script permissions to all nagios

[root@server1 libexec] # ll check_nrpe

-rwxr-xr-x 1 nagios nagios 76769 Jul 23 10:02 check_nrpe

2.2 [root@server1 libexec] #. / check_nrpe-H 172.25.254.2-c check_disk## execute script

DISK OK-free space: / 5333 MB (83% inode=92%); | / = 1086MBmit.5410

[root@server1 libexec] #. / check_nrpe-H 172.25.254.2-c check_load## execute script

OK-load average: 0.00,0.00,0.00 | load1=0.000;15.000;30.000;0; load5=0.000;10.000;25.000;0; load15=0.000;5.000;20.000;0

2.3 cd / usr/local/nagios/etc/objects/

Vim commands.cfg

*

218 # 'check_nrpe' command definition

219 define command {

220 command_name check_nrpe

221 command_line $USER1 $/ check_nrpe-H $HOSTADDRESS$-c $ARG1 $

two hundred and twenty two

}

*

Vim services.cfg

*

117 # check_nrpe##

118 define service {

119 use local-service

120 host_name server2.example.com

121 service_description Root Partition

122 check_command check_nrpe!check_disk

123}

one hundred and twenty four

one hundred and twenty five

126 define service {

127 use local-service

128 host_name server2.example.com

129 service_description logged in users

130 check_command check_nrpe!check_users

131}

*

Vim hosts.cfg

* define host {

Use linux-server

Host_name server2.example.com

Alias server2

Address 172.25.254.2

Icon_p_w_picpath switch.gif

Statusmap_p_w_picpath switch.gd2

2d_coords 400100

3d_coords 400200100

}

*

2.4 / etc/init.d/nagios reload

Browser refresh access:

Thank you for reading! This is the end of this article on "how Nagios+Nrpe monitors other hosts". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report