Mount Monitoring with Prometheus and Grafana

Hi,

spend the past hours to implement rclone mount with --rc to import some /metrics to prometheus and make a grafana rclone dashboard for monitoring.
The rclone docs for remote controlling rclone are very good, thanks to @ncw. So lets start with prometheus configuration. To import the metrics from our rclone mount into prometheus we need a scrape_config in the prometheus.yaml config file.

# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"

  # A scrape configuration containing exactly one endpoint to scrape:
  # Here it's Prometheus itself.
  scrape_configs:

  # Make Prometheus scrape itself for metrics.
  - job_name: 'prometheus'
    static_configs:
    - targets: ['localhost:9090']
  
  # scrape rclone rc
  - job_name: 'rclone_scrape'
    static_configs:
    - targets: ['localhost:5572'] # Server IP with "rclone mount --rc"
    basic_auth:
      username: 'rclone'
      password: '<your-secret-pass>' 

the username + password authentication in the basic_auth part of the job rclone_scrape must be the same you specified with --rc-user and --rc-pass in rclone mount --rc

Now we can check the correct config in the prometheus webui

  • prometheus.host:9090/targets to check rclone_scrape
  • prometheus.host:9090/graph to check the rclone metrics (rclone_bytes_transferred_total)

Finally we can create our grafana dashboard individually. Here is my dashboard that I want to share with you. I am looking forward to your feedback! :smiley:

Rclone-1602705184340.json.txt (13.5 KB) please rename to .json to import into grafana

2 Likes

Nifty. I play around a lot with Grafana so that's pretty cool. Will have to take a look once I get some cycles.

That is very nice! Do you know of a getting starting with Prometheus and Grafana guide? I've got several things I'd like to monitor now so It is probably about time I got stuck in.

In my opinion the grafana and prometheus docs are great. I haven't use any Tutorials, just the docs. I can add the needed steps to install prometheus, grafana and a rclone mount on a linux machine to use this howto.

What would you like to monitor? This time I monitor nginx, php-fpm, pihole, rclone and of course the server itsself and visualize it in grafana dashboards

Can you monitor succesful execution of scripts? I have backup scripts which I'd like to see whether they execute properly. I don't want an alert I just want to see a graph with working or not working on it.

to check a boolean in /metrics is quite easy. I have this in my pihole_scrape for the status (enable/disable). In Grafana it's just a green/red Button. But I haven't yet create a exporter to serve /metrics.

1 Like