centos6.3 smokeping安装部署
Smokeping 是一款用于网络性能监测的监控软件,通过它可以在自己公司IDC的网络状况,如延时,丢包率,是否BGP多线等,通过rrdtool制图方式,图形化地展示网络的时延情况,进而能够清楚的判断出网络的即时通信情况,
Smokeping 需要多个包的支持,下面我们逐个安装,这里通过yum和编译安装两种方式。(有内置yum包直接yum,没有的编译安装)
yum install -y perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-IO-Socket-SSL perl-Socket6 perl-Time-HiRes perl-ExtUtils-MakeMaker rrdtool rrdtool-perl curl httpd httpd-devel gcc make wget libxml2-devel libpng-devel glib pango pango-devel freetype freetype-devel fontconfig cairo cairo-devel libart_lgpl libart_lgpl-devel
下载fping并编译:
wget http://fping.org/dist/fping-3.10.tar.gz
解压缩后,直接 configure && make && make install 即可
下载echoping并编译安装:
wget http://jaist.dl.sourceforge.net/project/echoping/echoping/6.0.2/echoping-6.0.2.tar.gz
yum install -y popt
yum install -y libidn (安装两个echoping依赖的包)
解压缩后,直接 configure && make && make install 即可
下载smokeping
http://download.csdn.net/download/fairplay_li/8711829
解压; cd smokeping-2.6.9
./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
./configure --prefix=/usr/local/smokeping
/usr/bin/gmake install
以下开始配置 smokeping
[plain] view plain copy
1. cd /usr/local/smokeping/
2. mkdir cache data var
3. touch /var/log/smokeping.log
4. chown apache:apache cache data var
5. chown apache:apache /var/log/smokeping.log
6. chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist
7. cd /usr/local/smokeping/htdocs
8. mv smokeping.fcgi.dist smokeping.fcgi
9. cd /usr/local/smokeping/etc
10. mv config.dist config
vim config
主要修改如下内容:
cgiurl = http://some.url/smokeping.cgi
*** Database ***
step = 300 此处建议改为 60 , 一分钟采集一次数据
vim /etc/httpd/conf/httpd.conf
添加如下:
[plain] view plain copy
1. Alias /cache "/usr/local/smokeping/cache/"
2. Alias /cropper "/usr/local/smokeping/htdocs/cropper/"
3. Alias /smokeping "/usr/local/smokeping/htdocs/smokeping.fcgi"
4. <Directory "/usr/local/smokeping">
5. AllowOverride None
6. Options All
7. AddHandler cgi-script .fcgi .cgi
8. Order allow,deny
9. Allow from all
10. DirectoryIndex smokeping.fcgi
11. </Directory>
如果需要支持中文,需要安装中文编码:
yum -y install wqy-zenhei-fonts.noarch
vim /usr/local/smokeping/lib/Smokeping/Graphs.pm
my ($graphret,$xs,$ys) = RRDs::graph
("dummy",
'--start', $tasks[0][1],
'--end', $tasks[0][2],
后,添加
'--font TITLE:20:"WenQuanYi Zen Hei Mono"',
设置开机启动
echo "/usr/local/smokeping/bin/smokeping --logfile=/var/log/smokeping.log 2>&1 &" >> /etc/rc.local
监测源的IP库,填入到 config 中
[plain] view plain copy
1. + Other
2. menu = 三大网络监控
3. title = 监控统计
4. ++ dianxin
5. menu = 电信网络监控
6. title = 电信网络监控列表
7. host = /Other/dianxin/dianxin-bj /Other/dianxin/dianxin-hlj /Other/dianxin/dianxin-tj /Other/dianxin/dianxin-sc /Other/d
8. ianxin/dianxin-sh /Other/dianxin/dianxin-gz
9. +++ dianxin-bj
10. menu = 北京电信
11. title = 北京电信
12. alerts = someloss
13. host = 202.96.199.133
14.
15. +++ dianxin-hlj
16. menu = 黑龙江电信
17. title = 黑龙江电信
18. alerts = someloss
19. host = 219.147.198.242
20.
21. +++ dianxin-tj
22. menu = 天津电信
23. title = 天津电信
24. alerts = someloss
25. host = 219.150.32.132
26.
27. +++ dianxin-sc
28. menu = 四川电信
29. title = 四川电信
30. alerts = someloss
31. host = 61.139.2.69
32.
33. +++ dianxin-sh
34. menu = 上海电信
35. title = 上海电信
36. alerts = someloss
37. host = 116.228.111.118
38.
39. +++ dianxin-gz
40. menu = 广东电信
41. title = 广东电信
42. alerts = someloss
43. host = 113.111.211.22
44.
45. ++ liantong
46. menu = 联通网络监控
47. title = 联通网络监控列表
48. host = /Other/liantong/liantong-bj /Other/liantong/liantong-hlj /Other/liantong/liantong-tj /Other/liantong/liantong-sc
49. /Other/liantong/liantong-sh /Other/liantong/liantong-gz
50.
51. +++ liantong-bj
52. menu = 北京联通
53. title = 北京联通
54. alerts = someloss
55. host = 61.135.169.121
56.
57. +++ liantong-hlj
58. menu = 黑龙江联通
59. title = 黑龙江联通
60. alerts = someloss
61. host = 202.97.224.69
62.
63. +++ liantong-tj
64. menu = 天津联通
65. title = 天津联通
66. alerts = someloss
67. host = 202.99.96.68
68.
69. +++ liantong-sc
70. menu = 四川联通
71. title = 四川联通
72. alerts = someloss
73. host = 119.6.6.6
74.
75. +++ liantong-sh
76. menu = 上海联通
77. title = 上海联通
78. alerts = someloss
79. host = 210.22.84.3
80.
81. +++ liantong-gz
82. menu = 广东联通
83. title = 广东联通
84. alerts = someloss
85. host = 221.5.88.88
86.
87. ++ yidong
88. menu = 移动网络监控
89. title = 移动网络监控列表
90. host = /Other/yidong/yidong-bj /Other/yidong/yidong-hlj /Other/yidong/yidong-tj /Other/yidong/yidong-sc /Other/yidong/yi
91. dong-sh /Other/yidong/yidong-gz
92.
93. +++ yidong-bj
94. menu = 北京移动
95. title = 北京移动
96. alerts = someloss
97. host = 221.130.33.52
98.
99. +++ yidong-hlj
100. menu = 黑龙江移动
101. title = 黑龙江移动
102. alerts = someloss
103. host = 211.137.241.35
104.
105. +++ yidong-tj
106. menu = 天津移动
107. title = 天津移动
108. alerts = someloss
109. host = 211.137.160.5
110.
111. +++ yidong-sc
112. menu = 四川移动
113. title = 四川移动
114. alerts = someloss
115. host = 218.201.4.3
116.
117. +++ yidong-sh
118. menu = 上海移动
119. title = 上海移动
120. alerts = someloss
121. host = 117.131.19.23
122.
123. +++ yidong-gz
124. menu = 广东移动
125. title = 广东移动
126. alerts = someloss
127. host = 211.136.192.6