下载解压
wget http://oss.oetiker.ch/smokeping/pub/smokeping-2.6.8.tar.gz tar xvzf smokeping-2.6.8.tar.gz cd mokeping-2.6.8 ./configure --prefix=/usr/local/smokeping
如果提示如下 :
** Aborting Configure ****************************** 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
执行
mkdir -p /usr/local/smokeping/thirdparty ./setup/build-perl-modules.sh /usr/local/smokeping/thirdparty
这里可能会出现一般DNS无法解析的情况 改成8.8.8.8测试
如果上述两条命令成功执行还是有此提示 那么应该是PERL5LIB这个环境变量设置的问题
执行
export PERL5LIB=/usr/local/smokeping/thirdparty/lib/perl5
然后继续执行
./configure --prefix=/usr/local/smokeping
完成后执行
gmake install
安装完成
如果没有fping这个命令 则要安装
yum install fping
cd /usr/local/smokeping/etc
前面配置
*** General *** owner = NetWork contact = [email protected] mailhost = localhost #sendmail = /usr/lib/sendmail imgcache = /usr/local/smokeping/cache imgurl = /cache datadir = /usr/local/smokeping/data piddir = /usr/local/smokeping/var cgiurl = http://192.168.1.23:55555/smokeping smokemail = /usr/local/smokeping/etc/smokemail.dist tmail = /usr/local/smokeping/etc/tmail.dist syslogfacility = local0
节点配置
binary = /usr/sbin/fping *** Slaves *** secrets=/usr/local/smokeping/etc/smokeping_secrets.dist + bj display_name=bj color=ea0000 + sh display_name=sh color=ff359a + sd display_name=sd color=ff00ff + gd display_name=gd color=0066cc + sc display_name=sc color=006000 + hk display_name=hk color=00e3e3
首页标题和介绍
menu = Top title = 网络SmokePing监控中心 remark = “介绍词”
加入主机
+Enterprise menu = 企业 title = 企业 ++gd_Enterprise menu = 企业 title = 企业 +++ 192168344 menu = 192.168.3.44 title = 192.168.3.44 #alerts = someloss slaves = bj gd sc //节点名称 host = 192.168.3.44 +++ 192168345 menu = 192.168.3.45 title = 192.168.3.45 #alerts = someloss //报警 slaves = bj gd sc //节点名称 host = 192.168.3.45
汇总如下:
+++ LocalNetwork menu = 汇总 title = 汇总 host = /Enterprise/gd_Enterprise/192168344 /Enterprise/gd_Enterprise/192168345 //一个中间空格继续加另一个
如果是服务器是从节点则直接装完后启动 如下:
mkdir /usr/local/smokeping/cache
mkdir /usr/local/smokeping/data
/usr/local/smokeping/bin/smokeping --master-url=http://192.168.1.23:55555/smokeping/smokeping.cgi --cache-dir=/usr/local/smokeping/cache/ --shared-secret=/usr/local/smokeping/etc/passwd --slave-name=bj --logfile=/usr/local/smokeping/slave.log
--master-url=//主服务器的连接
--shared-secret= //密码文件目录 可以用现成的 smokeping_secrets.dist 或者新建 l里面的密码要跟服务度的一样 权限 600
内容是比如密码123456 就这样。
--slave-name //节点名称
--logfile= //日志文件
注意密码文件服务端也要填写这个文件smokeping_secrets.dist 权限也是600
格式如下: 节点名 冒号 密码
bj:123456
sc:234567
gd:345678
全部安装完成后重启服务器端,等5分钟看节点是否有数据 如果没有 重启客户端测试。看日志