rgbnj 发表于 2015-11-23 08:00:22

[nagios监控] 利用PNP 绘制历史曲线

1 安装软件包
   # yum install zlib gd gd-devel rrdtool php-gd

2 安装pnp
   # wget http://downloads.sourceforge.net/pnp4nagios/pnp-0.4.14.tar.gz
   # tar -zxvf pnp-0.4.14.tar.gz
   # cd pnp-0.4.14
   # ./configure --with-rrdtool=/usr/bin/rrdtool
   # make all
   # make install
   # make install-config
   # make install-init

3 编辑配置文件
   # vim /etc/httpd/conf/httpd.conf
            DirectoryIndex index.html index.html.var index.php


   # vim /usr/local/nagios/etc/nagios.cfg
            process_performance_data=1
            host_perfdata_command=process-host-perfdata
            service_perfdata_command=process-service-perfdata
   
   # vim /usr/local/nagios/etc/objects/templates.cfg
            define host{
            name                            generic-host    ; The name of this host template
            notifications_enabled         1               ; Host notifications are enabled
            event_handler_enabled         1               ; Host event handler is enabled
            flap_detection_enabled          1               ; Flap detection is enabled
            failure_prediction_enabled      1               ; Failure prediction is enabled
            process_perf_data               1               ; Process performance data
            retain_status_information       1               ; Retain status information across program restarts
            retain_nonstatus_information    1               ; Retain non-status information across program restarts
            notification_period             24x7            ; Send host notifications at any time
            register                        0               ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
            process_perf_data       1
            action_url/pnp/index.php?host=$HOSTNAME$
            }


            define host {
            name       host-pnp
            process_perf_data       1
            action_url/pnp/index.php?host=$HOSTNAME$
            register   0
            }

            define service {
            name       service-pnp
            process_perf_data       1
            action_url/pnp/index.php?host=$HOSTNAME$&srv=$SERVICEDESC$
            register   0
            }
4重启httpd和nagios
    #service httpd restart
  #service nagios restart
  

  签名
=============================
比特币打赏地址   
1MtPqjhqpX82Mac4Lxs6DveUo6g4wxb53w

莱特币打赏地址
LRGo1YynKBtnC12GqMb7BxU8iA5q2R8aqk
=============================
页: [1]
查看完整版本: [nagios监控] 利用PNP 绘制历史曲线