This page looks best with JavaScript enabled

Deploying smokeping-prober to Probe Network Quality

1. What smokeping-prober Is

smokeping-prober is a tool for probing network quality. It probes network quality by sending ICMP requests to target nodes.

2. Deploying smokeping-prober

2.1 Generating the smokeping-prober.yaml Configuration File

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
cat > smokeping_prober.yaml <<EOF
---
targets:
- hosts:
  - 1.2.3.4
  interval: 1s # Duration, Default 1s.
  network: ip # One of ip, ip4, ip6. Default: ip (automatic IPv4/IPv6)
  protocol: icmp # One of icmp, udp. Default: icmp (Requires privileged operation)
  size: 56 # Packet data size in bytes. Default 56 (Range: 24 - 65535)
  tos: 0x00 # Packet ToS field in decimal, hexadecimal or binary format. Default: 0 (Range: 0-255)
EOF

2.2 Starting smokeping-prober

  • Start
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
nerdctl run -d \
  --name smokeping_prober \
  --restart always \
  --security-opt apparmor=unconfined \
  --security-opt seccomp=unconfined \
  -v `pwd`/smokeping_prober.yaml:/etc/smokeping_prober.yml \
  -p 9374:9374 \
  --privileged \
  quay.io/superq/smokeping-prober:v0.9.0 \
  --config.file=/etc/smokeping_prober.yml
  • Stop
1
nerdctl rm -f smokeping_prober
  • View logs
1
nerdctl logs smokeping_prober -f
  • Restart
1
nerdctl restart smokeping_prober

2.3 Deploying the Endpoints for smokeping-prober

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
kubectl apply -f - <<EOF
apiVersion: v1
kind: Service
metadata:
  name: smokeping-service
  namespace: default
  labels:
    app: smokeping
spec:
  ports:
  - name: metrics
    port: 9374
    protocol: TCP
---
apiVersion: v1
kind: Endpoints
metadata:
  name: smokeping-service
  namespace: default
subsets:
- addresses:
  - ip: 1.2.3.4
  ports:
  - name: metrics
    port: 9374
    protocol: TCP
EOF

2.4 Deploying the ServiceMonitor for smokeping-prober

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
kubectl apply -f - <<EOF
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: smokeping-monitor
  namespace: monitoring
  labels:
    tier: ai
spec:
  endpoints:
  - interval: 1s
    port: metrics
    path: /metrics
    scheme: http
    honorLabels: true
    relabelings:
    - action: replace
      sourceLabels: [__address__]
      targetLabel: node
      regex: (.*):.*
      replacement: $1
    - action: replace
      replacement: smokeping
      targetLabel: role
  selector:
    matchLabels:
      app: smokeping
  namespaceSelector:
    matchNames:
    - default
EOF

3. Viewing smokeping-prober Metrics

Import the dashboard https://grafana.com/grafana/dashboards/11335-smoke-ping/

You can view network quality metrics such as packet loss rate and latency.

You will see a dashboard like this

The metric shown on the dashboard is the packet loss count. If you want to view the packet loss rate, you can add a computed metric, with the formula:

1
2
3
(rate(smokeping_requests_total{host="$target"}[30s]) - rate(smokeping_response_duration_seconds_count{host="$target"}[5m]))
/
rate(smokeping_requests_total{host="$target"}[30s]) / 100

WeChat Official Account
WRITTEN BY
WeChat Official Account