A simple cron script to pull cloudflare analytics data into influxdb
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
composer.json
composer.lock
config.json.example
scrape.php

README.md

Cloudflare2DB

Scrapes cloudflare analytics information (bandwidth, and requests) into an InfluxDB for use with Grafana.

Installation

  1. Install PHP and Composer
  2. Clone Repo
  3. Copy config.json.example => config.json
  4. Define your Influx database credentials & Cloudflare API settings in config.json
  5. Run composer install
  6. Test run php scrape.php in your console
  7. Add php scrape.php to your crontab.

Usage

After testing that your cron is running, it is easy to add the data to a Grafana instance. Add the InfluxDB as a Grafana data source, and the cloudflare stats will now be visible in your dashboard editor.

Example