Reader small image

You're reading from  Building IoT Visualizations using Grafana

Product typeBook
Published inJul 2022
PublisherPackt
ISBN-139781803236124
Edition1st Edition
Right arrow
Author (1)
Rodrigo Juan Hernández
Rodrigo Juan Hernández
author image
Rodrigo Juan Hernández

Rodrigo Juan Hernández is an electronic engineer passionate about IoT even before it existed. He has been working on tech for more than 18 years until now. For several years he has been focusing on the IoT ecosystem. He is currently giving consultation about IoT systems to clients around the world. He also produces content online about IoT and related subjects and the content is available on his blog, Youtube channel, and social networks - mainly LinkedIn. He also writes for companies that need good quality content about their products and services. His main objective nowadays is helping others to understand and implement IoT solutions.
Read more about Rodrigo Juan Hernández

Right arrow

Chapter 13: Showing Data from LibreNMS in Grafana

LibreNMS is an open source platform for network monitoring, a Network Management System (NMS). It provides metrics that can be accessed through an InfluxDB database from Grafana.

In this chapter, you will learn how to use the data from LibreNMS and show it with Grafana.

This chapter covers the following topics:

  • What LibreNMS is and how you can use it
  • Configuring LibreNMS to use InfluxDB
  • Showing LibreNMS data in Grafana dashboards
  • Showing network topology diagrams with quasi-live data

Using LibreNMS data, you can build customized and enhanced Grafana dashboards, which LibreNMS itself doesn’t have. In this chapter, you will learn how to extract more value from LibreNMS data using Grafana.

Technical requirements

To take advantage of this chapter, you should have the following:

  • A running instance of LibreNMS – we will not cover the installation of LibreNMS in this book.
  • Some devices that can be parsed using Simple Network Management Protocol (SNMP).
  • An InfluxDB instance running.
  • A running Grafana instance.

Now, let´s see what LibreNMS is and what it is used for.

What LibreNMS is and how you can use it

As discussed earlier, LibreNMS is an NMS. The purpose of these systems is to manage network devices, servers, appliances, and any device that can be parsed using SNMP.

You can find the website of the project at the following link:

https://www.librenms.org/

The main features of LibreNMS are the following:

  • Automatic discovery of devices: LibreNMS uses SNMP, CDP, LLDP, OSPF, BGP, FDP, and ARP to find devices in a network.
  • API access: You can interact with LibreNMS using its API to manage, graph, and get data.
  • Alerting: LibreNMS has a very customizable alerting system. You can build your alerts or use the templates provided by default.
  • Automatic updates: LibreNMS has a script to check on updates and run upgrades at midnight.
  • Distributed polling: You can build a large system with distributed small nodes that send data to a central server.
  • Billing system: You can generate bills based on the utilization of specific...

Configuring LibreNMS to use InfluxDB

By default, LibreNMS stores its metrics in RRD files. However, you can send the data to other databases, such as Graphite, InfluxDB, OpenTSDB, or Prometheus.

In this chapter, we are going to use InfluxDB. This integration allows you to save the metrics in a time-series database that can be accessed by other systems, such as Grafana.

Important Note

LibreNMS and InfluxDB are completely separate and independent projects. The LibreNMS website says that it doesn't guarantee that InfluxDB integration will always work. However, at the time of writing this book, all is going well.

Let´s see how to configure LibreNMS to send metrics to InfluxDB.

Before configuring LibreNMS, you have to create a database in the InfluxDB instance. Also, it’s good practice to create a username and a password for accessing the database. For security reasons, avoid using the admin user.

The main configuration file of LibreNMS – conFigurephp...

Showing LibreNMS data on Grafana dashboards

Now that you have an InfluxDB database with the metrics from LibreNMS, you can access the data from Grafana by adding the InfluxDB database as a data source. You have learned how to do this in Chapter 4, Data Sources for Grafana. All you need to do is to enter the access parameters on the data source configuration page, as you can see in Figure 13.3 and Figure 13.4.

Figure 13.3 – Configuring the InfluxDB data source

After you have added the data source to Grafana, you can perform queries as with any other InfluxDB data source.

Figure 13.4 – Configuring InfluxDB database access

Let’s look at some important measurements and tags in the LibreNMS InfluxDB database.

Depending on the type of device monitored by LibreNMS, you will have different measurements available, as you can see in Figure 13.5.

Figure 13.5 – Selecting measurements on the LibreNMS...

Showing network topology diagrams with quasi-live data

Network topology diagrams are very useful when you need to monitor your communication infrastructure. All IoT systems depend on IP networks, so having a clear picture of physical connections is crucial to addressing communication problems.

The interruption of data transmission from an IoT device can be related to problems in the network, for example, the loss of power in a network device, or the unplugging of a cable on an interface.

To build topology diagrams, we will use two software tools:

  • The software draw.io for drawing the diagrams
  • The Grafana FlowCharting plugin for showing dynamic diagrams

Let’s start with the draw.io software.

Building diagrams with draw.io

draw.io is a diagram software that you can use for free either online or locally. draw.io allows you to draw different types of diagrams, from basic forms to network topologies and mind maps.

This software offers a very broad...

Summary

In this chapter, you have learned how to integrate the open source project of LibreNMS with Grafana.

You have explored the basics of the main protocol used by LibreNMS – SNMP – and you have learned how to send the metrics to an InfluxDB database.

You have also learned how to get LibreNMS metrics from an InfluxDB data source.

Finally, you were introduced to the FlowCharting plugin and learned to build topology diagrams for showing quasi-live data.

The integration of LibreNMS and Grafana offers great flexibility and can be used for monitoring a very broad range of devices and systems.

In the next chapter, you will learn how to integrate Grafana Cloud with many systems.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Building IoT Visualizations using Grafana
Published in: Jul 2022Publisher: PacktISBN-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.
undefined
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 $15.99/month. Cancel anytime

Author (1)

author image
Rodrigo Juan Hernández

Rodrigo Juan Hernández is an electronic engineer passionate about IoT even before it existed. He has been working on tech for more than 18 years until now. For several years he has been focusing on the IoT ecosystem. He is currently giving consultation about IoT systems to clients around the world. He also produces content online about IoT and related subjects and the content is available on his blog, Youtube channel, and social networks - mainly LinkedIn. He also writes for companies that need good quality content about their products and services. His main objective nowadays is helping others to understand and implement IoT solutions.
Read more about Rodrigo Juan Hernández