All Projects → frankiexyz → ping-exporter

frankiexyz / ping-exporter

Licence: other
Prometheus Ping exporter

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to ping-exporter

Prettyping
`prettyping` is a wrapper around the standard `ping` tool, making the output prettier, more colorful, more compact, and easier to read.
Stars: ✭ 922 (+1436.67%)
Mutual labels:  ping, network-monitoring
Multi-Ping
No description or website provided.
Stars: ✭ 22 (-63.33%)
Mutual labels:  ping, fping
Go Ping
A simple ping library using ICMP echo requests.
Stars: ✭ 158 (+163.33%)
Mutual labels:  ping, network-monitoring
Fping
High performance ping tool
Stars: ✭ 652 (+986.67%)
Mutual labels:  ping, network-monitoring
dstp
🧪 Run common networking tests against any site.
Stars: ✭ 919 (+1431.67%)
Mutual labels:  ping, network-monitoring
PingoMeter
PingoMeter - is a small portable program that show your ping in Windows system tray
Stars: ✭ 91 (+51.67%)
Mutual labels:  ping
webping
🚦 Python script to monitor web pages.
Stars: ✭ 20 (-66.67%)
Mutual labels:  ping
D1Proxy
A simple yet powerful Java 11 TCP MITM proxy for Dofus 1.29.1
Stars: ✭ 17 (-71.67%)
Mutual labels:  network-monitoring
draftjs exporter
Library to convert Draft.js ContentState to HTML
Stars: ✭ 77 (+28.33%)
Mutual labels:  exporter
extractors
Data extractors for import demo-date to the api
Stars: ✭ 44 (-26.67%)
Mutual labels:  exporter
kping
Large Scale, High Performance flood ping.
Stars: ✭ 16 (-73.33%)
Mutual labels:  ping
ping-multi
Interactively ping multiple hosts from one location
Stars: ✭ 15 (-75%)
Mutual labels:  ping
wifianalyse
simple bash script to monitor wifi signal and ping time
Stars: ✭ 49 (-18.33%)
Mutual labels:  ping
yoda
GitHub extension for agile project management, using the issues subsystem.
Stars: ✭ 86 (+43.33%)
Mutual labels:  exporter
QDNetDiagnostics
iOS网络测试小工具
Stars: ✭ 23 (-61.67%)
Mutual labels:  ping
site-monitor
监控网站的可访问性的监控系统
Stars: ✭ 48 (-20%)
Mutual labels:  ping
How-to-Deconstruct-Ping-with-C-and-NodeJS
🙈 Simple examples that show how to work with binary headers in C and NodeJS
Stars: ✭ 51 (-15%)
Mutual labels:  ping
prometheus exporter base
Base library for Rust Prometheus exporters
Stars: ✭ 30 (-50%)
Mutual labels:  exporter
tracboat
Trac to GitLab migration toolbox
Stars: ✭ 32 (-46.67%)
Mutual labels:  exporter
ping-viewer
Ping Viewer is an open-source application to view and record data from the Blue Robotics Ping Echosounder
Stars: ✭ 30 (-50%)
Mutual labels:  ping

ping-exporter

Introduction

Prometheus Ping Exporter is a simple python script which utilize fping to probe endpoint through ICMP and parsing the output to Prometheus. The result can then be visualize through Grafana with ease.

Requirements

  • Python 2.x
  • fping 4.x

Screenshots alt text

For Debian user, you can get the fping deb file from http://ftp.debian.org/debian/pool/main/f/fping/fping_4.0-1_armhf.deb

For docker user, you can build the container with the Docker file (based on alpine around 54M). For arm user, you can change FROM to "armhf/alpine:edge"

PS: The script is working fine with > 40 ping target in a PI 3B.

Getting Started

  1. Download ping-exporter.py and place it inside /opt/
# cd /opt/
# curl  -O https://raw.githubusercontent.com/frankiexyz/ping-exporter/master/ping-exporter.py
  1. Ensure Correct Permission on ping-exporter.py
# chmod 755 /opt/ping-exporter.py
  1. Running The Ping Exporter
# /usr/bin/python /opt/ping-exporter.py
  1. Testing The Script
# curl "127.0.0.1:8085/?target=8.8.8.8"

Running Script On System Startup

CentOS 7 (Using Systemd)

  1. Create a new ping_exporter.service file at /lib/systemd/system/
vi /lib/systemd/system/ping_exporter.service
  1. Paste The Following into ping_exporter.service
[Unit]
Description=Ping Exporter for Prometheus (Created By Frankie)
After=multi-user.target

[Service]
Type=idle
ExecStart=/usr/bin/python /opt/ping-exporter.py

[Install]
WantedBy=multi-user.target
  1. Save The File and Execute systemctl daemon-reload
# systemctl daemon-reload
  1. Start and Enable Ping Exporter Service
# systemctl start ping_exporter.service
# systemctl enable ping_exporter.service

Configuration

Prometheus Configuration

Append the following in prometheus's config (Default is prometheus.yml)

  - job_name: 'ping-exporter'
    scrape_interval: 60s
    metrics_path: /probe
    params:
         prot: ['4']
    static_configs:
      - targets:
          - www.ifconfig.xyz
          - www.google.com
    relabel_configs:
      - source_labels: [__address__]
        target_label: __param_target
        replacement: ${1}
      - source_labels: [__param_target]
        regex: (.*)
        target_label: instance
        replacement: ${1}
      - source_labels: []
        regex: .*
        target_label: __address__
        replacement: <Your exporter IP>:8085

You might want to add or change the following parameters in params's section to match your requirements

    params:
         # Default Is IPv4, Can Be Changed To IPv6
         prot: ['4']

         # Ping Packet Size (Default value is 56)
         size: ['56']

         # Ping Count (Default value is 10 times)
         count: ['10']

         # Ping Interval (Default value is 500ms)
         interval: ['500']

         # Source address for ping (System default used if not specified)
         source: ['10.10.10.10']

Prometheus configuration example where the job pings a single destination (params:target) but from multiple source addresses (static_config:targets) to determine the quality of each route / path:

- job_name: 'ping-exporter'
  scrape_interval: 60s
  metrics_path: /probe
  params:
       prot: ['4']
       count: ['3']
       target: ['207.225.112.9']
  static_configs:
    - targets:
        - 192.168.101.2
        - 192.168.102.2
        - 192.168.103.2
        - 192.168.104.2
  relabel_configs:
    - source_labels: [__address__]
      target_label: __param_source
      replacement: ${1}
    - source_labels: [__param_target]
      regex: (.*)
      target_label: instance
      replacement: ${1}
    - source_labels: [__param_source]
      regex: (.*)
      target_label: source
      replacement: ${1}
    - source_labels: []
      regex: .*
      target_label: __address__
      replacement: localhost:8085
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].