pnp4nagios-0.6.14安裝

來源:互聯網
上載者:User

標籤:pnp4nagios

1.安裝pnp4nagios
tar zxvf

pnp4nagios-0.6.14.tar.gz
cd pnp4nagios-0.6.14
./configure --with-nagios-user=nagios --with-nagios-group=nagcmd
make all
make install
make install-webconf
make install-config
make install-init
2.建立設定檔
cd /usr/local/pnp4nagios/etc
mv misccommands.cfg-sample  misccommands.cfg
mv nagios.cfg-sample  nagios.cfg
mv npcd.cfg-sample npcd.cfg
mv process_perfdata.cfg-sample  process_perfdata.cfg
mv rra.cfg-sample rra.cfg
cd pages
mv web_traffic.cfg-sample web_traffic.cfg
cd ../check_commands
mv check_all_local_disks.cfg-sample  check_all_local_disks.cfg
mv check_nrpe.cfg-sample  check_nrpe.cfg
mv check_nwstat.cfg-sample  check_nwstat.cfg
3.重啟服務
service npcd restart
4.修改nagios.cfg檔案

cd /usr/local/nagios/etc
vim nagios.cfg
process_performance_data=1(把-1改成1)
host_perfdata_command=process-host-perfdata (去掉注釋)
service_perfdata_command=process-service-perfdata(去掉注釋)
cfg_dir=/usr/local/nagios/etc/server
5.修改commands.cfg
cd /usr/local/nagios/etc/objects
vim commands.cfg
# ‘process-host-perfdata‘ command definition
define command{
        command_name process-host-perfdata
        command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl -d HOSTPERFDATA
        }
# ‘process-service-perfdata‘ command definition
define command{
        command_name process-service-perfdata
        command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl
        }
6.添加模板
vim templates.cfg
##在最後添加

define host {
name       host-pnp
action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=_HOST_
register   0
}
define service {
name       srv-pnp
action_url /pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
register   0
}

7.添加hosts.cfg和services.cfg
cd ../server
#修改hosts.cfg
vim hosts.cfg

define host{
        use                     linux-server,host-pnp  
        host_name         server
        alias                     server
        address                 192.168.1.1
        }

#修改services.cfg
vim services.cfg
define service{
                    use                                     local-service,srv-pnp
                   host_name                       server
                   service_description        PING
                   check_command            check_ping!100.0,20%!500.0,60%
               }
8.重啟nagios服務
service nagios restart

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/3E/0D/wKiom1PGEqrS47J3AABTsdLBFRI874.png" style="float:none;" title="99.PNG" alt="wKiom1PGEqrS47J3AABTsdLBFRI874.png" />

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/3E/0D/wKioL1PGE8LAVAj1AAFqvVtAcUk247.png" style="float:none;" title="999.PNG" alt="wKioL1PGE8LAVAj1AAFqvVtAcUk247.png" />


本文出自 “星空” 部落格,謝絕轉載!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.