centos6.5下smokeping搭建

smokeping搭建

环境:centos6.5

防火墙关掉。selinux禁用

yum源:163,epel

rpm �CUvh http://mirrors.neusoft.edu.cn/epel/6/i386/epel-release-6-8.noarch.rpm 

安装依赖包

yum install libxml2-devel  libpng-devel pango  pango-devel libart_lgpl  libart_lgpl-devel freetype freetype-devel  fontconfig  cairo cairo-devel

yum -y install httpd  httpd-devl

yum -y install perl-ExtUtils-MakeMaker

yum -y install perl-CGI

yum -y install perl-FCGI

yum -y install fping

wget http://search.cpan.org/CPAN/authors/id/D/DS/DSCHWEI/Config-Grammar-1.10.tar.gz


tar -zxvf Config-Grammar-1.10.tar.gz  

cd Config-Grammar-1.10    

perl Makefile.PL   

make && make install 



tar zxvf rrdtool-1.4.3.tar.gz 

cd rrdtool-1.4.3

./configure --prefix=/usr/local/rrdtool

make 

make install



tar zxvf smokeping-2.6.8.tar.gz 

cd smokeping-2.6.8

./configure --prefix=/usr/local/smokeping

make 

make install


配置smokeping


cd /usr/local/smokeping

mkdir {data,cache,var}

chown -R apache.apache cache/ var/ data/

cp etc/config.dist etc/config

cd htdocs

cp smokeping.fcgi.dist smokeping.fcgi

cd /var/www/html/

ln -s /usr/local/smokeping/htdocs/ smokeping

cd /usr/local/smokeping/htdocs/

ln -s /usr/local/smokeping/cache/ cache

ln -s smokeping.fcgi smokeping.cgi

vim /usr/local/smokeping/etc/config

cgiurl   = http://192.168.32.130/smokeping/smokeping.cgi

binary = /usr/sbin/fping

1.页面支持中文


在配置文件的*** Presentation ***下添加

charset = utf-8


2.rrd图片支持中文


yum -y install wqy-zenhei-fonts.noarch


修改配置文件/opt/smokeping-2.6.9/lib/Smokeping/Graphs.pm ,插入这句'--font TITLE:20:"WenQuanYi Zen Hei Mono"',


vim /usr/local/smokeping/etc/config

#监控示范

+ zhoufujin

menu = zhoufujin

title = zhoufujin

host = 192.168.32.130


vim /usr/local/smokeping/bin/smokeping

use lib qw(/usr/local/rrdtool/lib/perl/5.10.1)


chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist


vim /etc/httpd/conf/httpd.conf

    Options Indexes FollowSymLinks ExecCGI

AddHandler cgi-script .cgi

启动httpd服务

/etc/init.d/httpd start

chkconfig httpd on

/usr/local/smokeping/bin/smokeping --config=/usr/local/smokeping/etc/config

访问

http://192.168.32.130/smokeping/smokeping.cgi


注意每次添加主机后都要杀掉smokeping进程。再重启动

 

搜集各个地方ip地址的网址:http://ip.yqie.com/search.aspx?searchword=

你可能感兴趣的:(centos,流量监控,smokeping)