标签:ssh .com 本地源 部分 4.0 col 创建 文件 --
一、SmokePing简介If you know where perl can find the missing modules, set
the PERL5LIB environment variable accordingly.
FIRST though, make sure that ‘perl‘ starts the perl
binary you want to use for SmokePing.
Now you can install local copies of the missing modules
by running
./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
The RRDs perl module is part of RRDtool. Either use the rrdtool
package provided by your OS or install rrdtool from source.
If you install from source, the RRDs module is located
PREFIX/lib/perl
-------------------------------------------------------------
./configure --prefix=/etc/smokeping
/usr/bin/gmake install
四、下面就是SmokePing的配置了
1、进入/etc/smokeping/目录
cd /etc/smokeping/
2、新建目录cache、data、var,日志log,并修改宿主权限
mkdir cache data var
chown apache:apache cache data var
chown apache:apache /var/log/smokeping.log
touch /var/log/smokeping.log
chown apache:apache /var/log/smokeping.log
修改smokeping_secrets.dist权限
chmod 600 /etc/smokeping/etc/smokeping_secrets.dist
cd /etc/smokeping/htdocs
cp smokeping.fcgi.dist smokeping.fcgi
创建软连接
ln -sd ../cache cache
cd /etc/smokeping/etc
cp config.dist config
修改配置文件
vi config
主要修改如下内容:
#cgiurl = http://some.url/smokeping.cgi
cgiurl = http://10.0.0.62/smokeping.cgi
Database
#step = 300
step = 60 #此处建议改为 60 , 一分钟采集一次数据
pings = 20
修改apache配置
vi /etc/httpd/conf/httpd.conf
末尾添加如下:
# SmokePing
Alias /cache "/etc/smokeping/cache/"
Alias /cropper "/etc/smokeping/htdocs/cropper/"
Alias /smokeping "/etc/smokeping/htdocs/"
<Directory "/etc/smokeping/">
AllowOverride None
Options All
AddHandler cgi-script .fcgi .cgi
DirectoryIndex smokeping.fcgi
Require all granted
</Directory>
如果需要支持中文,需要安装中文编码:
vim /etc/smokeping/etc/config
Presentation
charset = utf-8 #添加此行
vim /etc/smokeping/lib/Smokeping/Graphs.pm
#第160行下边插入下边一行
‘--font TITLE:20:"WenQuanYi Zen Hei Mono"‘,
"DEF:maxping=$cfg->{General}{datadir}${host}.rrd:median:AVERAGE",
设置开机启动
chmod +x /etc/rc.d/rc.local
echo "/etc/smokeping/bin/smokeping --logfile=/var/log/smokeping.log 2>&1 &" >> /etc/rc.local
设置完毕,启动Apache、SmorkePing服务
systemctl restart httpd.service
/etc/smokeping/bin/smokeping
好了,SmokePing设置就好了,打开浏览器输入ip/smokeping,如下图所示:
设置检测源ip,填入到/etc/smokeping/etc/config中
vi /etc/smokeping/etc/config
<Directory "/etc/smokeping/">
AllowOverride None
Options All
AddHandler cgi-script .fcgi .cgi
AllowOverride AuthConfig
Order allow,deny
Allow from all
AuthName "smokeping"
AuthType Basic
AuthUserFile /etc/smokeping/htdocs/htpasswd
Require valid-user
DirectoryIndex smokeping.fcgi
</Directory>
设置访问的用户名和密码
htpasswd -c /etc/smokeping/htdocs/htpasswd admin
New password:
Re-type new password:
Adding password for user admin
重启apache
systemctl restart httpd.service
输入用户名密码就OK了。
标签:ssh .com 本地源 部分 4.0 col 创建 文件 --
原文地址:http://blog.51cto.com/9840752/2133326