Difference between revisions of "Instalasi MRTG"

From OnnoWiki
Jump to navigation Jump to search
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
Date: Sun, 17 Aug 2008 08:17:01 +0700
+
Sumber: https://www.howtoforge.com/tutorial/how-to-install-and-configure-mrtg-on-ubuntu-1804/
From: Lutfi <lutfi.arab@gmail.com>
 
To: tanya-jawab@linux.or.id
 
Subject: Re: [tanya-jawab] instalasi mrtg yang aneh
 
  
Ok. FC9 or yg laen sama deh langkahnya:
 
  
Urutan yg loe hrs kerjakan:
 
  
1. Ubah /etc/snmpd.conf
+
MRTG juga dikenal sebagai "Multi Router Traffic Grapher" adalah tool yang free dan open source untuk memantau beban lalu lintas pada jaringan. Kita dapat memonitor lalu lintas jaringan harian, mingguan, bulanan, dan tahunan menggunakan MRTG. MRTG mendukung sistem operasi Windows dan Linux. MRTG menyediakan antarmuka web sederhana untuk menampilkan data lalu lintas jaringan dalam bentuk grafis.
  
2. Restart service snmpd. Gue harp no.1 dah dr link web yah
+
==Kebutuhan==
  
3. Bikin /etc/mrtg/mrtg.cfg:
+
* Server Ubuntu 20.04
 +
* non-root user dengan sudo privilige
  
coba nih as root (contoh ip 10.0.0.2):
 
  
# cfgmaker public@10.0.0.2
+
==Instalasi tool pendukung==
  
kalo loe bs liat configurasi mrtg.conf shabis perintah itu, brarti dah
+
Instalasi paket
bener. simpan aja:
 
  
  # cfgmaker public@10.0.0.2 >/etc/mrtg/mrtg.conf
+
  sudo apt update
 +
sudo apt -y install apache2 snmp snmpd
  
4. bikin web interfacenya
+
Edit
  
  # cfgmaker /etc/mrtg/mrtg.cfg > /var/www/mrtg/index.html
+
  vi /etc/snmp/snmpd.conf
  
Goodluck
+
tambah
 +
 
 +
rocommunity  public localhost
 +
 
 +
Restart apache & snmp
 +
 
 +
sudo systemctl start apache2
 +
sudo systemctl enable apache2
 +
sudo systemctl start snmpd
 +
sudo systemctl enable snmpd
 +
 
 +
==Instalasi & konfigurasi MRTG==
 +
 
 +
Instalasi MRTG
 +
 
 +
sudo apt -y install mrtg
 +
 
 +
Buat directory & set permission di web
 +
 
 +
sudo mkdir -p /var/www/html/mrtg
 +
sudo chown -R www-data:www-data /var/www/html/mrtg
 +
 
 +
Buat konfigurasi MRTG
 +
 
 +
sudo cfgmaker public@localhost > /etc/mrtg.cfg
 +
 
 +
Output kira2,
 +
 
 +
You should see the following output:
 +
--base: Get Device Info on public@localhost:
 +
--base: Vendor Id: Unknown Vendor - 1.3.6.1.4.1.8072.3.2.10
 +
--base: Populating confcache
 +
--base: Get Interface Info
 +
--base: Walking ifIndex
 +
--snpd:  public@localhost: -> 1 -> ifIndex = 1
 +
--snpd:  public@localhost: -> 2 -> ifIndex = 2
 +
--base: Walking ifType
 +
--snpd:  public@localhost: -> 1 -> ifType = 24
 +
--snpd:  public@localhost: -> 2 -> ifType = 6
 +
--base: Walking ifAdminStatus
 +
--snpd:  public@localhost: -> 1 -> ifAdminStatus = 1
 +
--snpd:  public@localhost: -> 2 -> ifAdminStatus = 1
 +
--base: Walking ifOperStatus
 +
--snpd:  public@localhost: -> 1 -> ifOperStatus = 1
 +
--snpd:  public@localhost: -> 2 -> ifOperStatus = 1
 +
--base: Walking ifMtu
 +
--snpd:  public@localhost: -> 1 -> ifMtu = 65536
 +
--snpd:  public@localhost: -> 2 -> ifMtu = 1500
 +
--base: Walking ifSpeed
 +
--snpd:  public@localhost: -> 1 -> ifSpeed = 10000000
 +
--snpd:  public@localhost: -> 2 -> ifSpeed = 1000000000
 +
 
 +
Edit
 +
 
 +
vi /etc/mrtg.cfg
 +
 
 +
WorkDir: /var/www/html/mrtg
 +
 
 +
Buat index.html
 +
 
 +
sudo indexmaker /etc/mrtg.cfg > /var/www/html/mrtg/index.html
 +
 
 +
Konfigurasi Apache Web untuk MRTG
 +
 
 +
sudo vi /etc/apache2/sites-available/mrtg.conf
 +
 
 +
Tambahkan,
 +
 
 +
<VirtualHost *:80>
 +
ServerAdmin admin@yourdomain.com
 +
DocumentRoot "/var/www/html/mrtg"
 +
ServerName yourdomain.com
 +
<Directory "/var/www/html/mrtg/">
 +
Options None
 +
AllowOverride None
 +
Order allow,deny
 +
Allow from all
 +
Require all granted
 +
</Directory>
 +
TransferLog /var/log/apache2/mrtg_access.log
 +
ErrorLog /var/log/apache2/mrtg_error.log
 +
</VirtualHost>
 +
 
 +
Enable site dan restart,
 +
 
 +
sudo a2ensite mrtg
 +
sudo systemctl restart apache2
 +
 
 +
==Akses==
 +
 
 +
MRTG bisa dilihat di URL
 +
 
 +
http://yourdomain.com
 +
http://ip-address/mrtg/
 +
 
 +
==Referensi==
 +
 
 +
* https://www.howtoforge.com/tutorial/how-to-install-and-configure-mrtg-on-ubuntu-1804/
 +
 
 +
==Pranala Menarik==
 +
 
 +
* [[SNMP]]

Latest revision as of 09:21, 14 May 2020

Sumber: https://www.howtoforge.com/tutorial/how-to-install-and-configure-mrtg-on-ubuntu-1804/


MRTG juga dikenal sebagai "Multi Router Traffic Grapher" adalah tool yang free dan open source untuk memantau beban lalu lintas pada jaringan. Kita dapat memonitor lalu lintas jaringan harian, mingguan, bulanan, dan tahunan menggunakan MRTG. MRTG mendukung sistem operasi Windows dan Linux. MRTG menyediakan antarmuka web sederhana untuk menampilkan data lalu lintas jaringan dalam bentuk grafis.

Kebutuhan

  • Server Ubuntu 20.04
  • non-root user dengan sudo privilige


Instalasi tool pendukung

Instalasi paket

sudo apt update
sudo apt -y install apache2 snmp snmpd

Edit

vi /etc/snmp/snmpd.conf

tambah

rocommunity  public localhost

Restart apache & snmp

sudo systemctl start apache2
sudo systemctl enable apache2
sudo systemctl start snmpd
sudo systemctl enable snmpd

Instalasi & konfigurasi MRTG

Instalasi MRTG

sudo apt -y install mrtg

Buat directory & set permission di web

sudo mkdir -p /var/www/html/mrtg
sudo chown -R www-data:www-data /var/www/html/mrtg

Buat konfigurasi MRTG

sudo cfgmaker public@localhost > /etc/mrtg.cfg

Output kira2,

You should see the following output:
--base: Get Device Info on public@localhost:
--base: Vendor Id: Unknown Vendor - 1.3.6.1.4.1.8072.3.2.10
--base: Populating confcache
--base: Get Interface Info
--base: Walking ifIndex
--snpd:   public@localhost: -> 1 -> ifIndex = 1
--snpd:   public@localhost: -> 2 -> ifIndex = 2
--base: Walking ifType
--snpd:   public@localhost: -> 1 -> ifType = 24
--snpd:   public@localhost: -> 2 -> ifType = 6
--base: Walking ifAdminStatus
--snpd:   public@localhost: -> 1 -> ifAdminStatus = 1
--snpd:   public@localhost: -> 2 -> ifAdminStatus = 1
--base: Walking ifOperStatus
--snpd:   public@localhost: -> 1 -> ifOperStatus = 1
--snpd:   public@localhost: -> 2 -> ifOperStatus = 1
--base: Walking ifMtu
--snpd:   public@localhost: -> 1 -> ifMtu = 65536
--snpd:   public@localhost: -> 2 -> ifMtu = 1500
--base: Walking ifSpeed
--snpd:   public@localhost: -> 1 -> ifSpeed = 10000000
--snpd:   public@localhost: -> 2 -> ifSpeed = 1000000000

Edit

vi /etc/mrtg.cfg
WorkDir: /var/www/html/mrtg

Buat index.html

sudo indexmaker /etc/mrtg.cfg > /var/www/html/mrtg/index.html

Konfigurasi Apache Web untuk MRTG

sudo vi /etc/apache2/sites-available/mrtg.conf

Tambahkan,

<VirtualHost *:80>
ServerAdmin admin@yourdomain.com
DocumentRoot "/var/www/html/mrtg"
ServerName yourdomain.com
<Directory "/var/www/html/mrtg/">
Options None
AllowOverride None
Order allow,deny
Allow from all
Require all granted
</Directory>
TransferLog /var/log/apache2/mrtg_access.log
ErrorLog /var/log/apache2/mrtg_error.log
</VirtualHost>

Enable site dan restart,

sudo a2ensite mrtg
sudo systemctl restart apache2

Akses

MRTG bisa dilihat di URL

http://yourdomain.com
http://ip-address/mrtg/

Referensi

Pranala Menarik