How to install MRTG on UBUNTU

How to install MRTG on UBUNTU
----------------------------------------------
This post will describe how to install and configure MRTG(Multi Router Traffic Grapher)  which is a free software for monitoring and measuring the traffic load on network links. It helps the use the network traffic load over time in a graphical form.
 Software Version used in this post were as follows:
Ubuntu 18.04
SNMP v3
MRTG-2.17.4

Step 1 Install SNMP
Step 2 Configure SNMPD
Step 3 Install MRTG
Step 4 Configure MRTG
Step 5 Configure Apache Server
Step 6 Finishing the Installations
---------------------------------------------
STEP 1 : INSTALLING SNMP
sudo apt-get update
sudo apt-get install snmp
sudo apt-get install snmpd
STEP 2  : CONFIGURE SNMPD
sudo nano /etc/snmp/snmpd.conf
Change
#  Listen for connections from the local system only
agentAddress  udp:127.0.0.1:161
#  Listen for connections on all interfaces (both IPv4 *and* IPv6)
#agentAddress udp:161,udp6:[::1]:161
 to
#  Listen for connections from the local system only
#agentAddress  udp:127.0.0.1:161
#  Listen for connections on all interfaces (both IPv4 *and* IPv6)
agentAddress udp:161,udp6:[::1]:161
Change
#rocommunity public local
to
rocommunity public local
sudo service snmpd restart
STEP 3  : INSTALL MRTG
sudo apt-get install mrtg
STEP 4  : CONFIGURE MRTG
sudo cfgmaker --output=/etc/mrtg.cfg public@your_router's_IP_address
Example:
My router's ip is : 192.168.1.123
sudo cfgmaker --output=/etc/mrtg.cfg public@192.168.1.123
sudo nano /etc/mrtg.cfg
add the following line under the global section:
  • RunAsDaemon: Yes
  • Interval: 5
sudo mkdir /var/www/mrtg
sudo indexmaker --output=/var/www/mrtg/index.html /etc/mrtg.cfg

STEP 4  : CONFIGURE APACHE
sudo apt-get install apache2
sudo nano /etc/apache2/apache2.conf
Add the following lines
Alias /mrtg "/var/www/mrtg/"

<Directory "/var/www/mrtg/">
    Options None
    AllowOverride None
    Require all granted
</Directory>
 sudo service apache2 restart
STEP 5 : FINISHING THE INSTALLATION
sudo env LANG=C /usr/bin/mrtg /etc/mrtg.cfg

Comments

Popular posts from this blog

How to install Apache Tomcat in Ubuntu

How to mine cryptocurrency using unMineable