Nagios太阳(pnp)安装配置
Nagios太阳(pnp)安装配置
一.安装rrdtool
RRDTOOL将nagios采集的数据绘制成图表。
1
2
3
4
5
6
7
8
|
#wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.3.tar.gz
#tar zxvf rrdtool-1.4.3.tar.gz -C ../software
#cd ../softwar/rrdtool-1.4.3
#./configure
--
prefix
=
/
usr
/
local
/
rrdtool
/
--
with
-
perl
-
options
=
/
usr
/
bin
/
perl
指定
perl路径
#make
#make install
|
二.安装pnp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#wget http://downloads.sourceforge.net/project/pnp4nagios/PNP/pnp-0.4.14/pnp-0.4.14.tar.gz?use_mirror=nchc
#tar zxvf pnp-0.4.14.tar.gz -C ../software/
#cd ../software/pnp-0.4.14
#./configure \
--
with
-
nagios
-
user
=
nagios
\
--
with
-
nagios
-
group
=
nagios
\
--
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#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://ip/nagios/pnp/
收 藏
成长的对话版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!