Nagios Nrpe plugin installation tutorial
Nagios Nrpe plugin installation tutorial
1. Install nagios plugins
[Root @ Nrpe ~] # Yum install-y gcc openssl-devel
[Root @ Nrpe ~] #/Usr/sbin/useradd-m nagios
[Root @ Nrpe ~] # Cd/usr/local/src
[Root @ Nrpe src] # wget http://nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz
[Root @ Nrpe src] # tar xzf nagios-plugins-2.1.1.tar.gz
[Root @ Nrpe src] # cd nagios-plugins-2.1.1
[Root @ Nrpe nagios-plugins-2.1.1] #./configure -- prefix =/usr/local/nrpe -- with-nagios-user = nagios -- with-nagios-group = nagios
[Root @ Nrpe nagios-plugins-2.1.1] # make & make install
Ii. nrpe Service Installation
[Root @ Nrpe src] # wget http://nchc.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
[Root @ Nrpe src] # tar zxf nrpe-2.15.tar.gz
[Root @ Nrpe src] # cd nrpe-2.15
[Root @ Nrpe nrpe-2.15] #./configure -- prefix =/usr/local/nrpe
[Root @ Nrpe nrpe-2.15] # make all
[Root @ Nrpe nrpe-2.15] # make install-plugin
[Root @ Nrpe nrpe-2.15] # make install-daemon
[Root @ Nrpe nrpe-2.15] # make install-daemon-config
[Root @ Nrpe ~] # Ln-s/usr/local/nrpe/etc/nrpe
[Root @ Nrpe ~] # Cp-rf/etc/nrpe. cfg/etc/nrpe. cfg. old
[Root @ Nrpe ~] # Grep-v-E '^ # | ^ $'/etc/nrpe. cfg
Log_facility = daemon
Pid_file =/var/run/nrpe. pid
Server_port = 5666
Nrpe_user = nagios
Nrpe_group = nagios
Allowed_hosts = 127.0.0.1, 192.168.88.138
Dont_blame_nrpe = 0
Allow_bash_command_substitution = 0
Debug = 0
Command_timeout = 60
Connection_timeout = 300
Command [check_users] =/usr/local/nrpe/libexec/check_users-w 5-c 10
Command [check_load] =/usr/local/nrpe/libexec/check_load-w 15, 10, 5-c 30, 25, 20
Command [check_sda] =/usr/local/nrpe/libexec/check_disk-w 20%-c 10%-p/dev/sda
Command [check_zombie_procs] =/usr/local/nrpe/libexec/check_procs-w 5-c 10-s Z
Command [check_total_procs] =/usr/local/nrpe/libexec/check_procs-w 150-c 200
##########
# Test startup
#/Usr/local/nrpe/bin/nrpe-c/usr/local/nrpe/etc/nrpe. cfg-d
# Built-in Startup Script
[Root @ Nrpe nrpe-2.15] # cp-rf init-script.in/etc/init. d/nrpe
[Root @ Nrpe nrpe-2.15] # chmod a + x/etc/init. d/nrpe
[Root @ Nrpe ~] # Chkconfig nrpe on
[Root @ Nrpe ~] #/Etc/init. d/nrpe start
Iii. Test Data Acquisition
Iv. nagios Configuration
[Root @ Nagios ~] # Cp/etc/nagios/objects/localhost. cfg/etc/nagios/objects/nrpehost. cfg
[Root @ Nagios ~] # Vi/etc/nagios/objects/nrpehost. cfg
Define host {
Use linux-server
Host_name nrpehost
Alias My Linux Server
Address 192.168.88.139
}
Define service {
Use generic-service
Host_name nrpehost
Service_description CHECK USER
Check_command check_nrpe! Check_users
}
Define service {
Use generic-service
Host_name nrpehost
Service_description CHECK LOAD
Check_command check_nrpe! Check_load
}
Define service {
Use generic-service
Host_name nrpehost
Service_description CHECK SDA
Check_command check_nrpe! Check_sda
}
Define service {
Use generic-service
Host_name nrpehost
Service_description Zombie
Check_command check_nrpe! Check_zombie_procs
}
Define service {
Use generic-service
Host_name nrpehost
Service_description Total procs
Check_command check_nrpe! Check_total_procs
}
[Root @ Nagios ~] # Grep nrpehost/etc/nagios. cfg
Export _file =/usr/local/nagios/etc/objects/nrpehost. cfg
[Root @ Nagios ~] #/Etc/init. d/nagios restart
Nagios reports NRPE: Command 'check _ heartbeat 'not defined
How to Use the Nagios remote execution plug-in (NRPE) to detect server memory usage
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
Nagios details: click here
Nagios: click here
This article permanently updates the link address: