200.2. Predict Future Resource Needs
Weight: 2
Description: Candidates should be able to monitor resource usage to predict future resource needs.
Key Knowledge Areas:
Use monitoring and measurement tools to monitor IT infrastructure usage.
Predict capacity break point of a configuration
Observe growth rate of capacity usage
Graph the trend of capacity usage
Awareness of monitoring solutions such as Icinga2, Nagios, collectd, MRTG and Cacti
The following is a partial list of the used files, terms and utilities:
diagnose
predict growth
resource exhaustion
Predicting The future is one of the hardest works ever, can you remember "Dorithy and the witches of the OZ"? :) Many System Administrators wish if they had some thing like Glass Ball. They wish they could realize what kind of problems might happen next day, in order to avoid it today. But unfortunately that is impossible. So forget about that and lets talk about real environment. In computer science predicting future is possible just by archiving and processing what has happened in past.Mathematical science and statistics can analyze old data and graph trends to predict future.

there are some tools to help us:
Icinga2
Nagios
collectd
MRTG
Cacti
We can spend a whole course for each of these tools, but for LPI exam we are wanted to know about their existence. At beginning we spend some time on collectd to show atlead one solution and see how does it look like. And then we just Introduce other solutions.
collectd
Collectd, a Unix daemon that collects statistics related to system performance and also provides means for storing the values in different formats like RRD (Round Robin Database) files. The statistics gathered by Collectd help to detect the current performance blocks and predict system load in future.
collectd is installed by default in many distributions how ever it can be easily installed from repositories in redhat or debian systems, here we use CentOS7 system:
To configure what to monitor, modify collect.conf file:
and that is a huge configuration file consist of different sections . Which are not part of our exam!(File has been abstracted) :
In order to monitor specific item we can enable it by removing comment sign in Load Plugin and plugin configuration sections. What we have done here is enabling network module .
Lets restart the service :
Now we have to give collectd enough time to gather information about network and other modules which have been enabled.Unfortunately collectd doesn't come with an interface for viewing collected data by default, so we need some extra works to install and a web interface for that.
Configure Collectd-web to monitor a server
Collectd-web is a web front-end monitoring tool based on RRDtool (Round-Robin Database Tool), which interprets and graphical outputs the data collected by the Collectd service on Linux systems.
So first lets install and enable rrdtool module:
and modify this parts of collectd.conf file:
installing git "
and Cloning collectd-web from the its repository:
We use Collectd-web CGI scripts which interprets and generates the graphical html page statistics. First we need to make it executable for further use :
By default, collectd-web is configured to run on the loopback address 127.0.0.1. You will need to edit the runserver.py script and change 127.0.0.1 to 0.0.0.0, in order to bind on all network interface IP Adresses and access the collectd-web interface from a remote machine.
Next we need to create /etc/collectd directory and collection.conf file inside that, this specifies where collectd-web can read data from:
After modifying the Python server script, we can start the server by running runserver.py :
If we have firewall up and running , add required port for collect-web insterface.Here we are using CentOS so we should deal with firewalld:
Finally, we can access the collectd-web interface at the URL http://our-server-ip:8888 in our web browser:

How does it work? Collectd uses data sets which are defines in types.db:
to gather data in a special format(Round Robin DataBase ) in /var/lib/directory/rrd directory which we previously enabled in collectd.conf:
Okey do not forget that the installation process is not part of LPIC exam and based on your distribution and version the installation steps might be different from what we have done here.
Awareness of other monitoring tools:
There are some monitoring tools which are available both in open source (in core versions ) as well as enterprise versions or are incorporated with other products from enterprise perspective. they offer support and additional functionality.
Nagios
Nagios has been available from late 90s, early 2000. It is really a collection of production of products.
Nagios Core : freely available open source core monitoring system.
Collectd-nagios plugin : Query information form the collectd daemon and then create some beautiful graphs in nagios monitoring dashboard.
Nagios XI : Full enterprise package.
nagios Log Server
Nagios Network analyzer
Nagiod Fusion
...
web site: https://www.nagios.com
MRTG
Multi Router Traffic Grapher (MRTG) is a network admins tool that offer enterprise extentions to mrtg including Scrutinizer , FlowPro and replicator.

MRTG monitors network traffic loads, reads that traffic and create the statistics from the informations from routers and switches and creates logs for later use. It is written in perl. It works in Unix, Linux and windows

web site: https://www.mrtg.com/
Cacti
Cacti is a complete network graphing solution designed to harness the power of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with thousands of devices.

Cacti can be used in conjunction with collectd due to the fact both use rrdTools.
web site: https://www.cacti.net/
and to summarize, take a look at comparison chart below:
Cacti
Collectd
Icinga
Nagios
IP SLA Report
Yes
No
Via Plugin
Via Pugin
Logical Grouping
Yes
No
Yes
Yes
Trending
Yes
No
Yes
Yes
Trend Prediction
Yes
No
No
No
Auto Discovery
Yes
Push Model ,Multicast possible
Via Plugin
Via Plugin
Agentless
Yes
Supported
Supported
Supported
SNMP
Yes
Yes
Via Plugin
Via Plugin
Syslog
Yes
Yes
Via Plugin
Via PLugin
Plugins
Yes
Yes
Yes
Yes
Triggers / Alerts
Yes
Yes
Yes
Yes
WebApp
Full Controll
Viewing
Full Control
Yes
Distributed Monitoring
Yes
Yes
Yes
Yes
Inventory
Yes
No
Via Plugin
Via PLugin
Platform
PHP
C
C
C
Data Storage Method
RRD tool,MySQL
RRD tool
MySQL,PostgreSQL,Oracle Database
Flat File, SQL, MySQL
License
Commercial
GPL V2
GPL
GPL
Maps
Yes
No
Via Plugin
Yes
Access Control
Yes
Apache acl
Yes
Yes
Do not forget, Capacity Calculation, Predicting future needs and have a good sense of IT environment need years of experience.
.
.
.
sources:
https://www.tecmint.com/install-collectd-and-collectd-web-to-monitor-server-resources-in-linux/
Last updated