Nagios监控linux主机以及硬件信息
2017-07-27 15:07
429 查看
Nagios监控linux主机
以下步骤都是命令,目录选择自行思考安装Nagios XI Linux agent
wget https://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz
Tar xzf linux-nrpe-agent.tar.gz
cd linux-nrpe-agent.tar.gz
./fullinstall
安装NRPE插件
yum install -y gcc glibc glibc-common openssl-devel perl wget
Wget --no-check-certificate -O nrpe.tar.gz https://github.com/NagiosEnterprises/nrpe/archive/nrpe-3.2.0.tar.gz
tar xzf nrpe.tar.gz
cd /tmp/nrpe-nrpe-3.2.0/
./configure --enable-command-args
make all
make install-groups-users
make install
make install-config
echo >> /etc/services
echo '# Nagios services' >> /etc/services
echo 'nrpe 5666/tcp' >> /etc/services
make install-init
cd /usr/local/nagios/etc/
vim nrpe.cfg
/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1 #原本不能进入
/usr/local/nagios/libexec/check_nrpe -H 192.168.56.63 #使用更新后ip
start nrpe
stop nrpe
restart nrpe
status nrpe
安装之后在/usr/local/nagios/etc/objects下新建你缩需要金控主机的.cfg文件,然后进去进行配置,在这个文件中添加你所需要监控主机的服务,其中服务在/usr/local/nagios/libexec下查看由哪些可以监控的服务,下面以监控linux主机192.168.56.64中的PING命令为例进行说明
在监控端63
cd /usr/local/nagios/etc/objects
vim 192.168.56.64.cfg #输入以下内容,监控主机,ping,硬盘,cpu等
define host{
use linux-server ; Name of host template to use,这个use名字在templates.cfg中查找进行设置
; This host definition will inherit all variables that are defined
; in (or inherited by) the linux-server host template definition.
host_name test64
alias test64
address 192.168.56.64
}
define service{
use local-service ; Name of service template to use
host_name test64
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
host_name test64
service_description Current Users
check_command check_nrpe!check_users
contact_groups admins
}
#The following service will monitor the free drive space on /dev/sda1 on the remote host.
define service{
use local-service
host_name test64
service_description /dev/sda1 Free Space
check_command check_nrpe!check_sda1
contact_groups admins
}
#The following service will monitor the total number of processes on the remote host.
define service{
use local-service
host_name test64
service_description Total PProcesses
check_command check_nrpe!check_total_procs
contact_groups admins
}
#The following service will monitor the number of zombie processes on the remote host.
define service{
use local-service
host_name test64
service_description Zombie Processes
check_command check_nrpe!check_zombie_procs
contact_groups admins
}
# monitoring the swap usage on the remote host
define service{
use local-service
host_name test64
service_description Swap Usage
check_command check_nrpe!check_swap
contact_groups admins
}
"192.168.56.64.cfg" 93L, 3168C 81,2-9 底端
配置/usr/local/nagios/etc/nagios.cfg
添加行cfg_file=/usr/local/nagios/etc/objects/192.168.56.64.cfg
遇到的错误
错误解决办法,user名称要与templates.cfg中的相对应,
相关文章推荐
- nagios 监控 linux主机的信息
- nagios监控linux主机及服务信息
- nagios监控linux主机及服务信息
- 监控机为Linux主机的nagios安装与配置之利用snmp方式监控远程主机上的“本地信息”
- Nagios利用NRPE监控Linux主机
- Linux查看硬件信息以及驱动设备的命令
- nagios配置――添加linux主机监控
- Nagios配置—添加linux主机监控
- Linux查看硬件信息以及驱动设备的命令
- nagios监控linux主机
- nagios 监控linux 主机
- Nagios配置——添加Linux主机监控
- nagios搭建(三):nagios监控linux主机
- Nagios监控平台之五:监控linux主机的CPU温度
- nagios监控linux主机、web等各种服务,并实现飞信自动报警
- Nagios 监控 Linux 主机 (2009-11-10 09:31)
- LINUX开源监控平台Nagios(主机监控配置)
- nagios监控linux主机、web等各种服务,并实现飞信自动报警
- Linux查看硬件信息以及驱动设备的命令
- nagios监控linux客户端主机