nagios&pnp4nagios--yum 安装
一。 环境:
1. centos 6.4
2. 设置hostname 并且安装好apache
3. 关闭selinux及iptables
二。 安装nagios服务器端:
1. rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
2. yum -y install nagios nagios-plugins-all nagios-plugins-nrpe nrpe php
3. chkconfig httpd on && chkconfig nagios on
4. service httpd start && service nagios start
5. 设置nagiosadmin密码:
htpasswd -c /etc/nagios/htpasswd.users nagiosadmin
6. 登陆:开浏览器,输入密码,在host里面应该有“localhost”这台机器
http://{your_ip_address}/nagios
三。 安装pnp4nagios:
1. yum install pnp4nagios rrdtool
四。配置pnp4nagios:
1,修改nagios.cfg
- [root@localhost objects]# vim /etc/nagios/nagios.cfg //修改以下内容
- process_performance_data=1 //由0改为1
- host_perfdata_command=process-host-perfdata //前面的注释拿掉
- service_perfdata_command=process-service-perfdata //注释拿掉
- enable_environment_macros=1 //如果有注释拿掉
2,修改commands.cfg
注释掉原有对process-host-perfdata和process-service-perfdata,重新定义
- [root@localhost objects]# vim /etc/nagios/objects/commands.cfg
- define command {
- command_name process-service-perfdata
- command_line /usr/bin/perl /usr/libexec/pnp4nagios/process_perfdata.pl
- }
- define command {
- command_name process-host-perfdata
- command_line /usr/bin/perl /usr/libexec/pnp4nagios/process_perfdata.pl -d HOSTPERFDATA
- }
3、修改配置文件templates.cfg
- [root@localhost objects]# vim /etc/nagios/objects/templates.cfg
- define host {
- name hosts-pnp
- register 0
- action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=_HOST_
- process_perf_data 1
- }
- define service {
- name srv-pnp
- register 0
- action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
- process_perf_data 1
- }
4,修改服务器配置文件localhost.cfg
- [root@localhost objects]# vim /etc/nagios/localhost.cfg
- define host{
- use linux-server,hosts-pnp
- host_name localhost
- alias localhost
- address 127.0.0.1
- }
- define service{
- use local-service,srv-pnp
- host_name localhost
- service_description PING
- check_command check_ping!100.0,20%!500.0,60%
- }
上面只是例举了一个,你可以都加一下。
在网上好多关于pnp4nagios的文章,都是要把mv misccommands.cfg-sample misccommands.cfg 生成配置文件,我是yum安装的,安装目录下根本没有sample这样的东西
- [root@localhost objects]# tree /etc/pnp4nagios/
- /etc/pnp4nagios/
- ├── background.pdf
- ├── check_commands
- │ ├── check_all_local_disks.cfg
- │ ├── check_nrpe.cfg
- │ └── check_nwstat.cfg
- ├── config.php
- ├── misccommands.cfg
- ├── nagios.cfg
- ├── npcd.cfg
- ├── pages
- │ └── web_traffic.cfg
- ├── pnp4nagios_release
- ├── process_perfdata.cfg
- └── rra.cfg
所在我根本没有配置任何东西。
5,重启nagios,启动npcd
- [root@localhost pnp4nagios]# /etc/init.d/npcd start
- [root@localhost pnp4nagios]# /etc/init.d/nagios restart
五。 登陆错误处理:
登陆http://{your_ip_address}/nagios,发现密码认证不对,请修改以下内容:
vi /etc/httpd/conf.d/pnp4nagios.conf
把 AuthUserFile /etc/nagios/passwd 修改为
AuthUserFile /etc/nagios/htpasswd.users
完工,小太阳可以看到,并且点击开来。
六。 配置调试命令
/usr/bin/nagios -v /etc/nagios/nagios.cfg
[root@nagios-mendian mendian]# /usr/bin/nagios -v /etc/nagios/nagios.cfg
Nagios Core 3.2.3
Copyright (c) 2009-2010 Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 10-03-2010
License: GPL
Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Processing object config file '/etc/nagios/objects/commands.cfg'...
Processing object config file '/etc/nagios/objects/contacts.cfg'...
Processing object config file '/etc/nagios/objects/timeperiods.cfg'...
Processing object config file '/etc/nagios/objects/templates.cfg'...
Processing object config file '/etc/nagios/objects/localhost.cfg'...
Processing object config directory '/etc/nagios/mendian'...
Processing object config file '/etc/nagios/mendian/BeiJingXiLu.cfg'...
Read object config files okay...
Running pre-flight check on configuration data...
Checking services...
Checked 8 services.
Checking hosts...
Warning: Host 'BeiJingXiLu' has no services associated with it!
Checked 2 hosts.
Checking host groups...
Checked 1 host groups.
Checking service groups...
Checked 0 service groups.
Checking contacts...
Checked 1 contacts.
Checking contact groups...
Checked 1 contact groups.
Checking service escalations...
Checked 0 service escalations.
Checking service dependencies...
Checked 0 service dependencies.
Checking host escalations...
Checked 0 host escalations.
Checking host dependencies...
Checked 0 host dependencies.
Checking commands...
Checked 24 commands.
Checking time periods...
Checked 5 time periods.
Checking for circular paths between hosts...
Checking for circular host and service dependencies...
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 1
Total Errors: 0
nagios&pnp4nagios--yum 安装的更多相关文章
- Nagios+pnp4nagios+rrdtool 安装配置nagios被监控端NRPE配置(二)
NRPE监控插件基础 NRPE总共由两部分组成: (1).check_nrpe插件,运行在监控主机上. (2).NRPE daemon,运行在远程的linux主机上(通常就是被监控机) 整个的监控过程 ...
- Nagios+pnp4nagios+rrdtool 安装配置nagios(一)
基于的软件版本 Apache-2.0.63 php-5.3.2 nagios-3.2.3 nagios-plugins-1.4.15 rrdtool-1.4.5 nrpe-2.12 pnp4na ...
- Nagios+pnp4nagios+rrdtool 安装配置为nagios添加自定义插件(三)
nagios博大精深,可以以shell.perl等语句为nagios写插件,来满足自己监控的需要.本文写mysql中tps.qps的插件,并把收集到的结果以图形形式展现出来,这样输出的结果就有一定的要 ...
- 通过yum安装Nagios
通过yum安装Nagios 2012年04月05日 ⁄ Nagios ⁄ 暂无评论 QQ空间新浪微博腾讯微博人人网更多3 前提先自行安装好Apache+php 测试环境主监控机:CentOS ...
- Nagios的基本安装配置
//////////////////////nagios//////////////////////nagios原理:http://www.linuxidc.com/Linux/2013-11/927 ...
- Linux CentOS 6.5 yum安装MongoDB的操作
安装MongoDB的方法有很多种,可以源代码安装,在CentOS也可以用yum源安装的方法.由于MongoDB更新得比较快,我比较喜欢用yum源安装的方法.64位CentOS下的安装步骤如下: 1.准 ...
- 1. Nagios和 NagiosQL安装及配置
目录 1. Nagios 和 NagiosQL简介 2. Nagios+NagiosQL搭建环境说明 3. Nagios.Nagios-plugins和NagiosQL的安装 4. 配置NagiosQ ...
- LDAP-openldap服务部署和测试(YUM安装)
1. 概述2. 服务端部署过程2.1 软件包说明2.2 部署过程2.3 配置过程3. 测试4. 生成LDIF格式文件4.1 安装migrationtools工具4.2 用migrationtools生 ...
- nagios服务端安装
系统环境:操作系统:CentOS-5.7 x86_64Apache版本: Apache-2.2.22Nagios版本: nagios-3.3.1GD库: gd-2.0.33 2.安装前准备:2.1.安 ...
- nagios 插件ndoutils 安装配置
nagios 插件ndoutils 安装配置 原文地址:http://www.cnblogs.com/caoguo/p/5022645.html # Nagios install ndoutils # ...
随机推荐
- android源码-安卓源码-Android源码下载-安卓游戏源码
android源码 高仿精仿金山手机卫士应用源码V1.2 高仿精仿金山手机卫士应用源码,该应用的级别实现了金山卫士的级别功能了,可以说跟现实中我们使用的金山卫士应用的功能几乎差不 人气:9286 ...
- 使用FTP删不掉文件的解决方法
今天在清理自己的服务器的时候发现曾经上传了一些png文件,中文命名的,权限是718,如果权限为777就可以删掉但是很奇怪的是执行权限修改也不行,改不掉: 最后的解决方法就是使用windows 随便打开 ...
- Android 源码编译 步骤
添加资源后编译步骤 1:lunch 112:mmm frameworks/base/core/res/生成Install: out/target/product/hammerhead/system/f ...
- NSS_02 日志配置
采用log4net,使用系统推荐的最新版本:log4net-1.2.11-bin-newkey.zip(网址:http://logging.apache.org/log4net/download_lo ...
- Knockout.js 初探
Knockout.js是什么? Knockout是一款很优秀的JavaScript库,它可以帮助你仅使用一个清晰整洁的底层数据模型(data model)即可创建一个富文本且具有良好的显示和编辑功能的 ...
- HTML5会砸掉iOS和Android开发者的饭碗么?
原生App的颠覆 HTML5的“性工能”障碍得到解决,可以接近原生App的效果,所以它就可以替代原生App吗?很多人认为,即使HTML5会发展的比现在好,也将是与原生App各占一部分市场的格局,要求不 ...
- HttpUnit学习笔记
<!-- htmlUnit --> <dependency> <groupId>net.sourceforge.htmlunit</groupId> & ...
- C语言字符串与字符数组
字符串儿与字符数组 字符数组的定义: Char buffer[]; 字符数组初始化: Char buffer1[]="hello world"; 利用scanf输入一个字符串儿 代 ...
- 2014年辛星完全解读Javascript第三节
经过第一节的入门和第二节的运算符,那么接下来我们就可以学习Javascript的函数了,当然了,不管大家之前学习的是什么编程语言,都会有函数的概念,如果大家学的是Pascal,还会有”过程“的概念,但 ...
- Oracle访问数据的存取方法
1) 全表扫描(Full Table Scans, FTS) 为实现全表扫描,Oracle读取表中所有的行,并检查每一行是否满足语句的WHERE限制条件.Oracle顺序地读取分配给表的每个数据块,直 ...