Ubuntu下nagios安裝pnp4nagios外掛
Ubuntu下nagios安裝pnp4nagios外掛:
# apt-get install rrdtool
# apt-get install librrds-perl
# apt-get install php5 php5-gd
# tar zxvf pnp4nagios-0.6.6.tar.gz
# cd pnp4nagios-0.6.6
# /configure –with-nagios-user=nagios –with-nagios-group=nagios
# make all
# make install
# make install-config
# make install-init
# mv sample-config/httpd.conf sample-config/nagiosweb.conf
# cp sample-config/nagiosweb.conf /etc/apache2/conf.d/
# vi /etc/apache2/conf.d/nagiosweb.conf
AuthType /usr/local/nagios/etc/htpasswd (原為AuthType /usr/local/nagios/etc/htpasswd.users)
:wq
# service apache2 restart
# 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
啟動npcd服務
# service npcd start
# vi /usr/local/nagios/etc/nagios.cfg (把前面的註釋符”#”去掉)
process_performance_data=1 (原為process_performance_data=0)
host_perfdata_command=process-host-perfdata
service_perfdata_command=process-service-perfdata
:wq
# vi /usr/local/nagios/etc/objects/commands.cfg
# `process-host-perfdata` command definition
define command{
command_name process-host-perfdata
command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl
}
# `process-service-perfdata` command definition
define command{
command_name process-service-perfdata
command_line /usr/local/pnp4nagios/libexec/process_perfdata.pl
}
:wq
注:要註釋掉原有對process-service-perfdata和process-host-perfdata的定義
為主機新增小太陽圖示
# vi /usr/local/nagios/etc/objects/yang.cfg
define host {
use linux-server
host_name yang
address 192.168.1.10
action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$
}
:wq
為單個服務新增小太陽圖示
# vi /usr/local/nagios/etc/objects/yang.cfg
define service {
use generic-service
host_name yang
service_description check_load
check_command check_nrpe!check_load
normal_check_interval 2
action_url /pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$
}
:wq
重啟 nagios 服務
# service nagios restart
# mv /usr/local/pnp4nagios/share/install.php /usr/local/pnp4nagios/share/install2.php (或者直接刪除)
注:點選小太陽圖示後會出現個測試頁面,各項要求都PASS了,會提示你重新命名或刪除install.php檔案,原因不詳
# ls /usr/local/pnp4nagios/var/perfdata (看下面有沒有nagios中定義的主機名目錄以及目錄下面有沒有對應服務的rrd檔案和xml檔案)
注:nagio影像(pnp4nagios)只能顯示nagios外掛中的服務,以指令碼監控的服務不顯示影像
本文轉自linux部落格51CTO部落格,原文連結http://blog.51cto.com/yangzhiming/1380537如需轉載請自行聯絡原作者
yangzhimingg
相關文章
- ubuntu 常用外掛安裝Ubuntu
- ubuntu下安裝 Sublime Text 3 及 PlantUML 繪圖外掛Ubuntu繪圖
- ubuntu 安裝瀏覽器flash外掛Ubuntu瀏覽器
- Ubuntu中給ff安裝flash 外掛Ubuntu
- jmeter下載安裝及外掛安裝JMeter
- cacti+nagios 之cacti外掛安裝monitor和ntop(五)iOS
- Eclipse下安裝Flex外掛EclipseFlex
- ubuntu下nagios配置UbuntuiOS
- Mac 下 brew的解除安裝 外掛Mac
- mac 下eclipse安裝lombok外掛MacEclipseLombok
- Redmine外掛的安裝與解除安裝,知識庫外掛安裝。
- retdec 外掛安裝
- Elasticsearch外掛安裝Elasticsearch
- VIM 外掛安裝
- MyEclipse 8.5下安裝tomcat外掛EclipseTomcat
- Ubuntu13.04 Eclipse下編譯安裝Hadoop外掛及使用小例UbuntuEclipse編譯Hadoop
- flash外掛怎麼安裝 電腦安裝flash外掛步驟
- ubuntu安裝scrapy外掛的時候缺失python.hUbuntuPython
- ubuntu系統部署dzzoffice及安裝onlyoffice外掛教程。Ubuntu
- IntelliJ IDEA 如何下載安裝外掛IntelliJIdea
- VSCode安裝離線下載外掛VSCode
- Linux下安裝firefox的flash外掛LinuxFirefox
- Nagios外掛開發指導iOS
- Nagios nsca外掛程式突然死掉iOS
- nagios安裝iOS
- ATOM 安裝外掛
- 如何安裝 Vim 外掛
- php常用外掛安裝PHP
- Sublime安裝PlantUML外掛
- Sublime使用,安裝外掛
- Python 外掛安裝Python
- vim 外掛的安裝
- vim外掛的安裝
- VS Code外掛安裝
- ubuntu下安裝mysqlUbuntuMySql
- ubuntu下安裝oracleUbuntuOracle
- ubuntu下安裝thriftUbuntu
- Ubuntu下安裝CUDAUbuntu