├── README.md ├── grafana └── ping_monitor.json ├── img ├── grafana_01.png └── grafana_02.png ├── prometheus └── collection_to_prometheus.py └── smokeping ├── config └── location ├── cmcc ├── telcom ├── tencent └── unicom /README.md: -------------------------------------------------------------------------------- 1 | > 一、概述 2 | 3 | IDC机房测速工具,由3个组件组成: 4 | smokeping:主要负责采集数据 5 | prometheus:主要负责存储数据 6 | grafana:主要负责展现数据 7 | smokeping采集数据之后存储到rrd文件,然后通过脚本把数据提取出来,格式化之后发送到prometheus,然后通过grafana展示出来 8 | 9 | 使用环境: Centos7 python2.7 10 | > 二、使用 11 | 12 | ``` 13 | cd /tmp 14 | git clone https://github.com/Spider-Zhong/idcping-smokeping.git 15 | ``` 16 | 17 | >> (1)smokeping 18 | 安装单机版: 19 | ``` 20 | cd /tmp && wget -N --no-check-certificate https://raw.githubusercontent.com/ILLKX/smokeping-onekey/master/smokeping.sh && bash smokeping.sh 21 | ``` 22 | smokeping的家目录: 23 | 24 | ``` 25 | smokeping_home_dir=/opt/smokeping 26 | ``` 27 | 28 | 创建config文件,并且配置全国各区域ip监测点 29 | 30 | ``` 31 | cd $smokeping_home_dir/etc 32 | cp -rf /tmp/idcping-smokeping/smokeping/* ./ 33 | ``` 34 | 监测点主要由国内的三大运营商的IP站点组成,也可以自定义需要检测的站点 35 | 36 | 启动: 37 | 38 | ``` 39 | bash /tmp/smokeping.sh 40 | ``` 41 | 42 | 43 | >> (2)安装prometheus pushgateway 44 | ``` 45 | curl -s https://packagecloud.io/install/repositories/prometheus-rpm/release/script.rpm.sh | sudo bash 46 | yum -y install prometheus2 pushgateway python python-pip python-rrdtool 47 | systemctl status prometheus 48 | systemctl start prometheus 49 | systemctl start pushgateway 50 | firewall-cmd --zone=public --add-port=9090/tcp 51 | firewall-cmd --zone=public --add-port=9091/tcp 52 | ``` 53 | 54 | 55 | 配置prometheus.yml 56 | 57 | ``` 58 | vim /etc/prometheus/prometheus.yml 59 | 60 | global: 61 | scrape_interval: 60s 62 | evaluation_interval: 60s 63 | 64 | scrape_configs: 65 | - job_name: prometheus 66 | static_configs: 67 | - targets: ['localhost:9090'] 68 | labels: 69 | instance: prometheus 70 | 71 | - job_name: pushgateway 72 | static_configs: 73 | - targets: ['localhost:9091'] 74 | labels: 75 | instance: pushgateway 76 | 77 | ``` 78 | 79 | 把smokeping采集的数据通过rrdtool读取之后,按照一定的格式推送到prometheus的gateway,时间间隔是1分钟 80 | Ps: 请务必检查运行环境 模块是否安装 requests rrdtool 81 | ``` 82 | pip install requests 83 | cp /tmp/idcping-smokeping/prometheus/collection_to_prometheus.py $smokeping_home_dir 84 | touch /tmp/smoking_pushgateway.log 85 | ``` 86 | 87 | 在/usr/local/smokeping/collection_to_prometheus.py中,按照实际情况配置3个参数: 88 | 89 | ```python 90 | 'LOG_FILE' : '/tmp/smoking_pushgateway.log' # 日志文件 91 | 'prometheus_gateway' : 'http://localhost:9091' # Prometheus gateway地址 92 | 'data_dir' : '/opt/smokeping/htdocs/data' # smokeping rrd文件的存放地址 93 | ``` 94 | 95 | 配置crontab计划任务 96 | 97 | ``` 98 | crontab -e 99 | 100 | * * * * * python /opt/smokeping/collection_to_prometheus.py 101 | ``` 102 | 103 | 104 | 105 | >> (3)grafana 106 | 107 | 安装 108 | ``` 109 | wget https://dl.grafana.com/oss/release/grafana-6.1.6-1.x86_64.rpm 110 | sudo yum localinstall grafana-6.1.6-1.x86_64.rpm 111 | ``` 112 | 113 | 将模板grafana/ping_monitor.json 导入grafana即可,效果大概是这样 114 | 115 | ![](img/grafana_01.png) 116 | ![](img/grafana_02.png) 117 | -------------------------------------------------------------------------------- /grafana/ping_monitor.json: -------------------------------------------------------------------------------- 1 | { 2 | "annotations": { 3 | "list": [ 4 | { 5 | "builtIn": 1, 6 | "datasource": "-- Grafana --", 7 | "enable": true, 8 | "hide": true, 9 | "iconColor": "rgba(0, 211, 255, 1)", 10 | "name": "Annotations & Alerts", 11 | "type": "dashboard" 12 | } 13 | ] 14 | }, 15 | "editable": true, 16 | "gnetId": null, 17 | "graphTooltip": 0, 18 | "id": 1, 19 | "links": [ 20 | { 21 | "icon": "external link", 22 | "tags": [], 23 | "type": "link" 24 | } 25 | ], 26 | "panels": [ 27 | { 28 | "aliasColors": {}, 29 | "bars": false, 30 | "dashLength": 10, 31 | "dashes": false, 32 | "datasource": "Prometheus", 33 | "fill": 1, 34 | "gridPos": { 35 | "h": 9, 36 | "w": 6, 37 | "x": 0, 38 | "y": 0 39 | }, 40 | "height": "350px", 41 | "id": 1, 42 | "legend": { 43 | "alignAsTable": true, 44 | "avg": false, 45 | "current": true, 46 | "hideEmpty": true, 47 | "hideZero": true, 48 | "max": true, 49 | "min": false, 50 | "show": true, 51 | "sort": "max", 52 | "sortDesc": false, 53 | "total": false, 54 | "values": true 55 | }, 56 | "lines": true, 57 | "linewidth": 1, 58 | "links": [], 59 | "nullPointMode": "null as zero", 60 | "percentage": false, 61 | "pointradius": 3, 62 | "points": false, 63 | "renderer": "flot", 64 | "seriesOverrides": [], 65 | "spaceLength": 10, 66 | "stack": false, 67 | "steppedLine": false, 68 | "targets": [ 69 | { 70 | "expr": "smokeping_lost_package_num{ISP=\"TELCOM\",instance=~\".*\",exported_job=\"smokeping-collected-TELCOM\" , alias=~'.*'} / 20 * 100", 71 | "format": "time_series", 72 | "interval": "", 73 | "intervalFactor": 2, 74 | "legendFormat": "{{ alias }}", 75 | "refId": "A", 76 | "step": 20 77 | } 78 | ], 79 | "thresholds": [], 80 | "timeFrom": null, 81 | "timeRegions": [], 82 | "timeShift": null, 83 | "title": "电信丢包率 (%)", 84 | "tooltip": { 85 | "shared": false, 86 | "sort": 0, 87 | "value_type": "individual" 88 | }, 89 | "type": "graph", 90 | "xaxis": { 91 | "buckets": null, 92 | "mode": "time", 93 | "name": null, 94 | "show": true, 95 | "values": [ 96 | "total" 97 | ] 98 | }, 99 | "yaxes": [ 100 | { 101 | "format": "short", 102 | "label": null, 103 | "logBase": 1, 104 | "max": null, 105 | "min": null, 106 | "show": true 107 | }, 108 | { 109 | "format": "short", 110 | "label": null, 111 | "logBase": 1, 112 | "max": null, 113 | "min": null, 114 | "show": true 115 | } 116 | ], 117 | "yaxis": { 118 | "align": false, 119 | "alignLevel": null 120 | } 121 | }, 122 | { 123 | "aliasColors": {}, 124 | "bars": false, 125 | "dashLength": 10, 126 | "dashes": false, 127 | "datasource": "Prometheus", 128 | "fill": 1, 129 | "gridPos": { 130 | "h": 9, 131 | "w": 6, 132 | "x": 6, 133 | "y": 0 134 | }, 135 | "height": "350px", 136 | "id": 20, 137 | "legend": { 138 | "alignAsTable": true, 139 | "avg": false, 140 | "current": true, 141 | "hideEmpty": true, 142 | "hideZero": true, 143 | "max": true, 144 | "min": false, 145 | "show": true, 146 | "total": false, 147 | "values": true 148 | }, 149 | "lines": true, 150 | "linewidth": 1, 151 | "links": [], 152 | "nullPointMode": "null as zero", 153 | "percentage": false, 154 | "pointradius": 3, 155 | "points": false, 156 | "renderer": "flot", 157 | "seriesOverrides": [], 158 | "spaceLength": 10, 159 | "stack": false, 160 | "steppedLine": false, 161 | "targets": [ 162 | { 163 | "expr": "smokeping_lost_package_num{ISP=\"UNICOM\",instance=~\".*\",exported_job=\"smokeping-collected-UNICOM\" , alias=~'.*'} / 20 * 100", 164 | "interval": "", 165 | "intervalFactor": 2, 166 | "legendFormat": "{{ alias }}", 167 | "refId": "A", 168 | "step": 20 169 | } 170 | ], 171 | "thresholds": [], 172 | "timeFrom": null, 173 | "timeRegions": [], 174 | "timeShift": null, 175 | "title": "联通丢包率 (%)", 176 | "tooltip": { 177 | "shared": false, 178 | "sort": 0, 179 | "value_type": "individual" 180 | }, 181 | "type": "graph", 182 | "xaxis": { 183 | "buckets": null, 184 | "mode": "time", 185 | "name": null, 186 | "show": true, 187 | "values": [ 188 | "total" 189 | ] 190 | }, 191 | "yaxes": [ 192 | { 193 | "format": "short", 194 | "label": null, 195 | "logBase": 1, 196 | "max": null, 197 | "min": null, 198 | "show": true 199 | }, 200 | { 201 | "format": "short", 202 | "label": null, 203 | "logBase": 1, 204 | "max": null, 205 | "min": null, 206 | "show": true 207 | } 208 | ], 209 | "yaxis": { 210 | "align": false, 211 | "alignLevel": null 212 | } 213 | }, 214 | { 215 | "aliasColors": {}, 216 | "bars": false, 217 | "dashLength": 10, 218 | "dashes": false, 219 | "datasource": "Prometheus", 220 | "fill": 1, 221 | "gridPos": { 222 | "h": 9, 223 | "w": 6, 224 | "x": 12, 225 | "y": 0 226 | }, 227 | "height": "350px", 228 | "id": 21, 229 | "legend": { 230 | "alignAsTable": true, 231 | "avg": false, 232 | "current": true, 233 | "hideEmpty": true, 234 | "hideZero": true, 235 | "max": true, 236 | "min": false, 237 | "show": true, 238 | "total": false, 239 | "values": true 240 | }, 241 | "lines": true, 242 | "linewidth": 1, 243 | "links": [], 244 | "nullPointMode": "null as zero", 245 | "percentage": false, 246 | "pointradius": 3, 247 | "points": false, 248 | "renderer": "flot", 249 | "seriesOverrides": [], 250 | "spaceLength": 10, 251 | "stack": false, 252 | "steppedLine": false, 253 | "targets": [ 254 | { 255 | "expr": "smokeping_lost_package_num{ISP=\"CMCC\",instance=~\".*\",exported_job=\"smokeping-collected-CMCC\" , alias=~'.*'} / 20 * 100", 256 | "interval": "", 257 | "intervalFactor": 2, 258 | "legendFormat": "{{ alias }}", 259 | "refId": "A", 260 | "step": 20 261 | } 262 | ], 263 | "thresholds": [], 264 | "timeFrom": null, 265 | "timeRegions": [], 266 | "timeShift": null, 267 | "title": "移动丢包率 (%)", 268 | "tooltip": { 269 | "shared": false, 270 | "sort": 0, 271 | "value_type": "individual" 272 | }, 273 | "type": "graph", 274 | "xaxis": { 275 | "buckets": null, 276 | "mode": "time", 277 | "name": null, 278 | "show": true, 279 | "values": [ 280 | "total" 281 | ] 282 | }, 283 | "yaxes": [ 284 | { 285 | "format": "short", 286 | "label": null, 287 | "logBase": 1, 288 | "max": null, 289 | "min": null, 290 | "show": true 291 | }, 292 | { 293 | "format": "short", 294 | "label": null, 295 | "logBase": 1, 296 | "max": null, 297 | "min": null, 298 | "show": true 299 | } 300 | ], 301 | "yaxis": { 302 | "align": false, 303 | "alignLevel": null 304 | } 305 | }, 306 | { 307 | "aliasColors": {}, 308 | "bars": false, 309 | "dashLength": 10, 310 | "dashes": false, 311 | "datasource": "Prometheus", 312 | "fill": 1, 313 | "gridPos": { 314 | "h": 9, 315 | "w": 6, 316 | "x": 18, 317 | "y": 0 318 | }, 319 | "height": "350px", 320 | "id": 22, 321 | "legend": { 322 | "alignAsTable": true, 323 | "avg": false, 324 | "current": true, 325 | "hideEmpty": true, 326 | "hideZero": false, 327 | "max": true, 328 | "min": false, 329 | "show": true, 330 | "total": false, 331 | "values": true 332 | }, 333 | "lines": true, 334 | "linewidth": 1, 335 | "links": [], 336 | "nullPointMode": "null as zero", 337 | "percentage": false, 338 | "pointradius": 3, 339 | "points": false, 340 | "renderer": "flot", 341 | "seriesOverrides": [], 342 | "spaceLength": 10, 343 | "stack": false, 344 | "steppedLine": false, 345 | "targets": [ 346 | { 347 | "expr": "smokeping_lost_package_num{ISP=\"TENCENT\",instance=~\".*\",exported_job=\"smokeping-collected-TENCENT\" , alias=~'.*'} / 20 * 100", 348 | "interval": "", 349 | "intervalFactor": 2, 350 | "legendFormat": "{{ alias }}", 351 | "refId": "A", 352 | "step": 20 353 | } 354 | ], 355 | "thresholds": [], 356 | "timeFrom": null, 357 | "timeRegions": [], 358 | "timeShift": null, 359 | "title": "腾讯云丢包率 (%)", 360 | "tooltip": { 361 | "shared": false, 362 | "sort": 0, 363 | "value_type": "individual" 364 | }, 365 | "type": "graph", 366 | "xaxis": { 367 | "buckets": null, 368 | "mode": "time", 369 | "name": null, 370 | "show": true, 371 | "values": [ 372 | "total" 373 | ] 374 | }, 375 | "yaxes": [ 376 | { 377 | "format": "short", 378 | "label": null, 379 | "logBase": 1, 380 | "max": null, 381 | "min": "0", 382 | "show": true 383 | }, 384 | { 385 | "format": "short", 386 | "label": null, 387 | "logBase": 1, 388 | "max": null, 389 | "min": null, 390 | "show": true 391 | } 392 | ], 393 | "yaxis": { 394 | "align": false, 395 | "alignLevel": null 396 | } 397 | }, 398 | { 399 | "columns": [], 400 | "datasource": "Prometheus", 401 | "fontSize": "100%", 402 | "gridPos": { 403 | "h": 9, 404 | "w": 6, 405 | "x": 0, 406 | "y": 9 407 | }, 408 | "height": "350", 409 | "hideTimeOverride": true, 410 | "id": 16, 411 | "links": [], 412 | "pageSize": 20, 413 | "scroll": false, 414 | "showHeader": true, 415 | "sort": { 416 | "col": 2, 417 | "desc": true 418 | }, 419 | "styles": [ 420 | { 421 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 422 | "pattern": "Time", 423 | "type": "date" 424 | }, 425 | { 426 | "colorMode": "cell", 427 | "colors": [ 428 | "rgba(50, 172, 45, 0.97)", 429 | "rgba(237, 129, 40, 0.89)", 430 | "rgba(245, 54, 54, 0.9)" 431 | ], 432 | "decimals": 2, 433 | "pattern": "/.*/", 434 | "thresholds": [ 435 | "100", 436 | "200", 437 | "500" 438 | ], 439 | "type": "number", 440 | "unit": "short" 441 | }, 442 | { 443 | "colorMode": null, 444 | "colors": [ 445 | "rgba(245, 54, 54, 0.9)", 446 | "rgba(237, 129, 40, 0.89)", 447 | "rgba(50, 172, 45, 0.97)" 448 | ], 449 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 450 | "decimals": 2, 451 | "pattern": "{{ ISP }}", 452 | "thresholds": [], 453 | "type": "date", 454 | "unit": "short" 455 | } 456 | ], 457 | "targets": [ 458 | { 459 | "expr": "topk(10 , smokeping_rrt{IDC=\"SH\",ISP=\"TELCOM\",instance=~\".*\",exported_job=\"smokeping-collected-TELCOM\" , alias=~'.*'})", 460 | "interval": "60s", 461 | "intervalFactor": 1, 462 | "legendFormat": "{{ alias }}", 463 | "refId": "A", 464 | "step": 60 465 | } 466 | ], 467 | "timeFrom": "30s", 468 | "timeShift": "1m", 469 | "title": "电信延迟top10 (ms)", 470 | "transform": "timeseries_to_rows", 471 | "type": "table" 472 | }, 473 | { 474 | "columns": [], 475 | "datasource": "Prometheus", 476 | "fontSize": "100%", 477 | "gridPos": { 478 | "h": 9, 479 | "w": 6, 480 | "x": 6, 481 | "y": 9 482 | }, 483 | "height": "350", 484 | "hideTimeOverride": true, 485 | "id": 17, 486 | "links": [], 487 | "pageSize": 20, 488 | "scroll": false, 489 | "showHeader": true, 490 | "sort": { 491 | "col": 2, 492 | "desc": true 493 | }, 494 | "styles": [ 495 | { 496 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 497 | "pattern": "Time", 498 | "type": "date" 499 | }, 500 | { 501 | "colorMode": "cell", 502 | "colors": [ 503 | "rgba(50, 172, 45, 0.97)", 504 | "rgba(237, 129, 40, 0.89)", 505 | "rgba(245, 54, 54, 0.9)" 506 | ], 507 | "decimals": 2, 508 | "pattern": "/.*/", 509 | "thresholds": [ 510 | "100", 511 | "200", 512 | "500" 513 | ], 514 | "type": "number", 515 | "unit": "short" 516 | }, 517 | { 518 | "colorMode": null, 519 | "colors": [ 520 | "rgba(245, 54, 54, 0.9)", 521 | "rgba(237, 129, 40, 0.89)", 522 | "rgba(50, 172, 45, 0.97)" 523 | ], 524 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 525 | "decimals": 2, 526 | "pattern": "{{ ISP }}", 527 | "thresholds": [], 528 | "type": "date", 529 | "unit": "short" 530 | } 531 | ], 532 | "targets": [ 533 | { 534 | "expr": "topk(10 , smokeping_rrt{IDC=\"SH\",ISP=\"UNICOM\",instance=~\".*\",exported_job=\"smokeping-collected-UNICOM\" , alias=~'.*'})", 535 | "interval": "60s", 536 | "intervalFactor": 1, 537 | "legendFormat": "{{ alias }}", 538 | "refId": "A", 539 | "step": 60 540 | } 541 | ], 542 | "timeFrom": "30s", 543 | "timeShift": "1m", 544 | "title": "联通延迟top10 (ms)", 545 | "transform": "timeseries_to_rows", 546 | "type": "table" 547 | }, 548 | { 549 | "columns": [], 550 | "datasource": "Prometheus", 551 | "fontSize": "100%", 552 | "gridPos": { 553 | "h": 10, 554 | "w": 6, 555 | "x": 12, 556 | "y": 9 557 | }, 558 | "height": "400", 559 | "hideTimeOverride": true, 560 | "id": 18, 561 | "links": [], 562 | "pageSize": 20, 563 | "scroll": false, 564 | "showHeader": true, 565 | "sort": { 566 | "col": 2, 567 | "desc": true 568 | }, 569 | "styles": [ 570 | { 571 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 572 | "pattern": "Time", 573 | "type": "date" 574 | }, 575 | { 576 | "colorMode": "cell", 577 | "colors": [ 578 | "rgba(50, 172, 45, 0.97)", 579 | "rgba(237, 129, 40, 0.89)", 580 | "rgba(245, 54, 54, 0.9)" 581 | ], 582 | "decimals": 2, 583 | "pattern": "/.*/", 584 | "thresholds": [ 585 | "100", 586 | "200", 587 | "500" 588 | ], 589 | "type": "number", 590 | "unit": "short" 591 | }, 592 | { 593 | "colorMode": null, 594 | "colors": [ 595 | "rgba(245, 54, 54, 0.9)", 596 | "rgba(237, 129, 40, 0.89)", 597 | "rgba(50, 172, 45, 0.97)" 598 | ], 599 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 600 | "decimals": 2, 601 | "pattern": "{{ ISP }}", 602 | "thresholds": [], 603 | "type": "date", 604 | "unit": "short" 605 | } 606 | ], 607 | "targets": [ 608 | { 609 | "expr": "topk(10 , smokeping_rrt{IDC=\"SH\",ISP=\"CMCC\",instance=~\".*\",exported_job=\"smokeping-collected-CMCC\" , alias=~'.*'})", 610 | "interval": "60s", 611 | "intervalFactor": 1, 612 | "legendFormat": "{{ alias }}", 613 | "refId": "A", 614 | "step": 60 615 | } 616 | ], 617 | "timeFrom": "30s", 618 | "timeShift": "1m", 619 | "title": "移动延迟top10 (ms)", 620 | "transform": "timeseries_to_rows", 621 | "type": "table" 622 | }, 623 | { 624 | "columns": [], 625 | "datasource": "Prometheus", 626 | "fontSize": "100%", 627 | "gridPos": { 628 | "h": 10, 629 | "w": 6, 630 | "x": 18, 631 | "y": 9 632 | }, 633 | "height": "400", 634 | "hideTimeOverride": true, 635 | "id": 19, 636 | "links": [], 637 | "pageSize": 20, 638 | "scroll": false, 639 | "showHeader": true, 640 | "sort": { 641 | "col": 2, 642 | "desc": true 643 | }, 644 | "styles": [ 645 | { 646 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 647 | "pattern": "Time", 648 | "type": "date" 649 | }, 650 | { 651 | "colorMode": "cell", 652 | "colors": [ 653 | "rgba(50, 172, 45, 0.97)", 654 | "rgba(237, 129, 40, 0.89)", 655 | "rgba(245, 54, 54, 0.9)" 656 | ], 657 | "decimals": 2, 658 | "pattern": "/.*/", 659 | "thresholds": [ 660 | "100", 661 | "200", 662 | "500" 663 | ], 664 | "type": "number", 665 | "unit": "short" 666 | }, 667 | { 668 | "colorMode": null, 669 | "colors": [ 670 | "rgba(245, 54, 54, 0.9)", 671 | "rgba(237, 129, 40, 0.89)", 672 | "rgba(50, 172, 45, 0.97)" 673 | ], 674 | "dateFormat": "YYYY-MM-DD HH:mm:ss", 675 | "decimals": 2, 676 | "pattern": "{{ ISP }}", 677 | "thresholds": [], 678 | "type": "date", 679 | "unit": "short" 680 | } 681 | ], 682 | "targets": [ 683 | { 684 | "expr": "topk(10 , smokeping_rrt{IDC=\"SH\",ISP=\"TENCENT\",instance=~\".*\",exported_job=\"smokeping-collected-TENCENT\" , alias=~'.*'})", 685 | "interval": "60s", 686 | "intervalFactor": 1, 687 | "legendFormat": "{{ alias }}", 688 | "refId": "A", 689 | "step": 60 690 | } 691 | ], 692 | "timeFrom": "30s", 693 | "timeShift": "1m", 694 | "title": "腾讯云延迟top10 (ms)", 695 | "transform": "timeseries_to_rows", 696 | "type": "table" 697 | }, 698 | { 699 | "aliasColors": {}, 700 | "bars": false, 701 | "dashLength": 10, 702 | "dashes": false, 703 | "datasource": "Prometheus", 704 | "fill": 0, 705 | "gridPos": { 706 | "h": 8, 707 | "w": 24, 708 | "x": 0, 709 | "y": 19 710 | }, 711 | "height": "300", 712 | "id": 23, 713 | "legend": { 714 | "alignAsTable": true, 715 | "avg": false, 716 | "current": true, 717 | "max": true, 718 | "min": false, 719 | "rightSide": true, 720 | "show": true, 721 | "sort": "current", 722 | "sortDesc": true, 723 | "total": false, 724 | "values": true 725 | }, 726 | "lines": true, 727 | "linewidth": 1, 728 | "links": [], 729 | "nullPointMode": "null", 730 | "percentage": false, 731 | "pointradius": 5, 732 | "points": false, 733 | "renderer": "flot", 734 | "seriesOverrides": [], 735 | "spaceLength": 10, 736 | "stack": false, 737 | "steppedLine": false, 738 | "targets": [ 739 | { 740 | "expr": "smokeping_rrt{IDC=\"SH\",ISP=\"TELCOM\",instance=~\".*\",exported_job=\"smokeping-collected-TELCOM\" , alias=~'.*'}", 741 | "interval": "60s", 742 | "intervalFactor": 1, 743 | "legendFormat": "{{ alias }}", 744 | "refId": "A", 745 | "step": 60 746 | } 747 | ], 748 | "thresholds": [], 749 | "timeFrom": null, 750 | "timeRegions": [], 751 | "timeShift": null, 752 | "title": "电信延迟一览 (ms)", 753 | "tooltip": { 754 | "shared": true, 755 | "sort": 0, 756 | "value_type": "individual" 757 | }, 758 | "type": "graph", 759 | "xaxis": { 760 | "buckets": null, 761 | "mode": "time", 762 | "name": null, 763 | "show": true, 764 | "values": [] 765 | }, 766 | "yaxes": [ 767 | { 768 | "format": "short", 769 | "label": null, 770 | "logBase": 1, 771 | "max": null, 772 | "min": null, 773 | "show": true 774 | }, 775 | { 776 | "format": "short", 777 | "label": null, 778 | "logBase": 1, 779 | "max": null, 780 | "min": null, 781 | "show": true 782 | } 783 | ], 784 | "yaxis": { 785 | "align": false, 786 | "alignLevel": null 787 | } 788 | }, 789 | { 790 | "aliasColors": {}, 791 | "bars": false, 792 | "dashLength": 10, 793 | "dashes": false, 794 | "datasource": "Prometheus", 795 | "fill": 0, 796 | "gridPos": { 797 | "h": 7, 798 | "w": 24, 799 | "x": 0, 800 | "y": 27 801 | }, 802 | "id": 24, 803 | "legend": { 804 | "alignAsTable": true, 805 | "avg": false, 806 | "current": true, 807 | "max": true, 808 | "min": false, 809 | "rightSide": true, 810 | "show": true, 811 | "sort": "current", 812 | "sortDesc": true, 813 | "total": false, 814 | "values": true 815 | }, 816 | "lines": true, 817 | "linewidth": 1, 818 | "links": [], 819 | "nullPointMode": "null", 820 | "percentage": false, 821 | "pointradius": 5, 822 | "points": false, 823 | "renderer": "flot", 824 | "seriesOverrides": [], 825 | "spaceLength": 10, 826 | "stack": false, 827 | "steppedLine": false, 828 | "targets": [ 829 | { 830 | "expr": "smokeping_rrt{IDC=\"SH\",ISP=\"UNICOM\",instance=~\".*\",exported_job=\"smokeping-collected-UNICOM\" , alias=~'.*'}", 831 | "interval": "60s", 832 | "intervalFactor": 1, 833 | "legendFormat": "{{ alias }}", 834 | "refId": "A", 835 | "step": 60 836 | } 837 | ], 838 | "thresholds": [], 839 | "timeFrom": null, 840 | "timeRegions": [], 841 | "timeShift": null, 842 | "title": "联通延迟一览 (ms)", 843 | "tooltip": { 844 | "shared": true, 845 | "sort": 0, 846 | "value_type": "individual" 847 | }, 848 | "type": "graph", 849 | "xaxis": { 850 | "buckets": null, 851 | "mode": "time", 852 | "name": null, 853 | "show": true, 854 | "values": [] 855 | }, 856 | "yaxes": [ 857 | { 858 | "format": "short", 859 | "label": null, 860 | "logBase": 1, 861 | "max": null, 862 | "min": null, 863 | "show": true 864 | }, 865 | { 866 | "format": "short", 867 | "label": null, 868 | "logBase": 1, 869 | "max": null, 870 | "min": null, 871 | "show": true 872 | } 873 | ], 874 | "yaxis": { 875 | "align": false, 876 | "alignLevel": null 877 | } 878 | }, 879 | { 880 | "aliasColors": {}, 881 | "bars": false, 882 | "dashLength": 10, 883 | "dashes": false, 884 | "datasource": "Prometheus", 885 | "fill": 0, 886 | "gridPos": { 887 | "h": 7, 888 | "w": 24, 889 | "x": 0, 890 | "y": 34 891 | }, 892 | "id": 25, 893 | "legend": { 894 | "alignAsTable": true, 895 | "avg": false, 896 | "current": true, 897 | "max": true, 898 | "min": false, 899 | "rightSide": true, 900 | "show": true, 901 | "sort": "current", 902 | "sortDesc": true, 903 | "total": false, 904 | "values": true 905 | }, 906 | "lines": true, 907 | "linewidth": 1, 908 | "links": [], 909 | "nullPointMode": "null", 910 | "percentage": false, 911 | "pointradius": 5, 912 | "points": false, 913 | "renderer": "flot", 914 | "seriesOverrides": [], 915 | "spaceLength": 10, 916 | "stack": false, 917 | "steppedLine": false, 918 | "targets": [ 919 | { 920 | "expr": "smokeping_rrt{IDC=\"SH\",ISP=\"CMCC\",instance=~\".*\",exported_job=\"smokeping-collected-CMCC\" , alias=~'.*'}", 921 | "intervalFactor": 2, 922 | "legendFormat": "{{ alias }}", 923 | "refId": "A", 924 | "step": 4 925 | } 926 | ], 927 | "thresholds": [], 928 | "timeFrom": null, 929 | "timeRegions": [], 930 | "timeShift": null, 931 | "title": "移动延迟一览 (ms)", 932 | "tooltip": { 933 | "shared": true, 934 | "sort": 0, 935 | "value_type": "individual" 936 | }, 937 | "type": "graph", 938 | "xaxis": { 939 | "buckets": null, 940 | "mode": "time", 941 | "name": null, 942 | "show": true, 943 | "values": [] 944 | }, 945 | "yaxes": [ 946 | { 947 | "format": "short", 948 | "label": null, 949 | "logBase": 1, 950 | "max": null, 951 | "min": null, 952 | "show": true 953 | }, 954 | { 955 | "format": "short", 956 | "label": null, 957 | "logBase": 1, 958 | "max": null, 959 | "min": null, 960 | "show": true 961 | } 962 | ], 963 | "yaxis": { 964 | "align": false, 965 | "alignLevel": null 966 | } 967 | }, 968 | { 969 | "aliasColors": {}, 970 | "bars": false, 971 | "dashLength": 10, 972 | "dashes": false, 973 | "datasource": "Prometheus", 974 | "fill": 0, 975 | "gridPos": { 976 | "h": 7, 977 | "w": 24, 978 | "x": 0, 979 | "y": 41 980 | }, 981 | "id": 26, 982 | "legend": { 983 | "alignAsTable": true, 984 | "avg": false, 985 | "current": true, 986 | "max": true, 987 | "min": false, 988 | "rightSide": true, 989 | "show": true, 990 | "total": false, 991 | "values": true 992 | }, 993 | "lines": true, 994 | "linewidth": 1, 995 | "links": [], 996 | "nullPointMode": "null", 997 | "percentage": false, 998 | "pointradius": 5, 999 | "points": false, 1000 | "renderer": "flot", 1001 | "seriesOverrides": [], 1002 | "spaceLength": 10, 1003 | "stack": false, 1004 | "steppedLine": false, 1005 | "targets": [ 1006 | { 1007 | "expr": "smokeping_rrt{IDC=\"SH\",ISP=\"TENCENT\",instance=~\".*\",exported_job=\"smokeping-collected-TENCENT\" , alias=~'.*'}", 1008 | "interval": "60s", 1009 | "intervalFactor": 1, 1010 | "legendFormat": "{{ alias }}", 1011 | "refId": "A", 1012 | "step": 60 1013 | } 1014 | ], 1015 | "thresholds": [], 1016 | "timeFrom": null, 1017 | "timeRegions": [], 1018 | "timeShift": null, 1019 | "title": "腾讯云延迟一览 (ms)", 1020 | "tooltip": { 1021 | "shared": true, 1022 | "sort": 0, 1023 | "value_type": "individual" 1024 | }, 1025 | "type": "graph", 1026 | "xaxis": { 1027 | "buckets": null, 1028 | "mode": "time", 1029 | "name": null, 1030 | "show": true, 1031 | "values": [] 1032 | }, 1033 | "yaxes": [ 1034 | { 1035 | "format": "short", 1036 | "label": null, 1037 | "logBase": 1, 1038 | "max": null, 1039 | "min": null, 1040 | "show": true 1041 | }, 1042 | { 1043 | "format": "short", 1044 | "label": null, 1045 | "logBase": 1, 1046 | "max": null, 1047 | "min": null, 1048 | "show": true 1049 | } 1050 | ], 1051 | "yaxis": { 1052 | "align": false, 1053 | "alignLevel": null 1054 | } 1055 | } 1056 | ], 1057 | "refresh": false, 1058 | "schemaVersion": 18, 1059 | "style": "dark", 1060 | "tags": [], 1061 | "templating": { 1062 | "list": [] 1063 | }, 1064 | "time": { 1065 | "from": "now-1h", 1066 | "to": "now" 1067 | }, 1068 | "timepicker": { 1069 | "refresh_intervals": [ 1070 | "5s", 1071 | "10s", 1072 | "30s", 1073 | "1m", 1074 | "5m", 1075 | "15m", 1076 | "30m", 1077 | "1h", 1078 | "2h", 1079 | "1d" 1080 | ], 1081 | "time_options": [ 1082 | "5m", 1083 | "15m", 1084 | "1h", 1085 | "6h", 1086 | "12h", 1087 | "24h", 1088 | "2d", 1089 | "7d", 1090 | "30d" 1091 | ] 1092 | }, 1093 | "timezone": "browser", 1094 | "title": "佛山机房到全国监测点速率", 1095 | "uid": "DS5LhFZWk", 1096 | "version": 2 1097 | } 1098 | -------------------------------------------------------------------------------- /img/grafana_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spider-Zhong/idcping-smokeping/c12bcfa62e2fc1ce6b355ac9324c7e04cb69c192/img/grafana_01.png -------------------------------------------------------------------------------- /img/grafana_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Spider-Zhong/idcping-smokeping/c12bcfa62e2fc1ce6b355ac9324c7e04cb69c192/img/grafana_02.png -------------------------------------------------------------------------------- /prometheus/collection_to_prometheus.py: -------------------------------------------------------------------------------- 1 | #coding:utf-8 2 | import requests 3 | import rrdtool 4 | import os 5 | import logging 6 | import logging.handlers 7 | 8 | 9 | paras = { 10 | 'province_map' : { 11 | 'foshan' : '佛山' , 12 | 'nanning' : '南宁' , 13 | 'anhui' : '安徽' , 14 | 'beijing' : '北京' , 15 | 'chongqing' : '重庆' , 16 | 'fujian' : '福建' , 17 | 'gansu' : '甘肃' , 18 | 'guangdong' : '广东' , 19 | 'guangxi' : '广西' , 20 | 'guizhou' : '贵州' , 21 | 'hainan' : '海南' , 22 | 'hebei' : '河北' , 23 | 'heilongjiang' : '黑龙江' , 24 | 'henan' : '河南' , 25 | 'hubei' : '湖北' , 26 | 'hunan' : '湖南' , 27 | 'jiangsu' : '江苏' , 28 | 'jiangxi' : '江西' , 29 | 'jilin' : '吉林' , 30 | 'liaoning' : '辽宁' , 31 | 'neimenggu' : '内蒙古' , 32 | 'ningxia' : '宁夏' , 33 | 'qinghai' : '青海' , 34 | 'shaanxi' : '陕西' , 35 | 'shandong' : '山东' , 36 | 'shanghai' : '上海' , 37 | 'shanxi' : '山西' , 38 | 'shenzhen' : '深圳' , 39 | 'sichuan' : '四川' , 40 | 'tianjin' : '天津' , 41 | 'xinjiang' : '新疆' , 42 | 'xizang' : '西藏' , 43 | 'yunnan' : '云南' , 44 | 'zhejiang' : '浙江' 45 | } , 46 | 'LOG_FILE' : '/tmp/smoking_pushgateway.log' , 47 | 'prometheus_gateway' : 'http://localhost:9091' , 48 | 'data_dir' : '/opt/smokeping/htdocs/data' 49 | } 50 | 51 | class LogHandler(object): 52 | def __init__(self, name): 53 | self.handler = logging.handlers.RotatingFileHandler(paras['LOG_FILE'] , maxBytes = 1024*1024 , backupCount = 5) 54 | formatter = logging.Formatter('%(asctime)s - %(name)s - %(message)s') 55 | self.handler.setFormatter(formatter) 56 | self.logger = logging.getLogger(name) 57 | self.logger.addHandler(self.handler) 58 | 59 | def __call__(self , func , *args , **kwargs): 60 | if func.__name__ == 'info' : 61 | self.logger.setLevel(logging.INFO) 62 | log_record = func(*args , **kwargs) 63 | self.logger.info(log_record) 64 | self.logger.removeHandler(self.handler) 65 | 66 | 67 | def pushMetrics(instance , ISP , key , value): 68 | headers = {'X-Requested-With': 'Python requests', 'Content-type': 'text/xml'} 69 | pushgateway = '%s/metrics/job/smokeping-collected-%s/instance/%s' % (paras['prometheus_gateway'] , ISP , instance) 70 | metrics = 'smokeping_%s{instance=\"%s\" , ISP=\"%s\" , IDC=\"%s\" , alias=\"%s\"} %d' % (key , instance , ISP , 'SH' , paras['province_map'].get(instance) , value) 71 | request_code = requests.post(pushgateway , data='{0}\n'.format(metrics) , headers=headers) 72 | @LogHandler(pushgateway) 73 | def info(): 74 | return metrics + ' - ' + str(request_code.status_code) 75 | 76 | def getMonitorData(rrd_file): 77 | rrd_info = rrdtool.info(rrd_file) 78 | last_update = rrd_info['last_update'] - 60 79 | args = '-s ' + str(last_update) 80 | results = rrdtool.fetch(rrd_file , 'AVERAGE' , args ) 81 | lost_package_num = int(results[2][0][1]) 82 | average_rrt = 0 if not results[2][0][2] else results[2][0][2] * 1000 83 | return lost_package_num , round(average_rrt , 4) 84 | 85 | 86 | if __name__ == '__main__': 87 | ISP_list = ['TELCOM' , 'CMCC' , 'UNICOM' , 'TENCENT'] 88 | for ISP in ISP_list: 89 | rrd_data_dir = os.path.join(paras["data_dir"], ISP) 90 | for filename in os.listdir(rrd_data_dir): 91 | (instance , postfix) = os.path.splitext(filename) 92 | if postfix == '.rrd' : 93 | (lost_package_num , rrt) = getMonitorData(os.path.join(paras["data_dir"] , ISP , filename)) 94 | pushMetrics(instance , ISP , 'rrt' , rrt) 95 | pushMetrics(instance , ISP , 'lost_package_num' , lost_package_num) 96 | -------------------------------------------------------------------------------- /smokeping/config: -------------------------------------------------------------------------------- 1 | *** General *** 2 | 3 | owner = Peter Random 4 | contact = some@address.nowhere 5 | mailhost = my.mail.host 6 | sendmail = /usr/sbin/sendmail 7 | # NOTE: do not put the Image Cache below cgi-bin 8 | # since all files under cgi-bin will be executed ... this is not 9 | # good for images. 10 | imgcache = /opt/smokeping/htdocs/cache 11 | imgurl = cache 12 | datadir = /opt/smokeping/htdocs/data 13 | piddir = /opt/smokeping/htdocs/var 14 | cgiurl = http://some.url/smokeping.cgi 15 | smokemail = /opt/smokeping/etc/smokemail.dist 16 | tmail = /opt/smokeping/etc/tmail.dist 17 | # specify this to get syslog logging 18 | syslogfacility = local0 19 | # each probe is now run in its own process 20 | # disable this to revert to the old behaviour 21 | # concurrentprobes = no 22 | 23 | *** Alerts *** 24 | to = alertee@address.somewhere 25 | from = smokealert@company.xy 26 | 27 | +someloss 28 | type = loss 29 | # in percent 30 | pattern = >0%,*12*,>0%,*12*,>0% 31 | comment = loss 3 times in a row 32 | 33 | *** Database *** 34 | 35 | step = 60 36 | pings = 20 37 | 38 | # consfn mrhb steps total 39 | 40 | AVERAGE 0.5 1 1008 41 | AVERAGE 0.5 12 4320 42 | MIN 0.5 12 4320 43 | MAX 0.5 12 4320 44 | AVERAGE 0.5 144 720 45 | MAX 0.5 144 720 46 | MIN 0.5 144 720 47 | 48 | *** Presentation *** 49 | 50 | charset = utf-8 51 | template = /opt/smokeping/etc/basepage.html.dist 52 | 53 | + charts 54 | 55 | menu = 排行榜 56 | title = 排行榜 57 | 58 | ++ stddev 59 | sorter = StdDev(entries=>4) 60 | title = 综合指数排行 61 | menu = 综合指数排行 62 | format = 综合指数 %f 63 | 64 | ++ max 65 | sorter = Max(entries=>5) 66 | title = 最大延迟排行 67 | menu = 最大延迟排行 68 | format = 最大延迟时间 %f 秒 69 | 70 | ++ loss 71 | sorter = Loss(entries=>5) 72 | title = 丢包率排行 73 | menu = 丢包率排行 74 | format = 丢包 %f 75 | 76 | ++ median 77 | sorter = Median(entries=>5) 78 | title = 平均延迟排行 79 | menu = 平均延迟排行 80 | format = 平均延迟 %f 秒 81 | 82 | + overview 83 | 84 | width = 860 85 | height = 150 86 | range = 10h 87 | 88 | + detail 89 | 90 | width = 860 91 | height = 200 92 | unison_tolerance = 2 93 | 94 | "Last 3 Hours" 3h 95 | "Last 30 Hours" 30h 96 | "Last 10 Days" 10d 97 | "Last 30 Days" 30d 98 | "Last 90 Days" 90d 99 | #+ hierarchies 100 | #++ owner 101 | #title = Host Owner 102 | #++ location 103 | #title = Location 104 | 105 | *** Probes *** 106 | 107 | + FPing 108 | 109 | binary = /usr/sbin/fping 110 | 111 | *** Slaves *** 112 | secrets=/opt/smokeping/etc/smokeping_secrets.dist 113 | +boomer 114 | display_name=boomer 115 | color=0000ff 116 | 117 | +slave2 118 | display_name=another 119 | color=00ff00 120 | 121 | *** Targets *** 122 | 123 | probe = FPing 124 | 125 | menu = Top 126 | title = IDC网络节点质量监控 127 | remark = Smokeping 网络质量监控系统 128 | 129 | 130 | @include /opt/smokeping/etc/location/telcom 131 | @include /opt/smokeping/etc/location/unicom 132 | @include /opt/smokeping/etc/location/cmcc 133 | @include /opt/smokeping/etc/location/tencent 134 | -------------------------------------------------------------------------------- /smokeping/location/cmcc: -------------------------------------------------------------------------------- 1 | + CMCC 2 | menu = 移动 3 | title = 移动 4 | 5 | 6 | ++ beijing 7 | menu = 北京 8 | title = 218.205.128.1 9 | host = 218.205.128.1 10 | 11 | ++ tianjin 12 | menu = 天津 13 | title = 211.137.160.1 14 | host = 211.137.160.1 15 | 16 | ++ hebei 17 | menu = 河北 18 | title = 111.11.64.142 19 | host = 111.11.64.142 20 | 21 | ++ neimenggu 22 | menu = 内蒙古 23 | title = 120.193.128.1 24 | host = 120.193.128.1 25 | 26 | ++ liaoning 27 | menu = 辽宁 28 | title = 211.140.192.4 29 | host = 211.140.192.4 30 | 31 | ++ heilongjiang 32 | menu = 黑龙江 33 | title = 111.40.0.1 34 | host = 111.40.0.1 35 | 36 | ++ jilin 37 | menu = 吉林 38 | title = 211.137.209.1 39 | host = 211.137.209.1 40 | 41 | ++ shandong 42 | menu = 山东 43 | title = 111.14.208.227 44 | host = 111.14.208.227 45 | 46 | ++ shanxi 47 | menu = 山西 48 | title = 111.53.0.1 49 | host = 111.53.0.1 50 | 51 | ++ shanghai 52 | menu = 上海 53 | title = 117.184.42.114 54 | host = 117.184.42.114 55 | 56 | ++ zhejiang 57 | menu = 浙江 58 | title = 39.189.192.1 59 | host = 39.189.192.1 60 | 61 | ++ jiangsu 62 | menu = 江苏 63 | title = 120.195.118.1 64 | host = 120.195.118.1 65 | 66 | ++ anhui 67 | menu = 安徽 68 | title = 211.138.191.65 69 | host = 211.138.191.65 70 | 71 | ++ jiangxi 72 | menu = 江西 73 | title = 218.204.68.41 74 | host = 218.204.68.41 75 | 76 | ++ fujian 77 | menu = 福建 78 | title = 112.51.0.1 79 | host = 112.51.0.1 80 | 81 | ++ henan 82 | menu = 河南 83 | title = 111.7.128.1 84 | host = 111.7.128.1 85 | 86 | ++ hubei 87 | menu = 湖北 88 | title = 211.137.79.134 89 | host = 211.137.79.134 90 | 91 | ++ hunan 92 | menu = 湖南 93 | title = 111.8.37.1 94 | host = 111.8.37.1 95 | 96 | ++ guangdong 97 | menu = 广东 98 | title = 183.232.231.172 99 | host = 183.232.231.172 100 | 101 | ++ guangxi 102 | menu = 广西 103 | title = 111.12.25.1 104 | host = 111.12.25.1 105 | 106 | ++ shenzhen 107 | menu = 深圳 108 | title = 120.196.165.24 109 | host = 120.196.165.24 110 | 111 | ++ hainan 112 | menu = 海南 113 | title = 183.254.0.1 114 | host = 183.254.0.1 115 | 116 | ++ sichuan 117 | menu = 四川 118 | title = 111.9.142.1 119 | host = 111.9.142.1 120 | 121 | ++ chongqing 122 | menu = 重庆 123 | title = 218.206.10.211 124 | host = 218.206.10.211 125 | 126 | ++ guizhou 127 | menu = 贵州 128 | title = 117.135.211.1 129 | host = 117.135.211.1 130 | 131 | ++ yunnan 132 | menu = 云南 133 | title = 183.224.40.1 134 | host = 183.224.40.1 135 | 136 | ++ xizang 137 | menu = 西藏 138 | title = 117.136.18.1 139 | host = 117.136.18.1 140 | 141 | ++ shaanxi 142 | menu = 陕西 143 | title = 111.20.242.1 144 | host = 111.20.242.1 145 | 146 | ++ ningxia 147 | menu = 宁夏 148 | title = 211.138.60.1 149 | host = 211.138.60.1 150 | 151 | ++ gansu 152 | menu = 甘肃 153 | title = 218.203.196.1 154 | host = 218.203.196.1 155 | 156 | ++ qinghai 157 | menu = 青海 158 | title = 117.136.29.1 159 | host = 117.136.29.1 160 | 161 | ++ xinjiang 162 | menu = 新疆 163 | title = 36.187.251.1 164 | host = 36.187.251.1 165 | -------------------------------------------------------------------------------- /smokeping/location/telcom: -------------------------------------------------------------------------------- 1 | + TELCOM 2 | menu = 电信 3 | title = 电信 4 | 5 | 6 | ++ beijing 7 | menu = 北京 8 | title = 220.181.111.37 9 | host = 220.181.111.37 10 | 11 | ++ tianjin 12 | menu = 天津 13 | title = 42.122.0.1 14 | host = 42.122.0.1 15 | 16 | ++ hebei 17 | menu = 河北 18 | title = 47.92.159.1 19 | host = 47.92.159.1 20 | 21 | ++ neimenggu 22 | menu = 内蒙古 23 | title = 42.123.64.1 24 | host = 42.123.64.1 25 | 26 | ++ liaoning 27 | menu = 辽宁 28 | title = 1.180.240.1 29 | host = 1.180.240.1 30 | 31 | ++ heilongjiang 32 | menu = 黑龙江 33 | title = 222.170.0.61 34 | host = 222.170.0.61 35 | 36 | ++ jilin 37 | menu = 吉林 38 | title = 222.168.78.1 39 | host = 222.168.78.1 40 | 41 | ++ shandong 42 | menu = 山东 43 | title = 42.199.255.100 44 | host = 42.199.255.100 45 | 46 | ++ shanxi 47 | menu = 山西 48 | title = 59.49.13.40 49 | host = 59.49.13.40 50 | 51 | ++ shanghai 52 | menu = 上海 53 | title = 42.99.16.1 54 | host = 42.99.16.1 55 | 56 | ++ zhejiang 57 | menu = 浙江 58 | title = 36.24.124.1 59 | host = 36.24.124.1 60 | 61 | ++ jiangsu 62 | menu = 江苏 63 | title = 221.231.191.214 64 | host = 221.231.191.214 65 | 66 | ++ anhui 67 | menu = 安徽 68 | title = 61.190.246.5 69 | host = 61.190.246.5 70 | 71 | ++ jiangxi 72 | menu = 江西 73 | title = 202.101.224.68 74 | host = 202.101.224.68 75 | 76 | ++ fujian 77 | menu = 福建 78 | title = 202.101.98.55 79 | host = 202.101.98.55 80 | 81 | ++ henan 82 | menu = 河南 83 | title = 1.193.128.1 84 | host = 1.193.128.1 85 | 86 | ++ hubei 87 | menu = 湖北 88 | title = 111.175.233.30 89 | host = 111.175.233.30 90 | 91 | ++ hunan 92 | menu = 湖南 93 | title = 124.232.134.54 94 | host = 124.232.134.54 95 | 96 | ++ guangdong 97 | menu = 广东 98 | title = 14.215.177.38 99 | host = 14.215.177.38 100 | 101 | ++ guangxi 102 | menu = 广西 103 | title = 222.217.164.38 104 | host = 222.217.164.38 105 | 106 | ++ shenzhen 107 | menu = 深圳 108 | title = 58.60.3.102 109 | host = 58.60.3.102 110 | 111 | ++ hainan 112 | menu = 海南 113 | title = 112.66.250.63 114 | host = 112.66.250.63 115 | 116 | ++ sichuan 117 | menu = 四川 118 | title = 61.139.2.69 119 | host = 61.139.2.69 120 | 121 | ++ chongqing 122 | menu = 重庆 123 | title = 14.106.255.33 124 | host = 14.106.255.33 125 | 126 | ++ guizhou 127 | menu = guizhou 128 | title = 59.51.128.31 129 | host = 59.51.128.31 130 | 131 | ++ yunnan 132 | menu = 云南 133 | title = 222.172.200.5 134 | host = 222.172.200.5 135 | 136 | ++ xizang 137 | menu = 西藏 138 | title = 124.31.0.1 139 | host = 124.31.0.1 140 | 141 | ++ shaanxi 142 | menu = 陕西 143 | title = 125.76.191.163 144 | host = 125.76.191.163 145 | 146 | ++ ningxia 147 | menu = 宁夏 148 | title = 61.133.192.51 149 | host = 61.133.192.51 150 | 151 | ++ gansu 152 | menu = 甘肃 153 | title = 61.178.252.218 154 | host = 61.178.252.218 155 | 156 | ++ qinghai 157 | menu = 青海 158 | title = 223.220.241.26 159 | host = 223.220.241.26 160 | 161 | ++ xinjiang 162 | menu = 新疆 163 | title = 61.128.96.1 164 | host = 61.128.96.1 165 | -------------------------------------------------------------------------------- /smokeping/location/tencent: -------------------------------------------------------------------------------- 1 | + TENCENT 2 | menu = 腾讯云 3 | title = 腾讯云 4 | 5 | ++ beijing 6 | menu = 北京市海淀区 腾讯云 7 | title = 118.89.212.13 8 | host = 118.89.212.13 9 | -------------------------------------------------------------------------------- /smokeping/location/unicom: -------------------------------------------------------------------------------- 1 | + UNICOM 2 | menu = 联通 3 | title = 联通 4 | 5 | 6 | ++ beijing 7 | menu = 北京 8 | title = 61.135.169.125 9 | host = 61.135.169.125 10 | 11 | ++ tianjin 12 | menu = 天津 13 | title = 202.99.96.38 14 | host = 202.99.96.38 15 | 16 | ++ hebei 17 | menu = 河北 18 | title = 60.8.10.39 19 | host = 60.8.10.39 20 | 21 | ++ neimenggu 22 | menu = 内蒙古 23 | title = 1.24.200.1 24 | host = 1.24.200.1 25 | 26 | ++ liaoning 27 | menu = 辽宁 28 | title = 218.60.54.164 29 | host = 218.60.54.164 30 | 31 | ++ heilongjiang 32 | menu = 黑龙江 33 | title = 1.62.111.1 34 | host = 1.62.111.1 35 | 36 | ++ jilin 37 | menu = 吉林 38 | title = 125.32.127.2 39 | host = 125.32.127.2 40 | 41 | ++ shandong 42 | menu = 山东 43 | title = 27.211.0.1 44 | host = 27.211.0.1 45 | 46 | ++ shanxi 47 | menu = 山西 48 | title = 218.26.171.2 49 | host = 218.26.171.2 50 | 51 | ++ shanghai 52 | menu = 上海 53 | title = 58.39.117.1 54 | host = 58.39.117.1 55 | 56 | 57 | ++ zhejiang 58 | menu = 浙江 59 | title = 43.240.204.1 60 | host = 43.240.204.1 61 | 62 | ++ jiangsu 63 | menu = 江苏 64 | title = 112.80.248.75 65 | host = 112.80.248.75 66 | 67 | ++ anhui 68 | menu = 安徽 69 | title = 36.32.0.1 70 | host = 36.32.0.1 71 | 72 | ++ jiangxi 73 | menu = 江西 74 | title = 118.212.189.129 75 | host = 118.212.189.129 76 | 77 | ++ fujian 78 | menu = 福建 79 | title = 202.101.98.55 80 | host = 202.101.98.55 81 | 82 | ++ henan 83 | menu = 河南 84 | title = 61.54.42.250 85 | host = 61.54.42.250 86 | 87 | ++ hubei 88 | menu = 湖北 89 | title = 218.106.115.1 90 | host = 218.106.115.1 91 | 92 | ++ hunan 93 | menu = 湖南 94 | title = 42.48.0.1 95 | host = 42.48.0.1 96 | 97 | ++ guangdong 98 | menu = 广东 99 | title = 163.177.151.110 100 | host = 163.177.151.110 101 | 102 | ++ guangxi 103 | menu = 广西 104 | title = 110.72.232.1 105 | host = 110.72.232.1 106 | 107 | ++ shenzhen 108 | menu = 深圳 109 | title = 58.250.0.1 110 | host = 58.250.0.1 111 | 112 | ++ hainan 113 | menu = 海南 114 | title = 124.66.0.1 115 | host = 124.66.0.1 116 | 117 | ++ sichuan 118 | menu = 四川 119 | title = 112.193.58.1 120 | host = 112.193.58.1 121 | 122 | ++ chongqing 123 | menu = 重庆 124 | title = 27.9.99.1 125 | host = 27.9.99.1 126 | 127 | ++ guizhou 128 | menu = guizhou 129 | title = 58.16.244.1 130 | host = 58.16.244.1 131 | 132 | ++ yunnan 133 | menu = 云南 134 | title = 14.204.208.1 135 | host = 14.204.208.1 136 | 137 | ++ xizang 138 | menu = 西藏 139 | title = 27.98.236.1 140 | host = 27.98.236.1 141 | 142 | ++ shaanxi 143 | menu = 陕西 144 | title = 123.139.196.1 145 | host = 123.139.196.1 146 | 147 | ++ ningxia 148 | menu = 宁夏 149 | title = 211.93.0.1 150 | host = 211.93.0.1 151 | 152 | ++ gansu 153 | menu = 甘肃 154 | title = 60.13.0.1 155 | host = 60.13.0.1 156 | 157 | ++ qinghai 158 | menu = 青海 159 | title = 175.184.184.1 160 | host = 175.184.184.1 161 | 162 | ++ xinjiang 163 | menu = 新疆 164 | title = 60.13.194.1 165 | host = 60.13.194.1 166 | --------------------------------------------------------------------------------