Configure new Nagios clients
- 安装
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum install -y gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel xinetd bc
安装nagios插件
yum -y install nagios-plugins-all nagios-plugins-nrpe
nagios-plugins目录:/usr/lib64/nagios/plugins/
安装nrpe
yum -y install nrpe - 修改nrpe设置
vi /etc/nagios/nrpe.cfg
only_from = 127.0.0.1,Server_IP - 修改防火墙设置
添加5666端口,重启iptables - 修改services服务
vi /etc/services
添加
nrpe 5666/tcp # NRPE
service xinetd restart - 测试nrpe是否安装成功
cd /usr/lib64/nagios/plugins/
./check_nrpe -H 127.0.0.1
若提示失败,可能是nrpe未安装或nrpe.cfg配置文件设置错误导致 - 修改nrpe.cfg
vi /etc/nagios/nrpe.cfg
注释掉目录不存在的nagios插件命令#command[check_users]=/usr/local/nagios/libexec/check_users -w -c
#command[check_load]=/usr/local/nagios/libexec/check_load -w ,, -c ,,
#command[check_hda1]=/usr/local/nagios/libexec/check_disk -w % -c % -p /dev/hda1
#command[check_zombie_procs]=/usr/local/nagios/libexec/check_procs -w -c -s Z
#command[check_total_procs]=/usr/local/nagios/libexec/check_procs -w -c command[check_users]=/usr/lib64/nagios/plugins/check_users -w -c
command[check_load]=/usr/lib64/nagios/plugins/check_load -w ,, -c ,,
command[check_sda1]=/usr/lib64/nagios/plugins/check_disk -w % -c % -p /dev/sda1
command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w -c -s Z
command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w -cCode
测试命令是否能够执行
cd /usr/lib64/nagios/plugins/
./check_nrpe -H 127.0.0.1 -c check_users
./check_nrpe -H 127.0.0.1 -c check_load
./check_nrpe -H 127.0.0.1 -c check_sda1
./check_nrpe -H 127.0.0.1 -c check_zombie_procs
./check_nrpe -H 127.0.0.1 -c check_total_procs - 配置Nagios监控端服务器
cd /usr/lib64/nagios/plugins/
./check_nrpe -H Remote_linux_ip_address(被监控的ServerIP)
显示 NRPE v2.15 即正常
cd /etc/nagios/objects
touch hosts.cfg touch services.cfg
vi hosts.cfg 注意修改IP## Default Linux Host Template ##
define host{
name linux-box ; Name of this template
use generic-host ; Inherit default values
check_period 24x7
check_interval
retry_interval
max_check_attempts
check_command check-host-alive
notification_period 24x7
notification_interval
notification_options d,r
contact_groups admins
register ; DONT REGISTER THIS - ITS A TEMPLATE
} ## Default
define host{
use linux-box ; Inherit default values from a template
host_name Nagios_Centos_Client1 ; The name we're giving to this server
alias CentOS ; A longer name for the server
address remote_linux_ip_address ; IP address of Remote Linux host
}hosts.cfg Code
vi services.cfg
define service{
use generic-service
host_name Nagios_Centos_Client1
service_description CPU Load
check_command check_nrpe!check_load
} define service{
use generic-service
host_name Nagios_Centos_Client1
service_description Total Processes
check_command check_nrpe!check_total_procs
} define service{
use generic-service
host_name Nagios_Centos_Client1
service_description Current Users
check_command check_nrpe!check_users
} define service{
use generic-service
host_name Nagios_Centos_Client1
service_description Disk Monitoring
check_command check_nrpe!check_sda1
} define service{
use generic-service
host_name Nagios_Centos_Client1
service_description Zombie Monitoring
check_command check_nrpe!check_zombie_procs
}services.cfg Code
修改nagios.cfg
vi /etc/nagios/nagios.cfg 添加如下两行配置
cfg_file=/etc/nagios/objects/services.cfg
cfg_file=/etc/nagios/objects/hosts.cfg
修改command.cfg
vi /etc/nagios/objects/commamds.cfg 添加define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}commamds.cfg Code
检验nagios的配置是否正常
cd /etc/nagios
nagios -v nagios.cfg
提示没有错误,重启nagios即可 - 参考文档:http://www.tecmint.com/how-to-add-linux-host-to-nagios-monitoring-server/
- 官方nrpe下载地址
打开:http://sourceforge.net/projects/nagios/files/nrpe-2.x/
wget http://liquidtelecom.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.15/nrpe-2.15.tar.gz
Configure new Nagios clients的更多相关文章
- Nagios在Ubuntu server上的安装配置
首先我参看的是Nagios的官方文档,Nagios – Installing Nagios Core From Source——The Industry Standard in IT Infrastr ...
- CentOS6.6+Puppet3.7.4分布式部署Nagios监控系统
测试框架 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 CentOS-6.6-x86_64(minimal) puppet-3.7 ...
- Nagios安装
在做安装之前确认要对该机器拥有root权限. 确认你安装好的Fedora系统上已经安装如下软件包再继续: Apache GCC编译器 GD库与开发库 可以用yum命令来安装这些软件包: yum ins ...
- nagios监控系统安装及配置
Nagios通常由一个主程序(Nagios).一个插件程序(Nagios-plugins)和四个可选的ADDON(NRPE.NSCA.NSClient++和NDOUtils)组成.Ngios的监控工作 ...
- Nagios学习笔记四:基于NRPE监控远程Linux主机
1.NRPE简介 Nagios监控远程主机的方法有多种,其方式包括SNMP.NRPE.SSH和NCSA等.这里介绍其通过NRPE监控远程Linux主机的方式. NRPE(Nagios Remote P ...
- Nagios学习笔记一:基本安装和配置
()解决安装Nagios的依赖关系: Nagios基本组件的运行依赖于httpd.gcc和gd.可以通过以下命令来检查nagios所依赖的rpm包是否已经完全安装: # yum -y install ...
- 一步步实现Nagios监控linux主机及飞信报警
一步步实现Nagios监控linux主机及飞信报警 上篇文章介绍了在linux主机上架设nagios监控服务,并对windows主机进行服务状态变化的监控,这次我们继续上次内容. 首先实现n ...
- Nagios:企业级系统监控方案
在大多数情况下Cacti + RRDtool已经实现对系统各种参数的监测.但很多企业可能不满足于仅仅监测系统基本参数的需求,而是需要监测除基本参数之外的各种应用程序的运行状况.很显然在这种情况下对于一 ...
- 六大Nagios常见问题解决办法
Nagios常见问题1: It appears as though you do not have permission to view information for any of the host ...
随机推荐
- c++ 入门之对象指针
我们想 像使用基本数据类型一样使用类,自然,类自然也有指针,我们通过下面的代码来领教一下对象指针存在的意义: # include "iostream" # include &quo ...
- 【RSYSLOG】The Property Replacer【转】
最近在调整日志平台的日志格式,一下是RSYSLOG的 Property Replacer 说明.鉴于RSYSLOG官网略坑,转发一下,原地址忘记了- - ||| The property replac ...
- 实现h5中radio单击取消与选中
<input type = "radio" id = "raid" name = "raname" checked = 'checke ...
- WinRAR从入门到高级的操作技巧集合
一.基础技巧 1.批量建立文件夹 如果在工作中,经常要建立很多相同文件夹结构(如在备份数据时).那可以把这个繁琐的工作让WinRAR完成:先在“资源管理器”中把多个文件夹结构建好(包括其下的子文件夹) ...
- PAT L2-014 列车调度
https://pintia.cn/problem-sets/994805046380707840/problems/994805063166312448 火车站的列车调度铁轨的结构如下图所示. 两端 ...
- CentOS 7 安装配置带用户认证的squid代理服务器
这里只简述搭建一个带用户认证的普通代理 一.安装 安装过程十分简便,只需要安装一下squid,一条命令搞定 yum install squid rpm -qa | grep squid squid-- ...
- js-跨域源资源共享(CORS)
### 一. CORS(Cross-Origin Resource Sharing,跨域源资源共享) 基本思想:使用自定义HTTP头部让浏览器与服务器进行沟通 发送请求时,需附加一个Origin头部 ...
- java 工厂模式 转载
下面介绍三种设计模式,简单工厂模式,工厂方法模式,抽象工厂模式 思考如下场景: 有一天,林同学准备去买笔记本,他到商城发现有两款电脑他特别喜欢, 一款是 Macbook Pro, 另一款是 Surfa ...
- python爬虫-1
import resquests #import urllib.request from bs4 import BeautifulSoup from collections import Ordere ...
- python之路--第一类对象,函数名,变量名
一 . 第一类对象 函数对象可以像变量一样进行赋值 , 还可以作为列表的元素进行使用 可以作为返回值返回 , 可以作为参数进行传递 def func(): def people(): print('金 ...