preloader
  • Home
  • Network Weather Plugin for Cacti

Network monitoring using the Cacti solution

blog-thumb

In this article we’ll take a look at Cacti, a monitoring solution via the SNMP protocol.

The vast majority of network equipment exports its metrics using the SNMP protocol. It is therefore common for network equipment to be monitored using this protocol. The Network Weather Plugin is widely used by telecoms professionals, as it can generate graphs, maps and reports related to companies’ network environments.

In this article we’ll learn how to install Cacti 1.2 on Ubuntu 20 LTS, as well as the Network Weather Plugin.


Introduction

Recently a friend asked me to help him investigate a problem with one of Cacti’s plugins. I’ve used this solution a lot in the past, and I confess that I was curious to see the current stage of Cacti’s development. So I decided to create this quick article to help those who need it and to satisfy my curiosity. 🙂


Virtual Hardware

  • – 2 vCPU
  • – 4GB RAM
  • – 20GB SSD


Requirements

sudo apt-get install -y apache2 rrdtool mariadb-server snmp snmpd cacti
Cacti Install

Activate the default option YES

You will then be asked to enter a password for the Cacti database. Enter a secure password and make a note of it, as you will need it later.

The configuration file for the web part was generated as an Apache include.

Apache cacti.conf


Additional Packages

sudo apt-get install -y open-vm-tools mc htop sysstat dstat

Cacti configuration

Now restart the server with the “sudo reboot” command, and try to access the VM’s IP via the browser, for example:

http://169.254.0.1/cacti/

Login screen

I recommend assigning an FQDN to this VM, so that access does not have to be via IP.

Examplecacti.mydomain.com


It is also interesting to configure 2 optional features in Apache:

[1] Enable TLS 1.2+ in Apache.

My Virtual Host SSL configuration file looks like this:

Virtual Host configuration file

[2] Set up a redirect from http://FQDN to https://FQDN

File /usr/share/cacti/site/index.html

The login is “admin”, and the password will be the same as the one you set when configuring the database.

Cacti Dashboard

Done. Cacti installed and ready to use. That was easy, wasn’t it?


Installing Network Weathermap Plugin

A very popular plugin among telecom professionals is Weathermap.

According to the manual, the installation process is quite simple. But there is one problem: As I was writing this post, the version available on the developer’s GIT was 0.98a, which is not compatible with Cacti 1.2.

However, a good Samaritan made a fork of the plugin and made the necessary adjustments.

I’ll show you how to install it below.

Before continuing, I recommend that you take a look at the file:

/usr/share/cacti/site/plugins/README.Plugins

It has recommendations on how to keep your plugin structure organized.

In my environment, I followed the steps described in it, and ran an extra command:

sudo ln -s /usr/local/share/cacti/plugins /usr/share/cacti/
sudo mkdir /usr/local/share/cacti/plugins
sudo chown www-data:users /usr/local/share/cacti/plugins
sudo chmod 775 /usr/local/share/cacti/plugins
cd /usr/local/share/cacti/plugins
sudo wget https://www.urban-software.com/wp-content/uploads/Cacti1x/weathermap_098a_cacti1.x_updated.zip
sudo unzip weathermap_098a_cacti1.x_updated.zip
sudo chown -R www-data:users /usr/local/share/cacti/plugins/weathermap
sudo chmod 777 /usr/local/share/cacti/plugins/weathermap/{output,configs}
Network Weather Map plugin files

Once the plugin files have been stored, all you have to do is go to the Cacti interface and activate it.

Go to Configuration > Plugins and click on “Go”.

Plugin not installed

The plugin will appear in the list, but it will be marked as not installed. Simply activate it using the gear icon in the “Actions” column.

For more details on how to install the plugin, see the documentation here.

The plugin will appear in the list, but it will be marked as not installed. Simply activate it using the gear icon in the “Actions” column.


Testing the Plugin

Before testing, we need a device with the SNMP service active. For this example, we’ll use the Cacti server itself.

To activate SNMP on the Cacti server, we need to follow the steps below. Note that there is a configuration file for the SNMP service.

Installing SNMP on Linux

sudo apt-get install snmpd

Configuring SNMP

sudo cat /etc/snmp/snmpd.conf
snmpd.conf

Enable SNMP

sudo systemctl enable snmpd
sudo systemctl restart snmpd

Testing SNMP

snmpwalk -v2c -c public 127.0.0.1
Command return

Once SNMP is running, simply add the device to Cacti. A monitored device generates graphs like the ones below.

Cacti Server Graphics

Creating Maps

Now just create a map and associate the hosts with it.

Testing Network Weathermap

PHP.INI

This is not necessary, but for costome reasons I made 2 adjustments to my php.ini file

short_open_tag = On
display_errors = On

MariaDB root password

For this type of Cacti installation, where all the components run on the same virtual machine, you won’t need this password, as access will be via the local socket.


Closing Notes

For a production environment, I recommend that Apache and MariaDB be adjusted to support a larger volume load, as the default configuration of these services may not be sufficient to meet more demanding requirements.

It might also be interesting to replace self-signed certificates with Let’s Encrypt.

It’s been many years since I used Cacti, and as far as I can remember, not much has changed.

Despite being an easy-to-use and easy-to-implement opensource solution, there are other free solutions that are more complete and have more features, such as Zabbix and Netbox.

Perhaps it’s time to consider migrating your Cacti to something more modern.

Maybe it’s time to consider migrating your Cacti to something more modern.



Could you help?

Please support this content by clicking on one of our advertisers’ banners. ❤️

comments powered by Disqus