nagios 监控配置介绍(二)
#配置服务端监控客户端
[root@nagios etc]# cd objects/
[root@nagios objects]# vi hosts.cfg
# Define a host for the local machine
define host{
use linux-server
host_name 1.3-samba
alias 1.3-samba
address 10.89.1.3
}
define host{
use linux-server
host_name 1.2-nagios
alias 1.2-nagios
address 10.89.1.2
}
define host{
use linux-server
host_name 1.34-web-lnmp
alias 1.34-web-lnmp
address 10.89.1.34
}
define host{
use linux-server
host_name 1.34-web
alias 1.34-web
address 10.89.1.34
}
# Define an optional hostgroup for Linux machines
define hostgroup{
hostgroup_name linux-servers ; The name of the hostgroup
alias Linux Servers ; Long name of the group
members 1.3-samba,1.2-nagios,1.34-web-lnmp,1.34-web
}
保存退出
检查语法,先编辑nagios文件,使出错信息显示出来
[root@nagios objects]# vim /etc/init.d/nagios +183
$NagiosBin -v $NagiosCfgFile > /dev/null 2>&1; 修改为:
$NagiosBin -v $NagiosCfgFile
保存退出
检查语法,如果报错如下:
[root@nagios objects]# /etc/init.d/nagios checkconfig
Checking services...
Error: There are no services defined!
Checked 0 services.
解决方法:
[root@nagios objects]# vi services.cfg
define service {
use generic-service
host_name 1.3-samba
service_description Disk Partition
check_command check_nrpe!check_disk
}
再检查语法
[root@nagios objects]# /etc/init.d/nagios checkconfig
Total Warnings: 1
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
OK.
[root@nagios objects]#
如果报下面错误:
Error:Service check command 'check_nrpe' specified in service 'Disk Partition' for
host '10-client01' not defined anywhere!
则编辑commands.cfg 文件:
[root@nagios objects]# vi commands.cfg
再末尾加上
# 'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
注意:command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ 实际上就是使用这个命令探测:
[root@nagios objects]#/usr/local/nagios/libexec/check_nrpe -H 10.89.1.3 -c check_disk
保存并退出
再检查语法
[root@nagios objects]# /etc/init.d/nagios checkconfig
没有错误的情况下:
[root@nagios objects]# /etc/init.d/nagios reload
Running configuration check...done.
Reloading nagios configuration...done
[root@nagios objects]#
http://10.89.1.2/nagios
如果登录后提示错误:
It appears as though you do not have permission to view information for any of the hosts you requested...
If you believe this is an error, check the HTTP server authentication requirements for accessing this CGI
and check the authorization options in your CGI configuration file.
编辑 cgi.cfg
[root@nagios objects]# cd ../
[root@nagios etc]# vi cgi.cfg
# PHYSICAL HTML PATH
# This is the path where the HTML files for Nagios reside. This
# value is used to locate the logo p_w_picpaths needed by the statusmap
# and statuswrl CGIs.
physical_html_path=/usr/local/nagios/share
:g/nagiosadmin/s//alvin/g #替换nagiosadmin 为 alvin,该用户是我安装的时候添加的
保存并退出
[root@nagios objects]# /etc/init.d/nagios reload
转载于:https://blog.51cto.com/ahtornado/1885155
nagios 监控配置介绍(二)相关推荐
- nagios监控linux主机,Nagios监控平台之二:nrpe监控远程Linux主机 | 旺旺知识库
Nagios系列文章: Nagios监控平台之二:nrpe监控远程Linux主机 监控监控linux本地主机时,我们可以直接更改配置文件进行监控,如果需要监控的主机与nagios不在同一机器上,即监控 ...
- Nagios之配置介绍
再配置本文之前请先阅读http://blog.csdn.net/u010257584/article/details/56278009点击打开链接,关于Nagios的其他内容请关注作者陆续更新! 1. ...
- nagios监控配置错误汇总
agios监控配置错误汇总 1.check_iftraffic监控网卡流量的配置及错误解决办法 服务端: 添加以下内容: vim /usr/local/nagios/etc/objects/comma ...
- 浅谈 nagios监控配置
该文档只针对于配置 打乱了commands.cfg templates.cfg contacts.cfg localhost.cfg timeperiods.cfg resource.cfg ...
- Nagios监控平台
为什么80%的码农都做不了架构师?>>> 安装完成后的一些情况 Nagios以及插件将安装在/usr/local/nagios目录 Nagios会配置监控本地机器几个方面(CP ...
- nagios二次开发(四)---nagios监控原理和nagios架构简介
nagios监控原理 下面根据上面摘自网络的原理图对nagios的监控原理进行一下简单的说明: 1.nagios通过nsca进行被动监控.那么什么是被动监控呢?被动监测:就是指由被监测的服务器主动上传 ...
- nagios监控之(监控配置)
打开上一章:nagios监控之(运行环境搭建) PS: 上一张已经把nagios的基本环境搭建完成,并能成功浏览nagios页面 现在讲下nagios配置文件 配置文件 放在nagios/etc下面 ...
- Centos 7安装与配置nagios监控(一)
目 录 序言(必备知识) 一.安装规划 1.1系统环境 1.2所需软件包 二.配置安装环境 2.1同步时间 2.2禁用SElinux 2.3 xftp上传软件包 2.4安装邮件服务 三.监控主机安装 ...
- 登录飞信未能找到主机名的服务器,Nagios 监控+飞信的安装与配置.ppt
Nagios监控飞信的安装与配置 ;一. 前言:;二.下载所需软件;三.服务端环境配置;四.nagios 主程序安装;五.验证安装是否成功;六.安装nagios-plugins;3. 修改apache ...
最新文章
- iOS自动布局(AutoLayout)之 NSLayoutAnchor
- linux内核网络协议栈--架构分析(十八)
- 【模型解读】深度学习网络只能有一个输入吗
- kademlia java_分布式哈希表原理与实现(Python版和Java版)
- android.mk 比较字变量,粉丝投稿 | 谈谈Android.mk
- Cisco路由器交换机配置命令详解
- 虚拟机安装windows服务出现无法打开内核设备“\\.Global\vmx86”
- linux用vi查找字符串替换,Linux中vi进行字符替换
- 逆发动机模型map图制作
- SQL高级查询—实验报告
- 还没收到win11系统的推送?教你这样可以直接升级win11
- 关于微信小程序自定义交易组件升级处理的相关问题,及解决思路
- Disturbed People_CodeForces1077B
- python输入一个自然数n如果n为奇数_日本数学家谷角静夫在研究自然数时发现了一个奇怪现象(“谷角猜想”):对于任意一个自然数...
- SwiftUI基础之Text格式化显示小数specifier
- sql半小时,小时,天,月,年分组,日期函数day() 、month()、year()
- Windows10下WebLogic的下载与安装
- 图的存储-邻接矩阵和邻接表之间的相互转化
- 【MOOC】华中科技大学计算机组成原理慕课答案-第四章-存储系统(一)
- Jenkins:(看起来挺好看的)邮件模板样式