install nagios pnp4nagios on centos 6
- 安装配置Apache、PHP(忽略此次安装步骤)
- 安装nagios
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 -y install nagios nagios-plugins-all nagios-plugins-nrpe nrpe php httpd bc - 创建密码文件
htpasswd -c /etc/nagios/passwd nagiosadmin
(此步完成即可通过Web访问Nagios)
http://yourip/nagios - 安装PNPNagios
yum -y install perl-Time-HiRes pnp4nagios
若提示没有pnp4nagios软件包
yum -y groupinstall "Development Tools"
wget https://sourceforge.net/projects/pnp4nagios/files/latest
mv latest pnp4nagios-Version.tar.gz
tar -xvzf pnp4nagios-Version.tar.gz
yum -y install rrdtool rrdtool-perl
cd pnp4nagios-0.6.25
./configure
make all
make fullinstall
mv /usr/local/pnp4nagios/share/install.php /usr/local/pnp4nagios/share/install.php.ignore
ln -s /usr/local/pnp4nagios/ /var/www/html/pnp4nagios - 修改 /etc/nagios/nagios.cfg
process_performance_data=1 // 将0 修改为 1
host_perfdata_command=process-host-perfdata // 取消注释
service_perfdata_command=process-service-perfdata // 取消注释 修改 /etc/nagios/objects/commands.cfg (注释默认配置再添加)
define command {
command_name process-service-perfdata
command_line /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl
}
define command {
command_name process-host-perfdata
command_line /usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
}commands.cfg Code
修改 /etc/nagios/cgi.cfg 里的用户名是无效的
default_user_name=nagiosadmin修改 /etc/httpd/conf.d/pnp4nagios.conf
#AuthUserFile /usr/local/nagios/etc/htpasswd.users # 注释这一行
AuthUserFile /etc/nagios/passwd # 添加此行重启nagios 和 apache
chkconfig httpd on
chkconfig nrpe on
chkconfig npcd on
chkconfig nagios on
打开 http://yourip/pnp4nagios/ 即可看到pnp图- 添加pnp4nagios记录模版
修改/etc/nagios/objects/templates.cfg,添加如下内容define host {
name host-pnp
action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$'class='tips'rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=_HOST_
register
process_perf_data
} define service {
name srv-pnp
action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$'class='tips'rel='/pnp4nagios/index.php/popup?host=$HOSTNAME$&srv=$SERVICEDESC$
register
process_perf_data
}templates.cfg Code
- 在host和service定义中使用pnp4nagios模版
编辑localhost.cfg文件,vi /etc/nagios/objects/localhost.cfg
将use linux-server 修改为 use linux-server,host-pnp
将use local-services修改为 use local-services,srv-pnpdefine 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,%!500.0,%
}pnp services Code
被监控机需要显示pnp按钮,修改vi /etc/nagios/objects/services.cfg
将use local-services修改为 use local-services,srv-pnp - 出现的问题
关闭 selinux
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
sed -i "s/SELINUXTYPE=targeted/#SELINUXTYPE=targeted/g" /etc/selinux/config 参考文档:
https://www.digitalocean.com/community/tutorials/how-to-install-nagios-on-centos-6http://geekpeek.net/pnp4nagios-centos-install/http://blog.csdn.net/tch8502/article/details/22151525http://www.huangzhongzhang.cn/nagios-pnp4nagios-an-zhuang-bi-ji.html
install nagios pnp4nagios on centos 6的更多相关文章
- install Nagios on Unbuntu Unix
Ubuntu Quickstart Up To: ContentsSee Also: Quickstart Installation Guides, Security Considerations I ...
- Install .Net Core For CentOS
Install .NET Core SDK Before you start, please remove any previous versions of .NET Core from your s ...
- [转载]How to Install Firefox 33 on CentOS, Redhat and Other Linux Distributions
FROM: http://tecadmin.net/install-firefox-on-linux/ Firefox 33 has been released for Systems and And ...
- Install RabbitMQ server in CentOS 7
About RabbitMQ RabbitMQ is an open source message broker software, also sometimes known as message-o ...
- Install Docker Engine on CentOS 在CentOS 7 上安装Docker
Install Docker Engine on CentOS OS Requirements 系统要求 To install Docker Engine,you need a maintained ...
- Centos 7.5 通过yum安装GNOME Desktop时出现:file /boot/efi/EFI/centos from install of fwupdate-efi-12-5.el7.centos.x86_64 conflicts with file from package grub2-common-1:2.02-0.65.el7.centos.2.noarch
系统版本为: [root@s10 ~]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) 由于管理kvm虚拟机的需求,需要安装 ...
- 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 ...
- nginx下的nagios pnp4nagios
#Spawn-FCGI 一个通用的FastCGI管理服务器,它是lighttpd中的一部份,很多人都用Lighttpd的Spawn-FCGI进行FastCGI模式下的管理工作 #fcgiwrap(Si ...
- 转载--How to Install VMware Tools on CentOS 6.3
源地址:http://www.ehowstuff.com/how-to-install-vmware-tools-on-centos-6-3/ VMware Tools is a group of u ...
随机推荐
- Django 学习 (第五部)
表设计: from django.db import models # Create your models here. # class Foo(models.Model): # name = mod ...
- UOJ224 NOI2016 旷野大计算 构造、造计算机
传送门——UOJ 传送门——Luogu 这段时间请不要找Itst聊天,Itst已经做疯了 事实证明大模拟题不可做 query 1 送分,加起来一起乘即可 I I + < - O query 2 ...
- ASP HTMLEncode/HTMLDecode
asp 有Server.HTMLEncode 却没有 Server.HTMLDecode....... 需要自定义一个 HTMLDecode 函数: Function HTMLDecode(sText ...
- Ionic下的JPush缺少统计代码问题解决方法
用Ionic打包apk后安装到手机,收到缺少统计代码的提示,解决方法如下: 1. 找到了 platforms/android/src/com/ionichina/ioniclub/MainActiov ...
- 在SpringMVC中使用HandlerInterceptor来实现拦截器功能
需求:我们需要在请求某些特定的URL(URL格式为Restful格式)时添加拦截器,以实现进行权限控制. 如:/ResourcePlan/projectCode/P1503127828/PROJECT ...
- C# 爬虫 正则、NSoup、HtmlAgilityPack、Jumony四种方式抓取小说
心血来潮,想爬点小说.通过百度选择了个小说网站,随便找了一本小说http://www.23us.so/files/article/html/13/13655/index.html. 1.分析html规 ...
- LInux下设置账号有效时间 以及 修改用户名(同时修改用户组名和家目录)
在linux系统中,默认创建的用户的有效期限都是永久的,但有时候,我们需要对某些用户的有效期限做个限定!比如:公司给客户开的ftp账号,用于客户下载新闻稿件的.这个账号是有时间限制的,因为是付费的.合 ...
- 【2015 软件工程 个人项目 PJ1】四则运算题目生成程序
1.开发时间预估 PSP2.1 Personal Software Process Stages Time Planning 计划 · Estimate · 估计这个任务需要多少时间 2day Dev ...
- 安装tesserocr错误(未解决)
在win10下使用pip install tesserocr安装时,始终报错,未解决问题 解压tesserocr-2.2.2.tar.gz该文件夹后,查看setup.py文件,发现似乎model只能再 ...
- Knowledge-Defined Networking
知识定义的网络(Knowledge-Defined Networking) 来源:ACM SIGCOMM Computer Communication Review 年份:2017 是什么:容纳和利用 ...