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 to install Nagios client

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article is to share with you about how to install the Nagios client, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

(installed on the monitored machine)

New users and groups

Useradd nagios

Groupadd nagcmd

(if no c compiler is reported in the installation, yum install gcc)

Download the nagios plug-in

Wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz

Tar xzvf nagios-plugins-1.4.15.tar.gz

Cd nagios-plugins-1.4.15

. / configure

Make

Make install

Install nagios_nrpe_2.9

Wget http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.9/nrpe-2.9.tar.gz

Tar xzvf nrpe-2.9.tar.gz

Cd nrpe-2.9

. / configure-with-command-group=nagcmd-prefix=/usr/local/nagios

(if missing ssl is reported, please install yum install openssl-devel)

Make all

Make install-plugin

Make install-daemon

Make install-daemon-config

Set server address

Vi / usr/local/nagios/etc/nrpe.cfg

Find allowed_hosts=127.0.0.1.

Add the IP of the nagios server, separated by ",", and then add the following:

Allowed_hosts=127.0.0.1192.168.8.208

Start nrpe

Cd / usr/local/nagios/bin/

. / nrpe-c / usr/local/nagios/etc/nrpe.cfg-d

Check whether port 5666 has been listening. If there is no listening, it is not started.

Netstat-an | grep 5666

Verify the installation result

/ usr/local/nagios/libexec/check_nrpe-H localhost

If nrpe version number is returned, it is normal.

Configure monitoring object

Because of the monitoring principle, it is known that the monitored end does monitoring and then transmits it to the monitoring server for summary, setting the monitoring detailed parameters is mainly to set the nrpe.cfg file of the monitored side, and you can see the monitoring objects inside.

Vi / usr/local/nagios/etc/nrpe.cfg

Add one line after command [check _ total_procs] = / usr/local/nagios/libexec/check_procs-w 150-c 200

Commanded [check _ swap] = / usr/local/nagios/libexec/check_swap-w 20%-c 10%

The nagios server wants to monitor the client swap partition, but the client file nrpe.cfg file has no swap monitoring object, so the monitoring server reports an error (NRPE commond 'check_swap' no defined)

Restart nrpe

Stop nrpe first

[root@localhost bin] # cat / var/run/nrpe.pid

25316

[root@localhost bin] # kill 25316

After start

[root@localhost bin] # / usr/local/nagios/bin/nrpe-c / usr/local/nagios/etc/nrpe.cfg-d

Netstat-an | grep 5666

Set up automatic start

Vi / etc/rc.local adds this line to it:

/ usr/local/nagios/bin/nrpe-c / usr/local/nagios/etc/nrpe.cfg-d

The setting of the monitored side is complete.

Check settin

/ usr/local/nagios/libexec/check_nrpe-H localhost-c check_swap (you can check any of them

The above is how to install the Nagios client. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

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

Servers

Wechat

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

12
Report