How To Install Mrtg In Linux
In this article "Ubuntu MRTG installation SNMP devicesmonitoring" we'll learn more most MRTG (Multi Router Traffic Grapher) and SNMP (Simple Network Management Protocol). I'll install MRTG on Ubuntu sixteen.04, but the process on both Ubuntu 12.04 and Ubuntu fourteen.04 as well as other Debian-based Linux distributions is the same. I will enable SNMP on Windows Server 2022 R2, just you lot can enable this service on any network device, that offers an SNMP service (for instance, switch, router, etc.)
📈MRTG - Multi Router Traffic Grapher
MRTG is coded past Tobi Oetiker, so it is also called Tobi Oetiker'south MRTG. MRTG monitors SNMP network devices and draws graphics, which show how much traffic passes through each network interface. Information technology helps especially when something goes incorrect in the network. With MRTG, you can monitor the network traffic at any time and detect errors easily.
SNMP - Unproblematic Network Management Protocol
SNMP Simple Network Management Protocol is a network protocol that monitors and controls network devices such as routers, switches, firewalls, printers, or NAS appliances. SNMP was gradually expanded.
The version SNMP v3 supports non merely authentication, just also encryption of the transmitted data.
SNMPv1
The master trouble of SNMP Version1 is the insufficient security during transmission. 1 of the problems is the unencrypted transmission of the password, and so it tin exist easily sniffed and used by unauthorized parties. Nosotros will be using SNMPv1 together on Windows Server 2022 R2 considering Windows Server 2022 R2 does not back up the other versions. You can analyze this vulnerability with Wireshark.
SNMPv2
There are 3 different versions, of which only SNMPv2c has been used. The other two are SNMPv2p (Party-Based SNMP) and SNMPv2u (User-Based SNMP).
SNMPv2c uses a community cord every bit "authentication". Hither, the proper noun of the customs is included in every request. The community is stored on the devices and determines what permissions a asking from this grouping has. However, inquiries with the wrong customs are still possible. Thus, this method can non exist considered very safe.
SNMPv3
SNMPv3 is a security model that establishes an authentication strategy for a user and the group in which the user resides. Security Level is the allowed security level inside a security model. A combination of a security model and a security level determines which security mechanism is used when treatment an SNMP packet. And then, both hallmark and encryption are used.
More than about SNMPv3 …
Active SNMP on Window Server 2022 R2
- Outset we install the SNMP service feature.
- Manage> Add roles and characteristic
- Until the features choice click "Next"
- Click SNMP Service and Install.
- Services> SNMP Services Right Click> Backdrop
- Security> Accepted Community Names> Add> Community Name
- SNMP packets from this host take> IP of the Ubuntu customer
Install MRTG on Ubuntu xvi.04 LTS
📥System Update - Install MRTG
First, yous should update and upgrade your arrangement so that you tin can eliminate it from possible sources of error, if any occur at all 🙂
sudo apt update -y sudo apt upgrade -y sudo apt-get install mrtg
🛠Configuration
Create a folder and motility the configuration file. Then create a configmaker that gets information from the Windows server.
sudo mkdir /etc/mrtg && sudo mv /etc/mrtg.cfg /etc/mrtg/ sudo cfgmaker --output=/etc/mrtg/mrtg.cfg [email protected]
If you can not connect to the server, make certain the Ubuntu IP is allowed on the Windows server.
To run Mrtg as a daemon, write this down the configuration file. This way, MRTG volition get information from the SNMP device every 5 minutes.
RunAsDaemon: Yes Interval: 5
🖥Install Webserver - Apache
You should set upwardly a web server in the local network to utilise MRTG. You tin can either install Ngix or Apache. I choose Apache.
To install this, utilize the post-obit commands..
sudo apt install apache2
Then create a binder in the web server and an indexmaker that forwards the information that the MRTG daemon fetches from the SNMP device to the html page.
sudo mkdir /var/www/mrtg sudo indexmaker --output=/var/world wide web/mrtg/alphabetize.html /etc/mrtg/mrtg.cfg
Open /etc/apache2/apache2.conf and paste the post-obit lines into the section that contains similar directory directives:
Alias /mrtg "/var/world wide web/mrtg/" <Directory "/var/www/mrtg/"> Options None AllowOverride None Require all granted
</Directory>
Lastly, alter the environment language to C and restart Apache.
sudo env LANG=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg
Now you can open up a browser and visit localhost/mrtg
. You should receive empty graphics, the information will be given afterwards 5 minutes, because we accept set this up.
📋Set MRTG equally a Service upward
You can fix MRTG as Ubuntu service and the side by side time all you have to do will be just to showtime the service. Following script helps you for it. Source Icflatline.com.
- Create a file
sudo impact mrtg
- Re-create the following script into the file.
sudo gedit mrtg
- Requite permission to file
chmod +x mrtg
- Movement to the runlevel directory
sudo mv mrtg /etc/init.d/
- Update Services
update-rc.d mrtg defaults
- Reload Systemctl
systemctl daemon-reload
- Start the service
service mrtg start
That was all about Ubuntu MRTG installation SNMP devices Monitoring 🙂
If y'all go another weird error, let me know!
Source: https://azizozbek.ch/blog/2018/03/ubuntu-mrtg-installation-snmp-devices-monitoring/
Posted by: longoherrinfold.blogspot.com
0 Response to "How To Install Mrtg In Linux"
Post a Comment