Nagios太陽(pnp)安裝配置

2021-05-22 18:30:57 字數 2685 閱讀 7828

一.安裝rrdtool

rrdtool將nagios採集的資料繪製成圖表。

--with-perl-options=/usr/bin/perl 指定perl路徑

#make

#make install

二.安裝pnp

--with-rrdtool=/usr/local/rrdtool/bin/rrdtool/ 指定rrdtool路徑

--with-perfdata-dir=/usr/local/nagios/share/perfdata/ 指定perfdata存放路徑

general options:

nagios user/group: nagios nagios

install directory: /usr/local/nagios

html dir: /usr/local/nagios/share/pnp

config dir: /usr/local/nagios/etc/pnp

location of rrdtool binary: /usr/local/rrdtool/bin/rrdtool version 1.4.3

rrds perl modules: found (version 1.4003)

rrd files stored in: /usr/local/nagios/share/perfdata/

process_perfdata.pl logfile: /usr/local/nagios/var/perfdata.log

perfdata files (npcd) stored in: /usr/local/nagios/var/spool/perfdata/

#make all

#make install

#make install-config

#make install-init

三.配置nagios

#vi /usr/local/nagios/etc/nagios (在880行左右)

process_performance_data=1 //開啟收集perfdata(預設是關閉的)

host_perfdata_command=process-host-perfdata

service_perfdata_command=process-service-perfdata

#vi /usr/local/nagios/etc/objects/commands.cfg

增加對process-host-perfdata,process-service-perfdata命令的定義

define command{

command_name process-service-perfdata //定義命令名稱

command_line /usr/local/nagios/libexec/process_perfdata.pl //指定命名

define command{

command_name process-service-perfdata

command_line /usr/local/nagios/libexec/process_perfdata.pl

# vi /usr/local/nagios/etc/objects/templates.cfg

新增太陽圖示,配置前端頁面

define service{

name generic-service

process_perf_data 1 //開啟收集perfdata

action_url /nagios/pnp/index.php?host=$hostname$&srv=$servicedesc$ //定義url

define service{

name local-service

use generic-service

action_url /nagios/pnp/index.php?host=$hostname$

process_perf_data 1

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg 檢測配置

#service nagios restart

四.驗證

參考資料:http://docs.pnp4nagios.org/pnp-0.4/start

nagios安裝配置

上線的伺服器有時會被人攻擊,導致服務不可用,今天安裝配置了nagios對上線伺服器進行監控,簡單記錄一下 安裝必要的軟體包 yum install y gcc glibc glibc common gd gd devel xinetd openssl devel 建立nagios使用者及授予目錄許可...

nagios安裝配置

nagios官網上2013 10 15更新了最新版nagios 4.0.1 install init 需root make install commandmode make install config make install webconf 需root 安裝nagios 外掛程式 tar zxv...

nagios 外掛程式ndoutils 安裝配置

nagios 外掛程式ndoutils 安裝配置 nagios install ndoutils 安裝ndoutils外掛程式 root cagios ndoutils 2.0.0 chown nagios.nagcmd usr local nagios etc ndo root cagios nd...