监控软件nagios之添加Linux主机

简介:

nagios监控windows和linux主机示意图:

wKiom1YweoTDy8pZAAH2FnORSwA486.jpg

1.首先要确定nagios监控软件在服务器端安装

wKiom1UbsOzjKJeBAAR2k-QP5TY349.jpg

 

2.在监控端要安装nrpe插件

[root@tong1 ~]# yum install xinetd openssl openssl-devel -y

[root@tong1 ~]# wget http://liquidtelecom.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz

[root@tong1 ~]# tar xvf nrpe-2.15.tar.gz

[root@tong1 ~]# cd /root/nrpe-2.15

[root@tong1 nrpe-2.15]# ./configure  --prefix=/usr/local/nagios-plugins-2.0.3/

[root@tong1 nrpe-2.15]# make all

[root@tong1 nrpe-2.15]# make install-plugin

[root@tong1 nrpe-2.15]# ll /usr/local/nagios-4.0.8/libexec/check_nrpe 
-rwxrwxr-x. 1 nagios nagios 76769 Apr  1 17:35 /usr/local/nagios-4.0.8/libexec/check_nrpe
[root@tong1 nrpe-2.15]#

 

3.在Linux被控端安装客户端软件(nagios-plugins和nrpe)

[root@tong2 ~]# yum install openssl openssl-devel xinetd -y

[root@tong2 ~]# groupadd  -g 500 nagios

[root@tong2 ~]# useradd  -r -s /sbin/nologin -u 500 -g nagios nagios

[root@tong2 ~]# wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz

[root@tong2 ~]# wget http://liquidtelecom.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz

[root@tong2 ~]# tar xvf nagios-plugins-2.0.3.tar.gz

[root@tong2 ~]# tar xvf nrpe-2.15.tar.gz

[root@tong2 ~]# cd nagios-plugins-2.0.3

[root@tong2 nagios-plugins-2.0.3]# ./configure --prefix=/usr/local/nagios-plugins-2.0.3 --with-nagios-user=nagios --with-nagios-group=nagios

[root@tong2 nagios-plugins-2.0.3]# make && make install

[root@tong2 nagios-plugins-2.0.3]# cd /usr/local/

[root@tong2 local]# chown  -R nagios:nagios nagios-plugins-2.0.3/

[root@tong2 local]# cd /root/nrpe-2.15

[root@tong2 nrpe-2.15]# ./configure  --prefix=/usr/local/nagios-plugins-2.0.3/

[root@tong2 nrpe-2.15]# make all

[root@tong2 nrpe-2.15]# make install-plugin

[root@tong2 nrpe-2.15]# make install-daemon

[root@tong2 nrpe-2.15]# make install-daemon-config

[root@tong2 nrpe-2.15]# make install-xinetd

[root@tong2 nrpe-2.15]# ll /usr/local/nagios-plugins-2.0.3/
total 20
drwxrwxr-x. 2 nagios nagios 4096 Apr  1 17:18 bin
drwxrwxr-x. 2 nagios nagios 4096 Apr  1 17:18 etc
drwxr-xr-x. 2 nagios nagios 4096 Apr  1 17:10 include
drwxrwxr-x. 2 nagios nagios 4096 Apr  1 17:18 libexec
drwxr-xr-x. 3 nagios nagios 4096 Apr  1 17:10 share

[root@tong2 nrpe-2.15]# vim /etc/xinetd.d/nrpe

only_from       = 127.0.0.1 192.168.1.247             --添加监控服务器端地址

[root@tong2 nrpe-2.15]# vim /usr/local/nagios-plugins-2.0.3/etc/nrpe.cfg

allowed_hosts=127.0.0.1,192.168.1.247              --添加监控服务器主机的IP地址

[root@tong2 nrpe-2.15]# vim /etc/services

nrpe            5666/tcp                # nrpe            --添加服务器监听端口

[root@tong2 nrpe-2.15]# /etc/init.d/xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]
[root@tong2 nrpe-2.15]# netstat -antup | grep 5666
tcp        0      0 :::5666                     :::*                        LISTEN      32747/xinetd        
[root@tong2 nrpe-2.15]# /usr/local/nagios-plugins-2.0.3/libexec/check_nrpe -H localhost
NRPE v2.15
[root@tong2 nrpe-2.15]#

 

3.在监控端测试连接被控端,添加被控端主机

[root@tong1 nrpe-2.15]# /usr/local/nagios-4.0.8/libexec/check_nrpe -H 192.168.1.248
NRPE v2.15

[root@tong1 etc]# cd /usr/local/nagios-4.0.8/etc/objects/

[root@tong1 objects]# cp -a templates.cfg  tong2.cfg
[root@tong1 objects]# vim tong2.cfg

 










本文转自 z597011036 51CTO博客,原文链接:http://blog.51cto.com/tongcheng/1627424,如需转载请自行联系原作者
目录
相关文章
|
28天前
|
监控 网络协议 Shell
【Shell 命令集合 网络通讯 】Linux 监控和记录网络中ARP(Address Resolution Protocol)活动 arpwatch命令 使用指南
【Shell 命令集合 网络通讯 】Linux 监控和记录网络中ARP(Address Resolution Protocol)活动 arpwatch命令 使用指南
33 0
|
28天前
|
监控 安全 Shell
【Shell 命令集合 文件传输 】Linux 将文件传送到远端的UUCP主机 uuto命令使用指南
【Shell 命令集合 文件传输 】Linux 将文件传送到远端的UUCP主机 uuto命令使用指南
30 0
|
28天前
|
网络协议 Shell Linux
【Shell 命令集合 网络通讯 】⭐⭐⭐Linux 测试与目标主机之间的网络连接ping 命令 使用指南
【Shell 命令集合 网络通讯 】⭐⭐⭐Linux 测试与目标主机之间的网络连接ping 命令 使用指南
41 1
|
3天前
|
监控 Linux
linux监控指定进程
请注意,以上步骤提供了一种基本的方式来监控指定进程。根据你的需求,你可以选择使用不同的工具和参数来获取更详细的进程信息。
10 0
|
3天前
|
监控 Linux 网络安全
linux中启动rpc.rstat监控
请注意,rpc.rstatd服务通常用于收集远程系统的性能统计信息,例如CPU利用率、内存使用等。在使用rpc.rstatd服务之前,你应该确保了解其功能、用法和安全性,并根据需要进行适当的配置和调整。
7 0
|
11天前
|
监控 Java Linux
linux下监控java进程 实现自动重启服务
linux下监控java进程 实现自动重启服务
|
28天前
|
监控 Shell Linux
【Shell 命令集合 系统设置 】Linux 管理和监控电源管理 apmd命令 使用指南
【Shell 命令集合 系统设置 】Linux 管理和监控电源管理 apmd命令 使用指南
28 0
|
1月前
|
缓存 Linux Android开发
【Linux】软件包管理器 yum
【Linux】软件包管理器 yum
|
监控 网络协议 Linux
Linux监控工具简单整合
Linux监控工具简单整合
107 0
|
运维 监控 网络协议
4个好用的Linux监控工具
本文介绍了作者常用的 4 个 Linux 监控工具,希望可以帮助读者提高生产力。