How to Use the Nagios remote execution plug-in (NRPE) to detect server memory usage

Source: Internet
Author: User

How to Use the Nagios remote execution plug-in (NRPE) to detect server memory usage

In the previous tutorial (), we have seen how to set the Nagios remote execution plug-in (NRPE) in Nagios settings ). However, the scripts and plug-ins that monitor memory usage are not in native Nagios. In this article, we will see how to configure NRPE to monitor the memory usage on the remote server.

The memory monitoring script we use is available in the Nagios market and can be found in the Creator's Github repository.

Assuming that NRPE has been installed, we first download the script on the server we want to monitor.

Network Monitor Nagios Overview

Nagios construction and Configuration

Build a Nagios monitoring platform in the Nginx Environment

Configure the basic Nagios System on RHEL5.3 (using Nagios-3.1.2)

CentOS 5.5 + Nginx + Nagios monitoring and control terminal installation and Configuration Guide

Install Nagios Core for Ubuntu 13.10 Server

Prepare the remote server in Debain/Ubuntu:
  1. # Cd/usr/lib/nagios/plugins/
  2. # Wget https://raw.githubusercontent.com/justintime/nagios-plugins/master/check_mem/check_mem.pl
  3. # Mv check_mem.pl check_mem
  4. # Chmod + x check_mem
In RHEL/CentOS:
  1. # Cd/usr/lib64/nagios/plugins/(or/usr/lib/nagios/plugins/for 32-bit)
  2. # Wget https://raw.githubusercontent.com/justintime/nagios-plugins/master/check_mem/check_mem.pl
  3. # Mv check_mem.pl check_mem
  4. # Chmod + x check_mem

You can manually run the following command locally to check whether the Script output is normal. When NRPE is used, this command should detect idle memory. When the available memory is less than 20%, a warning will be issued and a severe warning will be generated when the available memory is less than 10%.

  1. #./Check_mem-f-w 20-c 10
  1. OK-34.0% (2735744 kB) free. | TOTAL = 801000040kb; USED = 5299596KB; 6428272; 7231806; FREE = 2735744KB; CACHES = 2703504KB ;;;;

If you see the output as above, it means the command works normally.

Now that the script is ready, we need to define the NRPE command to check the memory usage. As described above, the command checks available memory, generates an alarm when the availability is less than 20%, and generates a severe warning when the availability is less than 10%.

  1. # Vim/etc/nagios/nrpe. cfg
For Debian/Ubuntu:
  1. Command [check_mem] =/usr/lib/nagios/plugins/check_mem-f-w 20-c 10
For RHEL/CentOS 32 bit:
  1. Command [check_mem] =/usr/lib/nagios/plugins/check_mem-f-w 20-c 10
For RHEL/CentOS 64 bit:
  1. Command [check_mem] =/usr/lib64/nagios/plugins/check_mem-f-w 20-c 10

 

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.