下載解壓
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分鐘看節點是否有數據 如果沒有 重啓客戶端測試。看日誌