From 4afa9f0ea5cb979369c55867e8a658a37fb9b5c1 Mon Sep 17 00:00:00 2001 From: hugovalente-pm Date: Thu, 6 Oct 2022 13:31:44 +0100 Subject: [PATCH 1/4] review installation section --- README.md | 50 ++++++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 90376ed..70e6e2b 100644 --- a/README.md +++ b/README.md @@ -49,9 +49,11 @@ Once you have added your API token to Netdata data source plugin you’re ready To start using the Netdata data source plugin on your Grafana environment, local or Cloud, you need to install the plugin manually - it currently isn't signed. Here are some tips to get through this depending on your setup: * Docker * Linux (local) -* Windows (local) +* Windows (local - powershell) * Building the plugin locally +The installations below will use different tools like: curl, docker, jq, wget, unzip and xcopy. + ### Docker #### Pre-buit script - setup-demo-environment @@ -83,22 +85,20 @@ This script will: 2. Ensure you have the desired version of the plugin you want to install, get it from github releases ``` - curl -s https://api.github.com/repos/netdata/netdata-grafana-datasource-plugin/releases/latest \ - jq -r '.assets[] | select(.name|match("zip$")) | .browser_download_url' + wget `curl -s https://api.github.com/repos/netdata/netdata-grafana-datasource-plugin/releases/latest | jq -r '.assets[] | select(.name|match("zip$")) | .browser_download_url'` ``` -3. Grafana plugins, by default, should be under /var/lib/grafana/plugins. Create a folder for netdata inside the container. Enter in an interactive session +3. Copy the contents of the Netdata data source plugin to Grafana plugins directory, by default /var/lib/grafana/plugins ``` - docker exec -ti grafana bash - mkdir /var/lib/grafana/plugins/netdata + unzip netdata-datasource-.zip + docker cp netdata-datasource grafana:/var/lib/grafana/plugins/ ``` -4. Copy the contents of the Netdata data source plugin to the new plugin folder created on step 2 - +4. Restart grafana container + ``` - unzip netdata-datasource-.zip - docker cp netdata-datasource grafana:/var/lib/grafana/plugins/netdata/ + docker restart grafana ``` ### Linux (local) @@ -106,17 +106,10 @@ This script will: 1. Ensure you have the desired version of the plugin you want to install, get it from github releases ``` - curl -s https://api.github.com/repos/netdata/netdata-grafana-datasource-plugin/releases/latest \ - jq -r '.assets[] | select(.name|match("zip$")) | .browser_download_url' + wget `curl -s https://api.github.com/repos/netdata/netdata-grafana-datasource-plugin/releases/latest | jq -r '.assets[] | select(.name|match("zip$")) | .browser_download_url'` ``` -2. Grafana plugins, by default, should be under /var/lib/grafana/plugins. Create a folder for netdata - - ``` - mkdir /var/lib/grafana/plugins/netdata - ``` - -3. Copy the contents of the Netdata data source plugin to the new plugin folder created on step 2 +2. Copy the contents of the Netdata data source plugin to Grafana plugins directory, by default /var/lib/grafana/plugins ``` unzip netdata-datasource-.zip @@ -147,14 +140,11 @@ This script will: systemctl restart grafana-server ``` -### Windows (local) +### Windows (local - powershell) -1. Ensure you have the desired version of the plugin you want to install, get it from github releases - - ``` - curl -s https://api.github.com/repos/netdata/netdata-grafana-datasource-plugin/releases/latest \ - jq -r '.assets[] | select(.name|match("zip$")) | .browser_download_url' - ``` +1. Ensure you have the desired version of the plugin you want to install, get it from github releases by: + * Going to https://github.com/netdata/netdata-grafana-datasource-plugin/releases/latest + * Downloading the zip file with the latest release, e.g. netdata-datasource-1.0.12.zip 2. Grafana plugins, by default, should be under C:\Program Files\GrafanaLabs\grafana\data\plugins. Create a folder for netdata @@ -165,12 +155,8 @@ This script will: 3. Copy the contents of the Netdata data source plugin to the new plugin folder created on step 2 ``` - wzunzip -d netdata-datasource-.zip - ``` - or - ``` - gzip -d < netdata-datasource-.zip - cp .\netdata-datasource\* "C:\Program Files\GrafanaLabs\grafana\data\plugins\netdata" + Expand-Archive \.netdata-datasource-.zip \. + xcopy .\netdata-datasource\ "C:\Program Files\GrafanaLabs\grafana\data\plugins\netdata-datasource\" /E ``` 4. Ensure that Netdata plugin which currently isn’t signed can be registered From 2772bc79e6d5a336961b3063b5cb07891d88c90b Mon Sep 17 00:00:00 2001 From: hugovalente-pm Date: Thu, 6 Oct 2022 14:04:33 +0100 Subject: [PATCH 2/4] remove extra /netdata on target directory to deploy plugin under Linux --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 70e6e2b..bf38ece 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ This script will: ``` unzip netdata-datasource-.zip - cp -rf netdata-datasource/ /var/lib/grafana/plugins/netdata + cp -rf netdata-datasource/ /var/lib/grafana/plugins ``` 4. Ensure that Netdata plugin which currently isn’t signed can be registered From 58eb0bc1941c81655ca07ac59814883216b1b612 Mon Sep 17 00:00:00 2001 From: hugovalente-pm Date: Thu, 6 Oct 2022 14:25:47 +0100 Subject: [PATCH 3/4] remove step to create dir on Windows and small fix on copy command for Linux --- README.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index bf38ece..49efe85 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ This script will: ``` unzip netdata-datasource-.zip - cp -rf netdata-datasource/ /var/lib/grafana/plugins + cp -rf netdata-datasource /var/lib/grafana/plugins ``` 4. Ensure that Netdata plugin which currently isn’t signed can be registered @@ -146,20 +146,14 @@ This script will: * Going to https://github.com/netdata/netdata-grafana-datasource-plugin/releases/latest * Downloading the zip file with the latest release, e.g. netdata-datasource-1.0.12.zip -2. Grafana plugins, by default, should be under C:\Program Files\GrafanaLabs\grafana\data\plugins. Create a folder for netdata - - ``` - mkdir ‘C:\Program Files\GrafanaLabs\grafana\data\plugins\netdata’ - ``` - -3. Copy the contents of the Netdata data source plugin to the new plugin folder created on step 2 +2. Copy the contents of the Netdata data source plugin to the new plugin folder created on step 2 ``` Expand-Archive \.netdata-datasource-.zip \. xcopy .\netdata-datasource\ "C:\Program Files\GrafanaLabs\grafana\data\plugins\netdata-datasource\" /E ``` -4. Ensure that Netdata plugin which currently isn’t signed can be registered +3. Ensure that Netdata plugin which currently isn’t signed can be registered ``` notepad ‘C:\Program Files\GrafanaLabs\grafana\conf\default.ini’ @@ -171,7 +165,7 @@ This script will: allow_loading_unsigned_plugins = netdata-datasource ``` -5. After adding the plugin a restart of grafana server is needed +4. After adding the plugin a restart of grafana server is needed ``` net stop Grafana From a2885b252cf603ca5f3ed7015f7ece9b656354d2 Mon Sep 17 00:00:00 2001 From: hugovalente-pm Date: Thu, 6 Oct 2022 14:27:37 +0100 Subject: [PATCH 4/4] fixed step 2. to mention the default Grafana dir --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 49efe85..4833ac2 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ This script will: * Going to https://github.com/netdata/netdata-grafana-datasource-plugin/releases/latest * Downloading the zip file with the latest release, e.g. netdata-datasource-1.0.12.zip -2. Copy the contents of the Netdata data source plugin to the new plugin folder created on step 2 +2. Copy the contents of the Netdata data source plugin to the Grafana plugins directory, by default C:\Program Files\GrafanaLabs\grafana\data\plugins ``` Expand-Archive \.netdata-datasource-.zip \.