2012、09、04 

修改了之前的文档,之前用的是apache做web服务器,可以在多次安装后发现个别情况会出现环境搭建完成后,访问smokeping页面是500内部错误。这次我换成了IIS+FCGI做web服务器,这样一来在windows平台上应该是不会有疑难杂症了。

文档下载地址 http://115.com/file/bed1wl9l

PS:由于115关闭了大众分享功能,现在需要下载别人分享的文件需要加主人为好友才能下载,所以需要这个文档的朋友请加我115好友,在下载页面就有我的账号。

以下为word粘贴上来的。

 

 

 

Smokeping2.6.8 For Windows With IIS FCGI

一、        软件准备

Perl (choose Perl 5.8.xxx MSI package for Windows)
ActivePerl-5.8.7.815-MSWin32-x86-211909.msi
下载地址: http://download.csdn.net/detail/xxh2002/2395097
115 网盘地址 http://115.com/file/bed1wl9l
RRDS module for Perl
rrdtool-1.2.10-win32-perl58.zip
下载地址: http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.10-win32-perl58.zip
115 网盘下载地址 http://115.com/file/an7pjgn9
fping for windows
下载地址: http://dev.pulsed.net/misc/fping.zip
115 网盘下载地址 http://115.com/file/e7kcs6fe
Smokeping
smokeping-2.6.8.tar.gz
下载地址: http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz
115 网盘下载地址 http://115.com/file/an7pjipq
Notepad++
当然也可以用自己使用顺手的文本编辑器
Web Server
IIS6.0(之前用Apach+FCGI 做web,偶尔未知情况会出现500错误,找不到原因,所以在这里修改为IIS+FCGI做web服务器)

二、        软件安装

1.安装 Activestate Perl,运行ActivePerl-5.8.7.815-MSWin32-x86-211909.msi,默认路径为c:/Perl ,安装完成后重启系统.
PS:Other Way 添加系统变量perl 路径为c:/perl/bin/perl.exe

2.安装RRDtool  for windows ,解压后运行install.cmd 默认安装就行.

3.解压 smokeping 到 c:\smokeping
4.解压 Fping (cygwin1.dll和fping.exe)到C:\smokeping\fping
5.IIS
三、    软件配置
       1.Activestate Perl
       首先要安装两个扩展插件Grammar、 FCGI
       方法:
       命令提示符窗口输入cmd
        #ppm
    #search grammar

        #install 1

 

Smokeping 2.6.8 For Windows with IIS FCGI安装教程_第1张图片

#search fcgi
Install 3

 

Smokeping 2.6.8 For Windows with IIS FCGI安装教程_第2张图片

       2) C:\smokeping\bin\smokeping 改名为smokeping.pl

C:\smokeping\bin\tSmoke 改名为 tSmoke.pl

复制C:\cmokeping\etc\config.dist 并改名为 config

 
       3) 编辑
C:\smokeping\bin\smokeping.pl
              第10行下面添加use lib qw(C:\smokeping\lib);
第14行 Smokeping::main("etc/config.dist");
改为Smokeping::main("C:/smokeping/etc/config");
C:\smokeping\bin\tSmoke.pl
第66行my $cfgfile = "etc/config.dist";

改为my $cfgfile = "C:\smokeping\etc\config ";

C:\smokeping-\lib\Smokeping.pm
注释以下几行

  (line 16): use Sys::Syslog qw(:DEFAULT setlogsock); into #use Sys::Syslog qw(:DEFAULT setlogsock);

  (line 31): $ENV{LC_NUMERIC}='C'; into #$ENV{LC_NUMERIC}='C'; 

  (line 32-61): 注释掉程序if (setlocale(LC_NUMERIC,"") ne "C")

  (line 4211): daemonize_me $cfg->{General}{piddir}."/smokeping.pid"; into #daemonize_me $cfg->{General}{piddir}."/smokeping.pid";

  (line 4117-4118)注释掉对secret.txt访问权限的判断
 
4)
创建文件夹 c:\smokeping\cgi 并赋予user组“完全控制权限”
复制C:\smokeping\bin\smokeping_cgi到c:\smokeping\cgi并且改名为smokeping.pl
5) 编辑c:\smokeping\cgi\smokeping.pl
       第一行修改为 #! C:\perl\bin\perl.exe –w
       第11行添加 use lib qw(C:\smokeping\lib);

       第21行 my $cfg = (shift @ARGV) || "$FindBin::Bin/../etc/config";

       修改为 my $cfg = (shift @ARGV) || "c:/smokeping/etc/config.dist";(这里跟c:/smokeping/bin/smokeping.pl里面的使用的不是同一个config文件)

E) 创建文件夹 c:\smokeping\www\simg          c:\smokeping\var

F) 编辑C:\smokeping\etc\config(For c:/smokeping/bin/smokeping.pl) 和C:\smokeping\etc\config.dist(for c:/wamp/cgi/smokeping.pl)

以下内容红色部分为修改的内容,需要注意路径

*** General ***

 
owner    = tingshow
contact  = [email protected]

mailhost = smtp.qq.com

#sendmail = /usr/sbin/sendmail

# NOTE: do not put the Image Cache below cgi-bin

# since all files under cgi-bin will be executed ... this is not

# good for p_w_picpaths.

imgcache = c:/smokeping/www/simg
imgurl   = ../simg

datadir  = \smokeping/var # designate implicitly c:\smokeping\var (for c:/smokeping/bin/smokeping.pl )

datadir  = c:/smokeping/var # designate implicitly c:\smokeping\var (For c:/wamp/cgi/smokeping.pl)

piddir  = C:/smokeping/var

cgiurl   = http://127.0.0.1/cgi-bin/smokeping.pl

smokemail = C:/smokeping/etc/smokemail.dist
tmail = C:/smokeping/etc/tmail.dist

# specify this to get syslog logging

#syslogfacility = local0

# each probe is now run in its own process

# disable this to revert to the old behaviour

# concurrentprobes = no

 

*** Alerts ***

to = [email protected]

from = [email protected]

 
+someloss

type = loss

# in percent

pattern = >0%,*12*,>0%,*12*,>0%

comment = loss 3 times  in a row

 

*** Database ***

 
step     = 300
pings    = 20
 

# consfn mrhb steps total

 

AVERAGE  0.5   1  1008

AVERAGE  0.5  12  4320

    MIN  0.5  12  4320

    MAX  0.5  12  4320

AVERAGE  0.5 144   720

    MAX  0.5 144   720

    MIN  0.5 144   720

 

*** Presentation ***

charset = gb2312

template = C:/smokeping/etc/basepage.html.dist
 

+ charts

 

menu = Charts

title = The most interesting destinations

 

++ stddev

sorter = StdDev(entries=>4)

title = Top Standard Deviation

menu = Std Deviation

format = Standard Deviation %f

 

++ max

sorter = Max(entries=>5)

title = Top Max Roundtrip Time

menu = by Max

format = Max Roundtrip Time %f seconds

 

++ loss

sorter = Loss(entries=>5)

title = Top Packet Loss

menu = Loss

format = Packets Lost %f

 

++ median

sorter = Median(entries=>5)

title = Top Median Roundtrip Time

menu = by Median

format = Median RTT %f seconds

 

+ overview

 

width = 600

height = 50

range = 10h

 

+ detail

 

width = 600

height = 200

unison_tolerance = 2

 

"Last 3 Hours"    3h

"Last 30 Hours"   30h

"Last 10 Days"    10d

"Last 400 Days"   400d

 

#+ hierarchies

#++ owner

#title = Host Owner

#++ location

#title = Location

 

*** Probes ***

 

+ FPing

 
binary = c:/smokeping/fping/fping.exe
 

#*** Slaves ***

#secrets=c:/smokeping/etc/smokeping_secrets.dist
#+boomer
#display_name=boomer
#color=0000ff
 
#+slave2
#display_name=another
#color=00ff00
 

*** Targets ***

 

probe = FPing

 

menu = Top

title = Network Latency Grapher

remark = Welcome to the SmokePing website of xxx Company. \

        # Here you will learn all about the latency of our network.

+IDC

menu = IDC Network

title = All IDC Networkinfo

++HeNan

menu = 河南电信

title = HeNan Tel

host = 219.150.150.150

++QiAi365Movie

menu = 奇爱365影视

title = 奇爱365影视连接信息

host = www.qiai365.com.

 
四、配置IIS
1.添加一个站点,目录为c:\smokeping\www

在此站点创建虚拟目录

Smokeping 2.6.8 For Windows with IIS FCGI安装教程_第3张图片

命名为cgi-bin,路径为c:\smokeping\cgi\
2.添加web服务扩展

Smokeping 2.6.8 For Windows with IIS FCGI安装教程_第4张图片

扩展名为cgi perl
要求的文件为c:\perl\bin\perl “%s” %s
3.修改网站属性

Smokeping 2.6.8 For Windows with IIS FCGI安装教程_第5张图片

 
至此安装完成!
 
Smokeping的使用
启动Smokeping批处理
Call perl C:\smokeping\bin\smokeping.pl

Smokeping 2.6.8 For Windows with IIS FCGI安装教程_第6张图片

显示上面的内容表示启动成功(Alert之前的内容)。
访问WEB页面
http://127.0.0.1/cgi-bin/smokeping.pl
 
web 页面如下图

Smokeping 2.6.8 For Windows with IIS FCGI安装教程_第7张图片

出现的一些问题解决方法
1. 访问web页面提示

ERROR: Cannot parse DS in 'DEF:ping1=c:/smokeping/var/LuoYangIDC/UnkownServer.rrd:ping1:AVERAGE'

c:/wamp/www/simg/LuoYangIDC/UnkownServer_last_10800.png
解决方法

修改/wamp/cgi/smokeping.pl 查找my $cfg = (shift @ARGV) || "c:/smokeping/etc/config";修改为my $cfg = (shift @ARGV) || "c:/smokeping/etc/config.dist";然后把c:/smokeping/etc/config复制一份重命名为config.dist ,修改config.dist里面datadir  = c:/smokeping/var # designate implicitly c:\smokeping\var 把 红色部分修改为\smokeping/var