# Grafana Excel Report Download — Part1

If you don’t have time to read but want to know what’s there in this post. Find the quick read 👇

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056134371/29b7ae74-fb1c-4352-95fa-d7d70274dc22.gif align="left")

In Grafana OSS(Open Source) we can’t download the reports in PDF or Excel format. but there are few plugins available for PDF which would take a snapshot of the panels.

But to download the report as excel we don’t have any option all we have is to download panel data as CSV.

Today, we are going to see how to download the data collected by InfluxDB as an excel report in Grafana using NodeJS.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056136151/de952c2d-97c0-489b-831a-9f00be0787b5.gif align="left")

Overall Flow

### What we are going to do

In this series, we will see how to download the system metrics data which is stored in InfluxDB from Grafana using the NodeJS application.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056138097/e5f45b75-7af2-44bd-9ebf-26227fe0a0fc.gif align="left")

Milestones

1. Create a telegraf configuration to collect system metrics
    
2. Run the telegraf agent to send system metrics
    
3. Create a Dashboard in Grafana for system metrics using InfluxDB as a data source
    
4. Create a NodeJS application to collect system metrics from InfluxDB using client libraries
    
5. Create the Excel report using the collected metrics
    
6. Configure Grafana to download the report
    

### What we are going to do in Part 1

In this part, we will see how to

1. Create a telegraf configuration to collect the system metrics
    
2. Run the telegraf agent to send system metrics
    
3. Create a Dashboard in Grafana for system metrics using InfluxDB as a data source
    

### 1\. Create a telegraf configuration to collect system metrics

Before starting make sure you have telegraf installed in your system as well as InfluxDB running.If not kindly look at the above articles 👆.

Open **InfluxDB** and then click **Data ➡️ Telegraf** you could see a page like below

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056141882/31289d07-96da-479f-b0ca-78ebe16e9cba.png align="left")

Create Configuration

Click **Create Configuration** and then select the bucket from the dropdown menu to which the metrics need to store.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056143737/4738296d-6336-4d08-b23c-ffbdfd81014b.png align="left")

Selecting the metric

Once the metric is selected click **Continue** and then you could receive a **token** like below (Copy it will use it later)

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056145801/e8fde977-deff-4f69-8efa-3e34db005557.png align="left")

InfluxDB Token

Once the Token is copied click **Finish** and then download the configuration

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056147590/f2cbd80c-2aeb-40ef-a01d-f99f4016e7ab.png align="left")

Configuration File

Congrats on completing 1️⃣st milestone 👏 in this part

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056149125/e22713c2-8202-40f6-97a6-300918e5d9e8.gif align="left")

Milestone 1

Just take a quick break to know about **Telegraf** 👇

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056150651/c32f6a39-7297-41c3-87c3-1a0b2a49b0f1.gif align="left")

Quick Read #1

### 2\. Run the telegraf agent to send system metrics

Once the configuration file is downloaded paste the InfluxDB token which you have copied earlier into **telegraf.conf** or you can export it is as an InfluxToken also. Once the token is added start the telegraf service and then use the following command to run telegraf like below

`telegraf --config path-of-your-telegraf.conf`

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056152732/e5da218a-0389-4a75-ba6a-7570550742bb.png align="left")

Telegraf command

Once you run the telegraf agent you could see an output like below

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056154914/89d81e35-c30c-4a64-946e-2f2837a60e90.gif align="left")

Congrats on completing the 2️⃣nd milestone 👏

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056156375/45c60b9d-6cba-4f49-9c43-f3a22fb58653.gif align="left")

Milestone 2

Just take a quick break to know about **Grafana** 👇

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056157861/20786703-bc2a-4161-8c2d-2cf02a12902a.gif align="left")

Quick Read #2

### 3\. Create a Dashboard in Grafana for system metrics using InfluxDB as a data source

[![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056159740/1aac2cf0-8410-4c65-8b33-778bb7925e8c.gif align="left")](https://grafana.com/grafana/download?platform=linux&edition=oss)

👆Click the button for download instructions

Once you have installed Grafana and started the Grafana instance in your machine. Open your browser and type **localhost:3000** you could see the login page of Grafana like below

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056161669/f4d04aa8-579b-4959-a267-fdf60c4303c9.png align="left")

Grafana Login Page

If you log in for the **first time** then the **username** and **password** is **admin** and admin.If not log in with the credentials you have set earlier.

Now click on **Settings** ➡️ **Datasource** like below

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056163860/72065777-61cc-41a0-8028-055148de5ec2.png align="left")

Data source

Now Click **Datasource** ➡️ **Add data source** and type InfluxDB like below

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056165938/ee293e4c-1f3c-40ef-9cbc-961bd8cc5315.png align="left")

InfluxDB Datasource

Now click **InfluxDB** and fill in the details like below 👇

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056168555/e2fce9c5-2c52-4826-b139-884b1748b910.png align="left")

InfluxDB Configuration

Now click Save & Test where you could see a result like below

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056170530/e020538a-8dba-4fd2-936f-69f1a67e213e.png align="left")

Datasource connected

Now you have successfully connected with InfluxDB.Now we will create the dashboard for system metrics

Click on the ‘+’ icon to import a new dashboard.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056171957/429188d4-b3ed-4789-88b0-11111abe9790.png align="left")

Import Dashboard

Now copy the JSON 👇

[![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056173340/e8b21e3f-8613-4184-9f71-603228e30c1f.gif align="left")](https://gist.github.com/nidhinkumar06/df4129a8ab132aa7b3a51af187e31772)

Click the Copy Dashboard button 👆

Once you have copied the JSON paste the code into Grafana and click **Load**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056175249/f72b7769-611d-4b6e-9fa7-e68fda6d2ecd.png align="left")

Load Dashboard

Once you click the Load button select the folder in which you want to save the dashboard like below

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056177588/969d0704-f440-4dc9-b3c7-0ef6a0dd82b6.png align="left")

Importing Dashboard

Once you import the dashboard you could see some errors in the dashboard 😨. Don’t get freaked out just click the Dashboard settings

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056179116/333cc298-335b-46fd-afd3-b9d9e3f47fe2.png align="left")

Dsahboard settings

and then select Variables and click the hostname

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056180948/e7ced2b5-3955-4c87-ac5f-2d0e91b3429c.png align="left")

Change the hostname to the one which you have seen in your InfluxDB and then click update

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056182587/4959fea2-c41c-4f81-a87f-63dcbdd16323.png align="left")

changing host name

> Make sure the default dashbaord is InfluxDB

Once it is done you could see the dashboard like 👇

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056184509/2a7a92fd-13c9-4c6c-afe3-cd0edaed57f7.gif align="left")

Congrats on completing the 3️⃣rd milestone 👏

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1698056186264/c3d73d97-c7f6-4b6d-bcce-56951c5ca5c5.gif align="left")

Milestone 3

### Congratulations 🏆

You have completed Part 1️⃣ milestones. Get ready for the Part 2 milestone. Till then **Happy Learning** 😄
