Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Building IoT Visualizations using Grafana

You're reading from   Building IoT Visualizations using Grafana Power up your IoT projects and monitor with Prometheus, LibreNMS, and Elasticsearch

Arrow left icon
Product type Paperback
Published in Jul 2022
Publisher Packt
ISBN-13 9781803236124
Length 360 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Rodrigo Juan Hernandez Rodrigo Juan Hernandez
Author Profile Icon Rodrigo Juan Hernandez
Rodrigo Juan Hernandez
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Part 1: Meeting Grafana
2. Chapter 1: Getting Started with Grafana FREE CHAPTER 3. Chapter 2: Exploring Grafana 4. Part 2: Collecting Data from IoT Devices
5. Chapter 3: Connecting IoT Devices 6. Chapter 4: Data Sources for Grafana 7. Chapter 5: Using Time Series Databases 8. Part 3: Connecting Data Sources and Building Dashboards
9. Chapter 6: Getting Data and Building Dashboards 10. Chapter 7: Managing Plugins 11. Chapter 8: Organizing and Managing Dashboards 12. Part 4: Performing Analytics and Notifications
13. Chapter 9: Performing Analytics in Grafana 14. Chapter 10: Alerting and Notifications in Grafana 15. Part 5: Integrating Grafana with Other Platforms
16. Chapter 11: Using Grafana with Prometheus 17. Chapter 12: Using Grafana with OpenSearch 18. Chapter 13: Showing Data from LibreNMS in Grafana 19. Chapter 14: Integrations for Grafana Cloud 20. Other Books You May Enjoy

Initial configuration of Grafana

You can configure Grafana whether editing the grafana.ini file or by specifying environment variables.

In this section, you will learn how to do it both ways.

Configuration files

Grafana comes with a default configuration file that you should not edit: defaults.ini.

To override the settings in this file, you must edit grafana.ini. This file is located – in Linux systems – in the /etc/grafana/grafana.ini directory.

You can find the locations for different operating systems at https://grafana.com/docs/grafana/latest/administration/configuration/#config-file-locations.

All configuration options are shown here: https://grafana.com/docs/grafana/latest/administration/configuration/.

We will explore some basic options to start using Grafana. In later chapters, you will learn about some other specific configuration settings.

The app_mode variable accepts two options: development and production. The default option is production and you must keep it unless you are planning to do some development:

app_mode  production

In the date_formats section, you can set date and time formats used in graphs and date-time boxes. In this section, you will find several options.

full_date is used to show a full date format where it is applicable.

Here’s an example:

full_date YYYY-MM-DD HH:mm:s

interval options are used in the graph to show partial dates or times.

The default options are as follows:

interval_second = HH:mm:ss
interval_minute = HH:mm
interval_hour = MM/DD HH:mm
interval_day = MM/DD
interval_month = YYYY-MM
interval_year = YYYY

use_browser_locale allows us to use date formats derived from the browser location. It is set to false by default.

With default_timezone, you can set your own time zone, or set it to use the browser location. The default option is the browser.

In the security section, you can set the administration user and security-related options. Some of these options, such as admin username and password, can be edited from the web interface.

In the paths section, you can see the paths that Grafana is using in your system.

In a Linux system, these paths are as follows:

data       /var/lib/grafana
logs       /var/log/grafana
plugins          /var/lib/grafana/plugins
provisioning    /etc/grafana/provisioning

Important Note

If you are using Docker to deploy Grafana, these paths cannot be modified in the configuration file. Instead, you will have to use environment variables.

You have now learned to use the configuration file to modify the behavior of Grafana. You also have seen the paths to important Grafana files.

In the next section, you will learn how to configure Grafana using environment variables.

Environment variables

In the previous section, you learned how to use environment variables with Docker. Now, you will see how to do this in the Linux host.

You can override any option in the configuration file using environment variables.

The syntax is as follows:

GF_<SectionName>_<KeyName>

So, if you want to change the admin user, you must type the following in the console:

export GF_SECURITY_ADMIN_USER=newadminuser

The same applies to every other option.

Note

You will have to restart Grafana for any configuration change to take effect.

Until here, you have learned how to install Grafana on-premises using different deployment options.

In the next section, you will learn how to use the Grafana Cloud service to avoid the installation and management process.

You have been reading a chapter from
Building IoT Visualizations using Grafana
Published in: Jul 2022
Publisher: Packt
ISBN-13: 9781803236124
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image