nagios 安装pnp4nagios插件

Naigos install pnp4nagios 绘图插件

原文地址:http://www.cnblogs.com/caoguo/p/5022230.html
[[email protected] ~]# yum install -y rrdtool perl-rrdtool perl-Time-HiRes

[[email protected] src]# wget http://nchc.dl.sourceforge.net/project/pnp4nagios/PNP-0.6/pnp4nagios-0.6.25.tar.gz
[[email protected] src]# tar zxf pnp4nagios-0.6.25.tar.gz
[[email protected] src]# cd pnp4nagios-0.6.25
[[email protected] pnp4nagios-0.6.25]# ./configure --prefix=/usr/local/pnp4nagios --with-nagios-user=nagios --with-nagios-group=nagcmd

[[email protected] pnp4nagios-0.6.25]# make all
[[email protected] pnp4nagios-0.6.25]# make install
[[email protected] pnp4nagios-0.6.25]# make install-webconf
[[email protected] pnp4nagios-0.6.25]# make install-config

# 开启日志文件
[[email protected] ~]# vi /usr/local/pnp4nagios/etc/npcd.cfg
log_type = file

# 启动pnp4nagios服务
#[[email protected] ~]# service npcd restart
[[email protected] ~]# /etc/init.d/npcd restart

# 鼠标悬停图标显示文件
[[email protected] pnp4nagios-0.6.25]# cp contrib/ssi/* /usr/local/nagios/share/ssi/
[[email protected] ~]# chmod a+x /usr/local/nagios/share/ssi
[[email protected] ~]# chown -R nagios.nagcmd /usr/local/nagios/share/ssi

[[email protected] etc]# mv misccommands.cfg-sample misccommands.cfg
[[email protected] etc]# mv rra.cfg-sample rra.cfg
[[email protected] etc]# mv nagios.cfg-sample nagios.cfg

[[email protected] etc]# cd pages/
[[email protected] pages]# mv web_traffic.cfg-sample web_traffic.cfg

[[email protected] pages]# cd ../check_commands/
[[email protected] check_commands]# mv check_all_local_disks.cfg-sample check_all_local_disks.cfg
[[email protected] check_commands]# mv check_nrpe.cfg-sample check_nrpe.cfg
[[email protected] check_commands]# mv check_nwstat.cfg-sample check_nwstat.cfg

# 编辑nagios配置文件
[[email protected] ~]# vi /usr/local/nagios/etc/nagios.cfg
process_performance_data=1

# *** the template definition differs from the one in the original nagios.cfg
#
service_perfdata_file=/usr/local/pnp4nagios/var/service-perfdata
service_perfdata_file_template=DATATYPE::SERVICEPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tSERVICEDESC::$SERVICEDESC$\tSERVICEPERFDATA::$SERVICEPERFDATA$\tSERVICECHECKCOMMAND::$SERVICECH
ECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATETYPE::$HOSTSTATETYPE$\tSERVICESTATE::$SERVICESTATE$\tSERVICESTATETYPE::$SERVICESTATETYPE$
service_perfdata_file_mode=a
service_perfdata_file_processing_interval=15
service_perfdata_file_processing_command=process-service-perfdata-file

# *** the template definition differs from the one in the original nagios.cfg
##
host_perfdata_file=/usr/local/pnp4nagios/var/host-perfdata
host_perfdata_file_template=DATATYPE::HOSTPERFDATA\tTIMET::$TIMET$\tHOSTNAME::$HOSTNAME$\tHOSTPERFDATA::$HOSTPERFDATA$\tHOSTCHECKCOMMAND::$HOSTCHECKCOMMAND$\tHOSTSTATE::$HOSTSTATE$\tHOSTSTATE
TYPE::$HOSTSTATETYPE$
host_perfdata_file_mode=a
host_perfdata_file_processing_interval=15
host_perfdata_file_processing_command=process-host-perfdata-file

[[email protected] ~]# cd /usr/local/nagios/etc/objects/
[[email protected] objects]# cp commands.cfg commands.cfg.old

# 配置命令文件
# Bulk Mode with NPCD模式
[[email protected] objects]# vi commands.cfg
# ‘process-host-perfdata‘ command definition
#注释默认的process-host-perfdata和process-service-perfdata,添加以下
define command{
    command_name process-service-perfdata-file
    command_line /bin/mv /usr/local/pnp4nagios/var/service-perfdata /usr/local/pnp4nagios/var/spool/service-perfdata.$TIMET$
 }

define command{
    command_name process-host-perfdata-file
    command_line /bin/mv /usr/local/pnp4nagios/var/host-perfdata /usr/local/pnp4nagios/var/spool/host-perfdata.$TIMET$
 }

# 配置模板文件
[[email protected] objects]# vi templates.cfg
define host {
    name       host-pnp
    action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=_HOST_
    register   0
    process_perf_data 1
}
define service {
    name       service-pnp
    action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
    register   0
    process_perf_data 1
}  

# 配置localhost主机文件,测试pnp4naigos
[[email protected] objects]# vi localhost.cfg
define host{
        use                     linux-server,host-pnp
        host_name               localhost
        alias                   localhost
        address                 127.0.0.1
        }
define service{
        use                             local-service,service-pnp
        host_name                       localhost
        service_description             PING
    check_command           check_ping!100.0,20%!500.0,60%
        }
define service{
        use                             local-service,service-pnp
        host_name                       localhost
        service_description             Root Partition
    check_command           check_local_disk!20%!10%!/
        }

[[email protected] ~]# cd /usr/local/pnp4nagios/share/
[[email protected] share]# mv install.php install.php.bak

[[email protected] ~]# /etc/init.d/nagios restart
[[email protected] ~]# /etc/init.d/npcd restart

时间: 2024-10-26 06:19:44

nagios 安装pnp4nagios插件的相关文章

Nagios图像绘制插件PNP4Nagios部署和测试

1. 概述2. 关于PNP4Nagios3. 部署PNP4Nagios3.1 下载PNP4Nagios3.2 编译安装3.3 目录文件说明4. 配置Nagios4.1 配置说明4.2 配置Nagios主配置文件4.3 配置Nagios对象模板command.cfg文件4.4 配置Nagios对象模板template.cfg文件4.5 配置主机和服务监控5. 测试6.总结 1. 概述 本篇博客主要介绍在Nagios3.5和Nagios4.4系统中部署pnp4nagios0.4和pnp4nagios

Nagios+Cacti+PNP4Nagios+NConf+NDOUtils+Nagvis(一)nagios安装

1.nagios安装 groupadd nagios useradd -g nagios nagios mkdir -p /usr/local/nagios/ passwd nagios tar -xvf nagios-4.0.8.tar.gz cd nagios-4.0.8 ./configure --prefix=/usr/local/nagios/ --with-command-group=nagios --with-nagios-user=nagios --with-nagios-gro

yum install nagios and pnp4nagios

环境:centos6.2 1.下载并安装epel包 links    http://fedoraproject.org/wiki/EPEL 2.安装nagios及插件 yum install nagios nagios-nrpe nagios-plugins* -y 3.启动httpd service httpd start;chkconfig httpd on 4.创建管理用户 htpasswd -cm /etc/nagios/passwd user1 5.更改默认的管理用户名 vim /et

linux系统下Nagios+rrdtool+Pnp4nagios监控环境的搭建

环境中的软件版本>>>>>>>>>>>>>>>>>>nagios版本:3.5.1rrdtool版本:1.3.8pnp4nagios版本:0.6.21 一.第一部分:nagios服务的部署安装  (1)安装nagios服务所需的依赖 [[email protected]_server ~]# yum install yum install gcc make -y //nagios源码安装需要 [[em

开源监控解决方案Nagios+Cacti+PNP4Nagios+NConf+NDOUtils+Nagvis(一)介绍

以nagios为核心.伴以多款开源软件来进行的整合部署,从而实现监控信息图形化.web页面定义监控配置.监控信息存储.图形化监控主机和服务等一系列功能的解决方案. pnp4nagios是基于RRD轮循(环状)数据库中所提供的综合信息,以可视化图形的方式呈现给用户的一款nagios插件:nconf是基于PHP使用户通过web页面实现对nagios各项属性进行配置,诸如模板定义.添加修改监控的主机/服务等操作:ndoutils可以导出nagios通过SNMP捕获到的当前和历史数据并存储到MySQL数

nagios安装(nrpe安装)

nagios文件目录: bin目录用来存放nagios的执行程序,包括nagios.nrpe等. etc目录用来存放nagios的配置文件. libexec目录用来存放nagios的监控插件. sbin目录用来存放nagios cgi文件,也就是执行外部命令所需文件所在的目录. share目录用来存放nagios网页文件,也就是存放web页面的目录. include目录用来存放nagios cgi文件的外部调用. var目录用来存放nagios日志文件.lock文件等文件. nagios配置文件

Nagios安装部署

p.MsoNormal,li.MsoNormal,div.MsoNormal { margin: 0cm; margin-bottom: .0001pt; line-height: 150%; font-size: 13.5pt; font-family: "Calibri", "sans-serif" } h1 { margin-top: 17.0pt; margin-right: 0cm; margin-bottom: 16.5pt; margin-left:

nagios安装配置

nagios 简介 Nagios是一款开源的电脑系统和网络监视工具,能有效监控Windows.Linux和Unix的主机状态,交换机路由器等网络设置,打印机等.在系统或服务状态异常时发出邮件或短信报警第一时间通知网站运维人员,在状态恢复后发出正常的邮件或短信通知. Nagios原名为NetSaint,由Ethan Galstad开发并维护至今.NAGIOS是一个缩写形式: "Nagios Ain't GonnaInsist On Sainthood" Sainthood 翻译为圣徒,而

nagios结合pnp4nagios图表

安装rrdtool 网址:https://www.oetiker.ch/en/oss/projects/ cd /usr/local/src wgethttp://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz tar -zxvf rrdtool.tar.gz cd rrdtool-1.4.9/ yum install -y pango*                #./configure依赖的包 yum install –y perl-ExtUtils-