{"id":13586394,"url":"https://github.com/frankiexyz/ping-exporter","last_synced_at":"2025-04-07T15:31:50.101Z","repository":{"id":178212137,"uuid":"61291982","full_name":"frankiexyz/ping-exporter","owner":"frankiexyz","description":"Prometheus Ping exporter","archived":true,"fork":false,"pushed_at":"2020-09-15T15:56:59.000Z","size":107,"stargazers_count":61,"open_issues_count":7,"forks_count":32,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-02-14T21:27:15.725Z","etag":null,"topics":["exporter","fping","network-monitoring","ping","prometheus"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/frankiexyz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-16T12:45:45.000Z","updated_at":"2024-08-01T16:32:23.051Z","dependencies_parsed_at":"2024-04-24T11:02:50.375Z","dependency_job_id":null,"html_url":"https://github.com/frankiexyz/ping-exporter","commit_stats":null,"previous_names":["frankiexyz/ping-exporter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankiexyz%2Fping-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankiexyz%2Fping-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankiexyz%2Fping-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frankiexyz%2Fping-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frankiexyz","download_url":"https://codeload.github.com/frankiexyz/ping-exporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223285387,"owners_count":17119893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["exporter","fping","network-monitoring","ping","prometheus"],"created_at":"2024-08-01T15:05:32.337Z","updated_at":"2025-04-07T15:31:50.094Z","avatar_url":"https://github.com/frankiexyz.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# ping-exporter\n\n## Introduction\n\nPrometheus 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.\n\n**Requirements**\n- Python 2.x\n- fping 4.x\n\n**Screenshots**\n![alt text](https://raw.githubusercontent.com/frankiexyz/ping-exporter/master/ping.png)\n\nFor 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\n\nFor 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\"\n\nPS: The script is working fine with \u003e 40 ping target in a PI 3B.\n\n## Getting Started\n\n1. Download ping-exporter.py and place it inside /opt/\n```\n# cd /opt/\n# curl  -O https://raw.githubusercontent.com/frankiexyz/ping-exporter/master/ping-exporter.py\n```\n\n2. Ensure Correct Permission on ping-exporter.py\n```\n# chmod 755 /opt/ping-exporter.py\n```\n\n3. Running The Ping Exporter\n```\n# /usr/bin/python /opt/ping-exporter.py\n```\n\n4. Testing The Script\n```\n# curl \"127.0.0.1:8085/?target=8.8.8.8\"\n```\n\n### Running Script On System Startup\n\n**CentOS 7 (Using Systemd)**\n\n1. Create a new ping_exporter.service file at /lib/systemd/system/\n```\nvi /lib/systemd/system/ping_exporter.service\n```\n\n2. Paste The Following into ping_exporter.service\n\n```\n[Unit]\nDescription=Ping Exporter for Prometheus (Created By Frankie)\nAfter=multi-user.target\n\n[Service]\nType=idle\nExecStart=/usr/bin/python /opt/ping-exporter.py\n\n[Install]\nWantedBy=multi-user.target\n```\n\n3. Save The File and Execute systemctl daemon-reload\n```\n# systemctl daemon-reload\n```\n\n4. Start and Enable Ping Exporter Service\n```\n# systemctl start ping_exporter.service\n# systemctl enable ping_exporter.service\n```\n\n## Configuration\n\n### Prometheus Configuration\n\nAppend the following in prometheus's config (Default is prometheus.yml)\n\n```\n  - job_name: 'ping-exporter'\n    scrape_interval: 60s\n    metrics_path: /probe\n    params:\n         prot: ['4']\n    static_configs:\n      - targets:\n          - www.ifconfig.xyz\n          - www.google.com\n    relabel_configs:\n      - source_labels: [__address__]\n        target_label: __param_target\n        replacement: ${1}\n      - source_labels: [__param_target]\n        regex: (.*)\n        target_label: instance\n        replacement: ${1}\n      - source_labels: []\n        regex: .*\n        target_label: __address__\n        replacement: \u003cYour exporter IP\u003e:8085\n```\n\nYou might want to add or change the following parameters in params's section to match your requirements\n\n```\n    params:\n         # Default Is IPv4, Can Be Changed To IPv6\n         prot: ['4']\n\n         # Ping Packet Size (Default value is 56)\n         size: ['56']\n\n         # Ping Count (Default value is 10 times)\n         count: ['10']\n\n         # Ping Interval (Default value is 500ms)\n         interval: ['500']\n\n         # Source address for ping (System default used if not specified)\n         source: ['10.10.10.10']\n```\n\nPrometheus 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:\n\n```\n- job_name: 'ping-exporter'\n  scrape_interval: 60s\n  metrics_path: /probe\n  params:\n       prot: ['4']\n       count: ['3']\n       target: ['207.225.112.9']\n  static_configs:\n    - targets:\n        - 192.168.101.2\n        - 192.168.102.2\n        - 192.168.103.2\n        - 192.168.104.2\n  relabel_configs:\n    - source_labels: [__address__]\n      target_label: __param_source\n      replacement: ${1}\n    - source_labels: [__param_target]\n      regex: (.*)\n      target_label: instance\n      replacement: ${1}\n    - source_labels: [__param_source]\n      regex: (.*)\n      target_label: source\n      replacement: ${1}\n    - source_labels: []\n      regex: .*\n      target_label: __address__\n      replacement: localhost:8085\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrankiexyz%2Fping-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrankiexyz%2Fping-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrankiexyz%2Fping-exporter/lists"}