标签:lib page password tcp gpl 示例 pat hub 注意事项
参考文档:
本文简单介绍smokeping的安装配置操作。
Server:10.11.4.250/CentOS-7-x86_64-1511
smokeping-2.6.11:http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz
#epel版本有可能变更,变更后不一定能下载 [root@smokeping ~]# rpm -Uvh http://download.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-10.noarch.rpm [root@smokeping ~]# yum install foo -y
#其中本人遇到的问题有,未预安装"wqy*"导致中文显示的问题;没有预安装"perl-Sys-Syslog",在"gmake install"阶段有报错 [root@smokeping ~]# yum install -y rrdtool wqy* fping echoping curl bind-utils httpd httpd-devel perl perl-FCGI perl-CGI perl-CGI-SpeedyCGI perl-CGI-SpeedyCGI perl-libwww-perl perl-Socket6 perl-Net-Telnet perl-Net-OpenSSH perl-Net-DNS perl-LDAP perl-IO-Socket-SSL perl-ExtUtils-MakeMaker rrdtool-perl perl-Sys-Syslog perl-RadiusPerl perl-Time-HiRes perl-RRD-Simple libxml2-devel libpng-devel glib pango pango-devel freetype freetype-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-devel mod_fastcgi
#请注意在configure前需要先build相应的perl模块,否则有报错。 [root@smokeping ~]# cd /usr/local/src/ [root@smokeping src]# wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.11.tar.gz [root@smokeping src]# tar -zxvf smokeping-2.6.11.tar.gz [root@smokeping src]# cd smokeping-2.6.11 [root@smokeping smokeping-2.6.11]# ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty [root@smokeping smokeping-2.6.11]# ./configure --prefix=/usr/local/smokeping [root@smokeping smokeping-2.6.11]# gmake install
#创建程序运行相关目录并赋权
[root@smokeping smokeping-2.6.11]# cd /usr/local/smokeping/
[root@smokeping smokeping]# mkdir var cache data
[root@smokeping smokeping]# chown apache:apache var/ cache/ data/
#生成cgi文件与config文件
[root@smokeping smokeping]# cp /usr/local/smokeping/htdocs/smokeping.fcgi.dist /usr/local/smokeping/htdocs/smokeping.fcgi
[root@smokeping smokeping]# cp /usr/local/smokeping/etc/config.dist /usr/local/smokeping/etc/config
#修改 cgiurl,General及Alerts等是config文件多个section之一
[root@smokeping smokeping]# sed -i ‘s|some.url|10.11.4.250|g‘ /usr/local/smokeping/etc/config
#someloss部分注释默认配置,重设监测机制
[root@smokeping smokeping]# vim /usr/local/smokeping/etc/config
+someloss
type = loss
# in percent
#pattern = >0%,*12*,>0%,*12*,>0%
#comment = loss 3 times in a row
pattern = ==0%,>2%,>2%,>2%
comment = 每次发出60个包,连续3次轮询检查丢包率在2%以上
#新增rtt监测机制
+rttdetect
type = rtt
# in milliseconds
pattern = <55,<55,<55,>55,>55,>55
comment = 每次发出60个包,连续3次轮询检查延时超过55毫秒
# 默认300秒 ping 20次,修改为120秒 ping 30次
[root@smokeping smokeping]# sed -i ‘s|step = 300|step = 120|g‘ /usr/local/smokeping/etc/config
[root@smokeping smokeping]# sed -i ‘s|pings = 20|pings = 30|g‘ /usr/local/smokeping/etc/config
#在presentation下添加utf-8中文字符集
*** Presentation ***
charset = utf-8
#在presentation下detail部分,注释默认历史数据展示时间,重设数值
+ detail
width = 600
height = 200
unison_tolerance = 2
#"Last 3 Hours" 3h
#"Last 30 Hours" 30h
#"Last 10 Days" 10d
#"Last 400 Days" 400d
"Last 10 Minutes" 10m
"Last 30 Minutes" 30m
"Last 4 Hours" 4h
"Last 12 Hours" 12h
"Last 1 Days" 24h
"Last 3 Days" 3d
"Last 1 Weeks" 7d
"Last 1 Mouths" 30d
"Last Half years" 180d
"Last 1 years" 365d
#修改密码文件权限为root只读
[root@smokeping smokeping]# chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist
#设置登录账户及密码
[root@smokeping smokeping]# htpasswd -c /usr/local/smokeping/htdocs/htpasswd mcloudadmin
New password:
Re-type new password:
#httpd文件配置,在"DocumentRoot "/var/www/html""段下新增smokeping相关配置,请注意路径等强相关设置的前后一致性
[root@smokeping smokeping]# vim /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html"
Alias /cache "/usr/local/smokeping/cache/"
Alias /cropper "/usr/local/smokeping/htdocs/cropper/"
Alias /smokeping "/usr/local/smokeping/htdocs/smokeping.fcgi"
<Directory "/usr/local/smokeping">
AllowOverride None
Options All
AddHandler cgi-script .fcgi .cgi
Order allow,deny
Allow from all
AuthName "Smokeping"
AuthType Basic
AuthUserFile /usr/local/smokeping/htdocs/htpasswd
Require valid-user
DirectoryIndex smokeping.fcgi
</Directory>
[root@smokeping smokeping]# vim /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
[root@smokeping smokeping]# service iptables restart
[root@smokeping smokeping]# echo "/usr/local/smokeping/bin/smokeping &">> /etc/rc.local
添加smokeping监控点本质上还是修改config文件,主要修改"Targets"章节。
注意事项:
以下是一个简单的两层目录层级配置示例:
[root@smokeping smokeping]# vim /usr/local/smokeping/etc/config
*** Targets ***
probe = FPing
menu = Top
title = 网络质量监测系统
remark = SmokePing.<br> \
您在这里可以观察到网络质量.
+ IDC
menu = IDC网络质量
title = 网络质量监控统计
++ All_Monitor
menu = 网络质量总图
title = 网络质量总图
host = /IDC/CoreSwitch /IDC/AccessSwitch
++ CoreSwitch
menu = 监控点至核心
title = 监控点至核心
alerts = someloss
host = 10.10.24.1
++ AccessSwitch
menu = 监控点至接入
title = 监控点至接入
alerts = someloss
host = 10.11.4.1
[root@smokeping ~]# systemctl start httpd
[root@smokeping ~]# /usr/local/smokeping/bin/smokeping &
URL登录:http://10.11.4.250/smokeping
输入前文设置的apache账号/密码登录,即可登录smokeping控制台。
可以看到,登录账号为前文设置的mcloudadmin,首页及左侧目录都是在config文件的"Targets"章节做的设置。
在config文件Presentation章节的detail部分设置。
在config文件Database章节。
标签:lib page password tcp gpl 示例 pat hub 注意事项
原文地址:http://www.cnblogs.com/netonline/p/7773909.html