Git Product home page Git Product logo

cloudflare-grafana's Introduction

Cloudflare-Grafana

Grafana Dashboard that shows Cloudflare Overviews and Analytics from the RESTful API

Configuration Script

Place the script where you want, there is no importance.

change the Configuration section within your details :

##
# Configurations
##
# Endpoint URL for InfluxDB
InfluxDBURL="YOURINFLUXSERVERIP" #Your InfluxDB Server, http://FQDN or https://FQDN if using SSL
InfluxDBPort="8086" #Default Port
InfluxBucket="YOURINFLUXBUCKETNAME" #Default Database
InfluxOrg="YOURINFLUXORG"
InfluxToken="YOURINFLUXTOKEN"

# Endpoint URL for login action
cloudflareauthmethod="TOKEN/APIKEY" #Choose Authentication method. Either TOKEN (single token with specific rights) or APIKEY (Global API KEY with Email)
cloudflareapikey="YOURAPIKEY"
cloudflarezone="YOURZONEID"
cloudflareemail="YOUREMAIL"
cloudflareapitoken="YOURTOKEN"

Once the changes are done, make the script executable with chmod:

chmod +x cloudflare-analytics.sh

The output of the command should be something like the next, without errors:

HTTP/1.1 204 No Content
Content-Type: application/json
Request-Id: b084ba16-8622-11ea-8dbc-0050569002da
X-Influxdb-Build: OSS
X-Influxdb-Version: 1.7.10
X-Request-Id: b084ba16-8622-11ea-8dbc-0050569002da
Date: Fri, 24 Apr 2020 11:56:53 GMT

If so, please now add this script to your crontab, like for example everyday at 9am:

0 9 * * * /home/user/cloudflare-analytics.sh >> /var/log/cloudflare.log 2>&1

Configuration InfluxDb

You should create a specific bucket with a specific token with read/write permission on the bucket.

Configuration Grafana

You must add a Data Sources to the influxDB bucket. You must set the Query language to Flux.

You can import the dashboard from Grafana website : https://grafana.com/grafana/dashboards/20682-cloudflare-analytics-and-overview/ ID : 20682

Known Bug

  • The Geomap panel is not displaying informations. If you know how to do please add a pull request.

cloudflare-grafana's People

Contributors

pokertour avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.