Skip to content

nepeta-cataria/grafana-python-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Grafana Backup and Restore

This script can:

  • Donwload datasources, folders and dashboards to json files from Grafana.
  • Upload datasources, folders and dashboards from json files to Grafana.

Requirements

  • python3
  • requests

Usage

Required environment variables:

Optional environment variables:

  • DIR_DATASOURCES - Grafana Datasources directory. Will be created if not exist. (Default is ./datasources)
  • DIR_FOLDERS - Grafana Folders directory. Will be created if not exist. (Default is ./folders)
  • DIR_DASHBOARDS - Grafana Dashboards directory. Will be created if not exist. (Default is ./dashboards)
  • LOG_LEVEL - Logging level. (Default is INFO)

Running script:

main.py <action>

Actions:

  --help                show this help message and exit
  --get-datasources     download datasources as json files
  --get-folders         download folders as json files
  --get-dashboards      download dashasboards json files
  --upload-datasources  upload datasources from json files
  --upload-folders      upload folders from json files
  --upload-dashboards   upload dashboards from json files

NOTE: Folders upload must be executed before uploading dashboards! When uploading dashboards, script will make a request to Grafana instance to get folders IDs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages