Nagios monitors the usage of Linux system resources and nagioslinux

Source: Internet
Author: User

Nagios monitors the usage of Linux system resources and nagioslinux

Application scenarios: both the test environment and the runtime environment require real-time monitoring programs to monitor the health status of the system (Linux Redhat). The monitoring requirements mainly include CPU, Memory, Disk IO, network usage.

The basic idea of Nagios is that the nagios server obtains information about the monitored node (monitored server) and displays it to the Administrator through CGI (Web GUI) or email.

I have previously introduced how to use jmeter + jmeter-plugins to monitor system resource usage. With Nagios, we gave up using jmeter because Nagios is more perfect.

Let's take a look at the monitoring unlx/linux method provided in Nagios addons (from http://nagios.sourceforge.net/docs/3_0/addons.html)


Information retrieval can be divided into active and passive retrieval, where active scores are obtained directly from the monitored node or intermediate database node.

If one node is directly retrieved from the monitored node and there are more than one machine, the CPU of the system where nagios is located may not be able to handle it. Therefore, our system uses the passive method of obtaining NSCA in the test environment, in the future, it may be transferred to the NDOUtils mode, and the monitoring end and the monitored end are separated through the database.


The data display in Nagios is not very friendly, but it has a very awesome plug-in pnp4nagios. pnp4nagios can display the data in good graphics. Pnp4nagios has several modes, currently, The most popular mode is The bulk + npcd mode. The synchronized mode is a drawing with data (The synchronous mode will work very good up to about 1.000 services in a 5 minute interval ), bulk mode is a centralized time point plot (71 lines were processed in 0.06 seconds. this will be the data volume of about 2000 services und processing using a 10 second interval. it means we blocked nagios Exactly 0.06 seconds .). Bulk + npcd uses a separate npcd process to process data plotting, without affecting the normal functions of Nagios.


The final mode of the monitoring system:Nagios + NSCA + Pnp4nagios (bulk & npcd).

NSCA is responsible for collecting data. Nagios writes the collected data to the spool file in the format required by Pnp4nagios, and moves the file to the spool folder processed by npcd every 15 minutes. npcd calls process_perfdata.pl to process the files in the spool folder, save it to rrd and add the pnp4nagios web access url to the Nagios monitoring page to view the graphic monitoring data.

S



Next, let's talk about how to install Nagios,

Nagios Server

One liunx server (CentOS), which installs the corresponding version of the following installation package

1. Basic nagios and Web GUI installation packages

Httpd-* .tar.gz, php-* .tar.gz, nagios-* .tar.gz, nagios-plugins-* .tar.gz

Installation Steps

2. graphical performance data installation package

Pnp4nagios-* .tar.gz

Installation Steps

3. Linux System Monitoring plug-in

Active Mode: nrpe-* .tar.gz; passive mode: nsca-* .tar.gz
Nsca installation procedure

Note: inetd or xinetd is not used in our system


Nagios monitored Clients

For the NSCA mode, we use the Python script + Cron Job (crontab) method to regularly send data to the Nagios Server in the format, so you only need to install Python on the monitored device.


Article 2: Nagios Server Configuration

Article 3: Nagios monitored Client configuration and script implementation


How to Use nagios to monitor linux I/O usage

If the default script does not exist, write the script by yourself.
 
Linux monitoring for Nagios

Modify the script by yourself. You can use vmstat instead of iostat. For details, Run man in linux.

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.