smokeping(如何在windows下安装smokeping)
亲爱的读者们,你是否对smokeping和如何在windows下安装smokeping的相关问题感到困惑?别担心,今天我将为你解答这些问题,让你对此有更清晰的认识。
安装smokeping后提示500错误,求大神指点迷津
1 smokeping监控安装
yum install-y httpd
yum install-y rrdtool
yum install-y fping
yum install-y echoping
yum install-y curl
yum install-y perl perl-Net-Telnet perl-Net-DNS perl-LDAP perl-libwww-perl perl-RadiusPerl perl-IO-Socket-SSL perl-Socket6 perl-CGI-SpeedyCGI perl-FCGI
解压smokeping源码包
tar xvf smokeping-2.6.9.tar.gz
编译安装
cd smokeping-2.6.9
./configure--prefix=/usr/local/smokeping
编译过程提示缺少东西,运行一个脚本
./setup/build-perl-modules.sh/usr/local/smokeping/thirdparty
完成后再次configure
./configure--prefix=/usr/local/smokeping
之后提示使用gmake安装
/usr/bin/gmake install
安装完成后进入smokeping目录
cd/usr/local/smokeping
创建需要用到的目录
mkdir var
mkdir cache
mkdir data
修改权限
chmod 777-R var
chmod 777-R cache
chmod 777-R data
chmod 600 etc/smokeping_secrets.dist
属主改为httpd的用户
chown-R apache.apache/usr/local/smokeping
创建日志文件并修改属主
touch/var/log/smokeping.log
chown apache.apache/var/log/smokeping.log
进入htdocs目录重命名smokeping.fcgi.dist
mv smokeping.fcgi.dist smokeping.fcgi
进入bin目录下修改smokeping文件
use lib qw();# PERL5LIB
修改为(根据实际路径来,yum安装perl的为这个目录)
use lib qw(/usr/lib/perl5/5.8.8);# PERL5LIB
进入etc目录修改config文件
mv config.dist config
修改config
---------------------------------------------------------------------------------------------------------------------------
*** General***
owner= Peter Random《--------------------所有人
contact= some@address.nowhere《--------------------管理员地址
mailhost= my.mail.host
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 images.
imgcache=/usr/local/smokeping/cache
imgurl= cache
datadir=/usr/local/smokeping/data
piddir=/usr/local/smokeping/var
cgiurl= http://192.168.1.158/smokeping.cgi《-------本机的iP或者域名
smokemail=/usr/local/smokeping/etc/smokemail.dist
tmail=/usr/local/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= alertee@address.somewhere《-------------警报邮件地址(可以无视)
from= smokealert@company.xy
+someloss
type= loss
# in percent
pattern=>0%,*12*,>0%,*12*,>0%
comment= loss 3 times in a row
*** Database***
step= 30《----------------------数据刷新时间默认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= utf-8《-----------------------添加语言支持,不然乱码
template=/usr/local/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=/usr/sbin/fping
*** Slaves***
secrets=/usr/local/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.
+ Test《--------------一个样本的开始
menu= Targets《--------菜单名字
#parents= owner:/Test/James location:/
++ James《----------2级目录
menu= James《------------2级目录名字
title=见鬼《------------标题
host= 192.168.1.158《-------哪台主机
-------------------------------------------------------------------------------------
修改httpd配置文件
vi/etc/httpd/conf/httpd.conf
添加
Alias/smokeping"/usr/local/smokeping/htdocs/smokeping.fcgi"
Alias/cache"/usr/local/smokeping/cache"
Alias/cropper"/usr/local/smokeping/htdocs/cropper"
<Directory/usr/local/smokeping>
AllowOverride None
AddHandler cgi-script cgi fcgi
Options ExecCGI
Order allow,deny
Allow from all
DirectoryIndex smokeping.cgi
</Directory>
重启httpd
service httpd restart
启动smokeping
perl/usr/local/smokeping/bin/smokeping--logfile=/var/log/smokeping.log
访问smokeping(本次样本为192.168.1.158地址)
http://192.168.1.158/smokeping
关闭smokeping
ps-ef| grep smokeping
找到进程号
kill-9进程号
我自己写的你看下吧哪里出现问题
如何在windows下安装smokeping
如何在windows下安装smokeping
1) smokewhat?
Smokeping(link) is a nice latency measurement tool, unfortunately it WAS only available for linux/unix…but after the jump, you’ll find how to make it work under Microsoft
Windows!
SmokePing is a deluxe latency measurement tool. It can measure, store and display latency, latency distribution and packet loss. SmokePing uses RRDtool to maintain a longterm
data-store and to draw pretty graphs, giving up to the minute information on the state of each network connection
2)你需要作的准备工作
-perl(选择windows下的perl 5.8.xxx的msi的包)
perl非常的酷并且在使用的过程中你会发现他的功能非常强大
-RRDs Perl的模块
这个版本工作起来稳定,而且你可以免费的下载到最新的版本
-fping windows版本的fping(感谢Michael Parson)
-smokeping 2.0.9
这个版本工作起来稳定,而且你可以免费的下载到最新的版本
-a text editor
(本人注:就是一个编辑器,可以使用记事本或者写字板或者dreamwave来代替,我在安装的过程中没有用到它,我感觉写字板足够用了,而且用起来老顺手的,呵呵,用习惯了)
-a web server
(本人注:使用iis就可以了,作者本人用的是apache+php+mysql,开源免费,我用的是iis,感觉没什么区别)
3)你不需要什么
-银子
所有的软件几乎都是免费的,作者原话(我们没有选用作者说到文本编辑器和web服务器,所以如果都是正版软件的话,是需要破费的:p)
4)安装
-安装Activestate Perl
-安装windows版本的RRDtool(解压然后运行install.cmd)
-解压缩 smokeping到c:\smokeping-2-0-8
-解压缩 windows版本的fping(请确认cygwin1.dll和fping在同一个目录下)到c:\smokeping-2.0.8\fping
-安装web服务器,建立站点并指定站点根目录为c:\www
5)更改
a)改名
- C:\smokeping-2.0.8\bin\smokeping.dist更改为 smokeping.pl
- C:\smokeping-2.0.8\bin\tSmoke.dist更改为 tSmoke.pl
b)编辑
C:\smokeping- 2.0.8\bin\smokeping.pl
添加(行5后): use lib qw(C:\smokeping-2.0.8\lib);
替换(行 9): Smokeping::main(”etc/config.dist”);替换为 Smokeping::main(”C:/smokeping-2.0.8/etc/config.dist”);
- C:\smokeping-2.0.8\bin\tSmoke.pl
更改(行 63): my$cfgfile=“etc/config.dist”;替换为 my$cfgfile=“C:\smokeping-2.0.8\etc\config.dist”;
- C:\smokeping- 2.0.8\lib\Smokeping.pm
替换(行14): use Sys::Syslog qw(:DEFAULT setlogsock);替换为#use Sys::Syslog qw(:DEFAULT setlogsock);
替换(行 21):$ENV{LC_NUMERIC}=’C';替换为#$ENV{LC_NUMERIC}=’C';
替换(行 22): POSIX::setlocale(&POSIX::LC_NUMERIC,”");替换为#POSIX::setlocale(&POSIX::LC_NUMERIC,”");
替换(行2984): daemonize_me$cfg->{General}{piddir}.”/smokeping.pid”;替换为#daemonize_me$cfg->{General}{piddir}.”/smokeping.pid”;
(jinni注:以下为apache的配置,我用的是iis,所以只建立了iis对perl程序的应用程序影射,略过不谈,不译)“- C:\wamp\Apache2\conf\httpd.conf
change(line 515): ScriptAlias/cgi-bin/“C:/wamp/Apache2/cgi-bin/” into ScriptAlias/cgi-bin/“c:/wamp/cgi/”
change(line 521):<Directory“C:/wamp/Apache2/cgi-bin/”> into<Directory“c:/wamp/cgi”>
c)移动文件和改名
-建立文件夹 c:\www\cgi
- C:\smokeping-2.0.8\htdocs\smokeping.cgi.dist到 c:\wwww\cgi\smokeping.pl
d)编辑
- c:\wwww\cgi\smokeping.pl
替换(行 1):#!/usr/sepp/bin/speedy-w替换为#!C:/Perl/bin/perl.exe-w
替换(行 5): use lib qw(/home/oetiker/data/projects/AADJ-smokeping/dist/lib);替换为 use lib qw(C:\smokeping-2.0.8\lib);
替换(行 10): Smokeping::cgi(”/home/oetiker/data/projects/AADJ-smokeping/dist/etc/config”);替换为 Smokeping::cgi(”C:/smokeping-2.0.8/etc/config.dist”);
6)配置
-建立文件夹
c:\www\simg
c:\smokeping-2.0.8\var
-编辑配置文件(c:\smokeping-2.0.8\etc\config.dist)请寻找一下参数,然后做相应的更改
owner=
contact=
mailhost=
#sendmail=/usr/lib/sendmail<== Comment this line
imgcache= C:/www/simg
imgurl=../simg
datadir=\smokeping-2.0.8/var# designate implicitly c:\smokeping-2.0.8\var
piddir= C:/smokeping-2.0.8/var
cgiurl= http://127.0.0.1/cgi-bin/smokeping.pl
smokemail= C:/smokeping-2.0.8/etc/smokemail.dist
tmail= C:/smokeping-2.0.8/etc/tmail.dist
# syslogfacility= local0<= Comment this line!!!!
*** Alerts***
to=
from=
template= C:/smokeping-2.0.8/etc/basepage.html.dist
+ FPing
binary= C:/smokeping-2.0.8/fping/fping.exe
title=
remark=
# google is for demonstrational purpose only; please refer to smokeping help to set your own targets
menu= Google
title=Google Connectivity
alerts= bigloss,someloss,startloss
host= google.fr
7)测试
-打开命令行,输入c:\smokeping-2.0.8\bin\smokeping.pl
ok,没有错误信息(如果有错误信息,请检查5-a,5-b和6的步骤)
-不要停止这个命令行,让他运行10-15分钟,然后访问http://127.0.0.1/cgi-bin/smokeping.pl
ok,确认没有错误信息显示(如果有,如果是cgi错误,请检查5-b,5-c,5-d和6的步骤,如果是RRD的错误,请检查5-d和6的步骤)
现在关闭cmd.exe(控制台)窗口
8)完成
(jinni注)主要的工作已经做完,下来就是让持续运行的问题,我们可以利用windows的计划任务来完成这个步骤,具体的我就不再写了,我也不翻译了,我相信您一定可以完成
好了,本文到此结束,如果可以帮助到大家,还望关注本站哦!