How to add client in Nagios Monitoring Server by using NRPE Plugin
Adding Linux Host to Nagios Monitoring Server Using NRPE Plugin
The NRPE (Nagios Remote Plugin Executor) plugin allows you to monitor any remote Linux services. This add-on allows Nagios to monitor resources like CPU load, Swap, Memory usage, Online users, etc., Procedures to add linux host to Nagios Monitoring Server using NRPE plugin is explained in this article.
Features
- Monitor your entire IT infrastructure.
- Identify problems before they occur.
- Know immediately when problems arise.
- Share availability data with stakeholders.hypothetical question.
- Detect security breaches.
- Plan and budget for IT upgrades.
- Reduce downtime and business losses.
server
client side
To install epel repository
[root@linuxhelp1 ~]# yum install epel-release -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.nbrc.ac.in
* extras: mirror.nbrc.ac.in
* updates: mirror.nbrc.ac.in
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-6 will be installed
--> Finished Dependency Resolution
.
.
.
Installed:
epel-release.noarch 0:7-6
Complete!
To Install the nrpe and nrpe plugins in client system
[root@linuxhelp1 ~]# yum install nrpe nagios-plugins-all openssl -y
Loaded plugins: fastestmirror, langpacks
epel/x86_64/metalink | 5.2 kB 00:00:00
epel | 4.3 kB 00:00:00
(1/3): epel/x86_64/updateinfo | 576 kB 00:00:06
(2/3): epel/x86_64/primary_db | 4.2 MB 00:00:11
(3/3): epel/x86_64/group_gz | 170 kB 00:00:15
Loading mirror speeds from cached hostfile
* base: mirror.nbrc.ac.in
* epel: epel.mirror.net.in
* extras: mirror.nbrc.ac.in
* updates: mirror.nbrc.ac.in
Resolving Dependencies
--> Running transaction check
---> Package nagios-plugins-all.x86_64 0:2.0.3-3.el7 will be installed
--> Processing Dependency: nagios-plugins-wave for package: nagios-plugins-all-2.0.3-3.el7.x86_64
.
.
.
nagios-plugins-swap.x86_64 0:2.0.3-3.el7 nagios-plugins-tcp.x86_64 0:2.0.3-3.el7
nagios-plugins-time.x86_64 0:2.0.3-3.el7 nagios-plugins-ups.x86_64 0:2.0.3-3.el7
nagios-plugins-users.x86_64 0:2.0.3-3.el7 nagios-plugins-wave.x86_64 0:2.0.3-3.el7
net-snmp-utils.x86_64 1:5.7.2-24.el7_2.1 postgresql-libs.x86_64 0:9.2.15-1.el7_2
qstat.x86_64 0:2.11-13.20080912svn311.el7
Updated:
openssl.x86_64 1:1.0.1e-51.el7_2.5
Dependency Updated:
net-snmp-libs.x86_64 1:5.7.2-24.el7_2.1 openssl-libs.x86_64 1:1.0.1e-51.el7_2.5
Complete!
Configure the monitoring target
[root@linuxhelp1 ~]# vim /etc/nagios/nrpe.cfg
allowed_hosts=127.0.0.1,192.168.5.231
Start the nrpe service in the client
[root@linuxhelp1 ~]# systemctl start nrpe [root@linuxhelp1 ~]# chkconfig nrpe on Note: Forwarding request to ' systemctl enable nrpe.service' . ln -s ' /usr/lib/systemd/system/nrpe.service' ' /etc/systemd/system/multi-user.target.wants/nrpe.service'
On server side
Open the nagios.cfg file located on /usr/local/nagios/etc/
[root@linuxhelp ~]# vim /usr/local/nagios/etc/nagios.cfg
Uncomment the following line.
cfg_dir=/usr/local/nagios/etc/servers
Create a directory in the name of server under the directory “ /usr/local/nagios/etc/”
[root@linuxhelp ~]# mkdir /usr/local/nagios/etc/servers
Configure the client to be monitored.
[root@linuxhelp ~]# vim /usr/local/nagios/etc/servers/clients.cfg
define host{ use linux-server host_name node1 alias node1 address 192.168.7.232 max_check_attempts 5 check_period 24x7 notification_interval 30 notification_period 24x7 }
Restart the nagios service.
[root@linuxhelp ~]# systemctl restart nagios
Open the nagios in web browser and click Hosts menu to view the newly created host. Then select node1.
Host node1 information appears as follows.
For defining the service
Add the following code in the client configuration file located in /usr/local/nagios/etc/servers/
define service { use generic-service host_name node1 service_description SSH check_command check_ssh notifications_enabled 0 }
Restart the nagios service
[root@linuxhelp ~]# systemctl restart nagios
Open the nagios in browser and click services. To check whether the SSH services added or not.
Comments ( 0 )
No comments available