CentOS7 源码安装 smokeping 2.7

[TOC]

1. 安装基础依赖包

安装 epel yum 源和相关基础依赖包。

yum -y install epel-release wget make gcc openssl openssl-devel rrdtool rrdtool-perl perl-core perl mod_fcgid perl-CPAN httpd httpd-devel curl bind-utils gcc make vim gcc-c++ perl-LWP-Protocol-https wqy-microhei-fonts

2. 安装fping

smokeping 2.7.2以上需要fping4.0以上

1cd /data/packages 2wget https://fping.org/dist/fping-4.2.tar.gz 3tar -zxvf fping-4.2.tar.gz 4cd fping-4.2 5./configure 6make 7make install

3. 安装echoping

如果使用tcp ping,需要它。

1cd /data/packages 2wget https://fossies.org/linux/misc/old/echoping-6.0.2.tar.gz 3tar -zxvf echoping-6.0.2.tar.gz 4cd echoping-6.0.2 5yum install -y popt-devel openssl openssl-devel 6./configure --with-ssl --without-libidn 7make 8make install

4. 安装smokeping

源码安装 smokeping 2.7.3。

1cd /data/packages 2wget https://oss.oetiker.ch/smokeping/pub/smokeping-2.7.3.tar.gz 3tar -zxvf smokeping-2.7.3.tar.gz 4cd smokeping-2.7.3 5./configure --prefix=/usr/local/smokeping 6/usr/bin/gmake install

5. 配置 smokeping 和 apche

5.1 配置 smokeping

1cd /usr/local/smokeping 2mkdir var htdocs/{data,cache} 3chown apache.apache -R /usr/local/smokeping 4touch /var/log/smokeping.log 5chown apache.apache /var/log/smokeping.log 6cd /usr/local/smokeping/htdocs/ 7cp smokeping.fcgi.dist smokeping.fcgi 8chmod 600 /usr/local/smokeping/etc/smokeping_secrets.dist 9 10cat > /usr/local/smokeping/etc/config<<EOF 11*** General *** 12owner = admin 13contact = some@address.nowhere 14mailhost = my.mail.host 15sendmail = /usr/sbin/sendmail 16imgcache = /usr/local/smokeping/htdocs/cache 17imgurl = cache 18datadir = /usr/local/smokeping/htdocs/data 19piddir = /usr/local/smokeping/var 20cgiurl = http://10.10.23.103/smokeping/smokeping.fcgi 21smokemail = /usr/local/smokeping/etc/smokemail.dist 22tmail = /usr/local/smokeping/etc/tmail.dist 23# specify this to get syslog logging 24syslogfacility = local0 25 26*** Alerts *** 27to = alertee@address.somewhere 28from = smokealert@company.xy 29 30+hostdown 31type = loss 32# in percent 33pattern = ==0%,==0%,==0%,==U 34comment = 对端无响应 35 36+hightloss 37type = loss 38# in percent 39pattern = ==0%,==0%,==0%,==0%,>10%,>10%,>10% 40comment = 连续3次采样-丢包率超过10% 41 42+lossdetect 43type = loss 44# in percent 45pattern = ==0%,==0%,==0%,==0%,>0%,>0%,>0% 46comment = 连续3次采样-存在丢包 47 48+someloss 49type = loss 50# in percent 51pattern = >0%,*12*,>0%,*12*,>0% 52comment = 间断性丢包 53 54+rttdetect 55type = rtt 56# in milli seconds 57pattern = <100,<100,<100,<100,<100,<150,>150,>150,>150 58comment = 连续3次采样延迟增大-超过150ms 59 60*** Database *** 61step = 60 62pings = 20 63 64# consfn mrhb steps total 65 66AVERAGE 0.5 1 1008 67AVERAGE 0.5 12 4320 68 MIN 0.5 12 4320 69 MAX 0.5 12 4320 70AVERAGE 0.5 144 720 71 MAX 0.5 144 720 72 MIN 0.5 144 720 73 74*** Presentation *** 75 76charset = utf-8 77template = /usr/local/smokeping/etc/basepage.html.dist 78htmltitle = yes 79graphborders = no 80 81+ charts 82menu = Charts 83title = The most interesting destinations 84 85++ stddev 86sorter = StdDev(entries=>4) 87title = Top Standard Deviation 88menu = Std Deviation 89format = Standard Deviation %f 90 91++ max 92sorter = Max(entries=>5) 93title = Top Max Roundtrip Time 94menu = by Max 95format = Max Roundtrip Time %f seconds 96 97++ loss 98sorter = Loss(entries=>5) 99title = Top Packet Loss 100menu = Loss 101format = Packets Lost %f 102 103++ median 104sorter = Median(entries=>5) 105title = Top Median Roundtrip Time 106menu = by Median 107format = Median RTT %f seconds 108 109+ overview 110width = 600 111height = 50 112range = 10h 113 114+ detail 115width = 600 116height = 200 117unison_tolerance = 2 118 119"Last 3 Hours" 3h 120"Last 30 Hours" 30h 121"Last 10 Days" 10d 122"Last 400 Days" 400d 123 124*** Probes *** 125+ FPing 126binary = /usr/local/sbin/fping 127#可以设置源IP地址,适用于多IP的服务器,(比如组专线内网+公网)服务器 128#sourceaddressn = 1.1.1.1 129 130#*** Slaves *** 131#secrets=/usr/local/smokeping/etc/smokeping_secrets.dist 132#+aliyunShenzhen 133#display_name=slave1 134#location=China 135#color=ff0000 136# 137#+aliyunHangzhou 138#display_name=slave2 139#location=China 140#color=ff00ff 141 142*** Targets *** 143probe = FPing 144 145menu = Top 146title = 网络质量监控系统 147remark = 如果您是合法管理员,那么欢迎您,如果不是,请立即离开 Only legal administrators are welcome, if you are not, please leave immediately 148 149#加载额外的监控主机(将监控主机,单独成一个文件) 150@include targets 151EOF

添加监控主机列表文件:

1cat > /usr/local/smokeping/etc/targets<<EOF 2+ dns 3menu = 全球公共DNS网络监控 4title = 全球公共DNS网络监控 5#slaves = slave1 slave2 6#alerts = hostdown,hightloss 7 8++ public-dns 9menu = 公共DNS 10title = 公共DNS网络监控列表 11host = /dns/public-dns/dns-1 /dns/public-dns/dns-2 /dns/public-dns/dns-3 /dns/public-dns/dns-4 /dns/public-dns/dns-5 /dns/public-dns/dns-6 /dns/public-dns/dns-7 /dns/public-dns/dns-8 /dns/public-dns/dns-9 /dns/public-dns/dns-10 /dns/public-dns/dns-11 /dns/public-dns/dns-12 /dns/public-dns/dns-13 /dns/public-dns/dns-14 /dns/public-dns/dns-15 /dns/public-dns/dns-16 /dns/public-dns/dns-17 /dns/public-dns/dns-18 /dns/public-dns/dns-19 /dns/public-dns/dns-20 /dns/public-dns/dns-21 /dns/public-dns/dns-22 /dns/public-dns/dns-23 /dns/public-dns/dns-24 12 13+++ dns-1 14menu = 江西移动-211.141.90.68 15title = 江西移动-211.141.90.68 16host = 211.141.90.68 17+++ dns-2 18menu = 江西电信-202.101.224.68 19title = 江西电信-202.101.224.68 20host = 202.101.224.68 21+++ dns-3 22menu = 江西联通-220.248.192.12 23title = 江西联通-220.248.192.12 24host = 220.248.192.12 25+++ dns-4 26menu = 114-DNS-114.114.114.114 27title = 114-DNS-114.114.114.114 28host = 114.114.114.114 29+++ dns-5 30menu = 114安全版-114.114.114.119 31title = 114安全版-114.114.114.119 32host = 114.114.114.119 33 34+++ dns-6 35menu = 阿里-223.5.5.5 36title = 阿里-223.5.5.5 37host = 223.5.5.5 38+++ dns-7 39menu = 百度-180.76.76.76 40title = 百度-180.76.76.76 41host = 180.76.76.76 42+++ dns-8 43menu = DNSPOD-119.29.29.29 44title = DNSPOD-119.29.29.29 45host = 119.29.29.29 46+++ dns-9 47menu = CNNIC-1.2.4.8 48title = CNNIC-1.2.4.8 49host = 1.2.4.8 50+++ dns-10 51menu = DNS-218.30.118.6 52title = DNS-218.30.118.6 53host = 218.30.118.6 54 55+++ dns-11 56menu = 谷歌-8.8.8.8 57title = 谷歌-8.8.8.8 58host = 8.8.8.8 59+++ dns-12 60menu = IBMQ9-9.9.9.9 61title = IBMQ9-9.9.9.9 62host = 9.9.9.9 63+++ dns-13 64menu = CF-1.1.1.1 65title = CF-1.1.1.1 66host = 1.1.1.1 67+++ dns-14 68menu = 科莫多-8.26.56.26 69title = 科莫多-8.26.56.26 70host = 8.26.56.26 71+++ dns-15 72menu = GTEI-4.2.2.1 73title = GTEI-4.2.2.1 74host = 4.2.2.1 75 76+++ dns-16 77menu = PCCW-205.252.144.228 78title = PCCW-205.252.144.228 79host = 205.252.144.228 80+++ dns-17 81menu = HKIX-202.181.224.2 82title = HKIX-202.181.224.2 83host = 202.181.224.2 84+++ dns-18 85menu = 澳门-202.175.3.8 86title = 澳门-202.175.3.8 87host = 202.175.3.8 88+++ dns-19 89menu = 中华电信-168.95.192.1 90title = 中华电信-168.95.192.1 91host = 168.95.192.1 92+++ dns-20 93menu = 英国-193.0.14.129 94title = 英国-193.0.14.129 95host = 193.0.14.129 96 97+++ dns-21 98menu = 日本-202.12.27.33 99title = 日本-202.12.27.33 100host = 202.12.27.33 101+++ dns-22 102menu = 韩国-164.124.101.31 103title = 韩国-164.124.101.31 104host = 164.124.101.31 105+++ dns-23 106menu = 洛杉矶hostspace-162.212.181.53 107title = 洛杉矶hostspace-162.212.181.53 108host = 162.212.181.53 109+++ dns-24 110menu = 洛杉矶hostspace-1-192.126.112.53 111title = 洛杉矶hostspace-2-192.126.112.53 112host = 192.126.112.53 113EOF

添加 smokeping 为服务:

1cat > /usr/lib/systemd/system/smokeping.service<<EOF 2[Unit] 3Description=Latency Logging and Graphing System 4After=syslog.target network.target 5 6[Service] 7#ExecStart=/usr/sbin/smokeping --nodaemon # 2.6 yum install 8ExecStart=/usr/local/smokeping/bin/smokeping --nodaemon --config=/usr/local/smokeping/etc/config --logfile=/var/log/smokeping.log # 2.7 src install 9ExecReload=/bin/kill -HUP $MAINPID 10StandardError=syslog 11 12[Install] 13WantedBy=multi-user.target 14EOF

5.2 配置 apache

/etc/httpd/conf/httpd.conf 的行 DocumentRoot "/var/www/html" 后添加内容,如下:

1DocumentRoot "/var/www/html" 2Alias /smokeping "/usr/local/smokeping/htdocs/" 3<Directory "/usr/local/smokeping"> 4AllowOverride None 5Options All 6AddHandler cgi-script .fcgi .cgi 7AllowOverride AuthConfig 8Order allow,deny 9Allow from all 10AuthName "Smokeping" 11AuthType Basic 12AuthUserFile /usr/local/smokeping/htdocs/htpasswd 13Require valid-user 14DirectoryIndex smokeping.fcgi 15</Directory>

htpasswd -c /opt/smokeping/htdocs/htpasswd admin 生成 basic 验证密码。

中文支持,/usr/local/smokeping/etc/basepage.html.dist 的 head 内添加

<META charset="utf-8" />

6. 访问测试

启动 smokeping 和 apache,然后访问 http://10.10.23.103/smokeping/

1systemctl daemon-reaload 2systemctl start smokeping 3systemctl start apache
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )