Overview of CacTi tool: support to build computer monitoring system in local area network

Tram Ho


1. The birth of Cacti

Ian Berry started developing Cacti in June 2001, while he was working with a local network service provider in the United States. He found RRDTool very flexible in showing complex models and infrastructure network reports, but it lacked a friendly interface. So he started developing interfaces with PHP / MySQL and released the first version. (version 0.6) on November 21, 2001. Later, the application became popular in the open source community.

2. Concept

Cacti is open source software, network monitoring and graphing tool written on PHP / MySQL. Cacti uses RRDTool (Round-robin database tool) for data storage and graphic creation. Cacti collects data periodically via Net-SNMP (a software suite used to implement SNMP-Simple Network Management Protocol).

Introducing SNMP (Simple Network Management Protocol)

SNMP is a set of protocols that not only allow testing to ensure that network devices such as routers, switches or servers are operating, but also operate optimally, and SNMP also allows management of devices. remote network. For example, use SNMP to turn off an interface on the router, monitor the activity of the Ethernet Card or control the temperature on the switch. In short, all devices that can run software that allows SNMP information to be collected are manageable. Not only physical devices but also software such as web servers, databases.

  • Network management station: usually a computer running SNMP management software used for centralized monitoring and control of Network elements
  • Network element (device, host, application): is an SNMP compatible device, computer or software and is managed by Network management
  • A management station can manage multiple elements and an element can also be managed by multiple management.

Introducing RRDTool (Round-Robin Database Tool)

RRDTool is a high performance data recording and drawing system designed to process data over time series such as bandwidth, room temperature, CPU load, server load and to monitor devices such as routers, UPS, … It allows administrators to record and analyze data collected from all data sources. RRDTool’s data analysis depends on the ability to create graphs showing the values ​​collected over a period of time. RRDTool is written in C language and stores its data in .rrd file. The number of records in a single .rrd file never increases because old records will often be removed. Steps in the operation of RRDTool:

  • Data collection: Data collected at fixed intervals will be saved in a ring database
  • Data consolidation: Data management of multiple devices over a large period of time will make it difficult for administrators. RRDTool provides administrators with a number of functions: max, min, average of data and archiving of data loops.
  • Unknown data: when the data does not exist due to equipment failure or other causes RRDTool will store the rrd file with UNKNOWN data value
  • Graphing: Allows administrators to generate graphical reports based on data stored in a database

Mechanism of action

Cacti retrieves data via poller. It is scheduled in the operating system. Currently, network infrastructure contains many devices such as routers, switches, servers, UPS, computers and various network devices. To retrieve data from a remote connection service, Cacti uses SNMP. Devices that use SNMP can be monitored by CacTi. Cacti uses RRDTool to store data. RRD is a system for storing and indicating the time series of data collected from SNMP-containing devices. It consolidates previous data with functions like AVERAGE, MINIMUM, MAXIMUM. That is why it is fast, makes graphics easy. Data representation: The most important function of RRDTool is the integration of graphical functions. Cacti uses this function to customize custom graphical reports based on time collected from other SNMP-containing devices. There may be one or more information in the chart, as well as other typical features like maximum, average, minimum.


  • Data source: To handle data collection, it is necessary to provide links to the data that the user wants to add, so Cacti will collect this data and add it to the MySql database / repository. Robin Ring. Data sources can also be created, corresponding to actual data on the chart. For example, if a user wants to chart a server’s ping time, a data source can be created using a server ping script and returning the value in milliseconds. After defining the options for RRDTool as data storage, it is also possible to define any additional information that the data input source requires, such as a host to ping in case this. When the data source is created, it is automatically maintained for a period of 5 minutes. Data sources can be created, using RRDTool’s “create” and “update” functions. Each data source can be used to collect data locally or remotely and placed on a chart. Support for RRD files with multiple data sources and can use RRD files stored anywhere on the local file system. Robin ring archive installation, can be customized for users different collection ability.
  • Data collection: Contains a “data input” mechanism that allows users to define custom scripts that can be used to collect data. Each script may contain arguments that must be entered for each data source created using the script (such as IP address). Ability to access data by SNMP or scripted path. A PHP-based poller is provided to execute existing commands, retrieve SNMP data and update your RRD files.
  • Graph: When one or more data sources are identified, an RRDTool graph can be created using the data. Cacti allows you to create almost any RRDTool graph you can imagine using all standard RRDTool chart types and aggregate functions. Automatic color selection and text are also supported in creating graphs to make the process easier. Not only can you create graphs based on RRDTool in Cacti, but there are many ways to display them. Along with the “List view”, the “tree view” allows you to place graphs on the hierarchical tree depending on the purpose of use. Unlimited graphs, selectable for each historical graph Using CDEF or data source from within Cacti. Automatically group GPRINT chart items into AREA, STACK and LINE [1-3] to enable quick reorganization of chart items. Support automatic counting to ensure the line of legend text on the graph. Graph data can be controlled using the CDEF mathematical functions built into RRDTool. These CDEF functions can be defined in Cacti and can be used on each graph. Supports all types of RRDTool graph items including AREA, STACK, LINE [1-3], GPRINT, COMMENT, VRULE and HRULE.
  • User management: Due to the many functions of Cacti, a user-based management tool is built to be able to add users and give them rights to certain functions on Cacti. This will allow the manager to create some users who can change the parameters of the graph, while others can only view the graph. Each user also maintains their own settings when viewing the chart.

System installation

1. System analysis

The system consists of 2 machines: 1 server with Cacti installed is a Network Graphing Tool similar to MRTG. Collect SNMP data and various data (such as system load, network link status, hard disk space, user login etc.) into an RRD. RRD stands for Round Robin Database, is a system to store and display time, data, network bandwidth, temperature, and server load average. Another workstation using the SNMP network method. The server will collect the data of the workstation to be monitored. The parameter data of this monitoring device is represented on Graphs on Cacti.

2. Installation steps

Step 1: Install php and required modules

Step 2: Install Apache Web server

Step 3: Install MariaDB server

[ https://computingforgeeks.com/install-mariadb-10-on-ubuntu-18-04-and-centos-7/ ] Tune MariaDB database for Cacti

Create and authorize user cacti on database cacti with password 123456

Step 4: Install SNMP and Cacti

select apache2

Choose no

Step 5: Configure SNMP

Step 6: Configure Cacti Server

Step 7: Start Initial Cacti Setup

Http: localhost / cacti /

Step 8: Monitor Local Cacti Server

Look forward to the demo in my next article. Hihi Upvote, let me be motivated to write ❤️❤️❤️


Share the news now

Source : Viblo