Difference between revisions of "Multi Router Traffic Grapher"

From ArchWiki
Jump to: navigation, search
(MRTG Setup)
(MRTG Setup)
Line 31: Line 31:
 
  # cfgmaker --output=/srv/http/mrtg/mrtg2.cfg --ifdesc=ip --ifref=descr --global "WorkDir: /srv/http/mrtg" --global "Options[_]: bits,growright" public@localhost
 
  # cfgmaker --output=/srv/http/mrtg/mrtg2.cfg --ifdesc=ip --ifref=descr --global "WorkDir: /srv/http/mrtg" --global "Options[_]: bits,growright" public@localhost
 
:* the mrtg.cfg files contains all the server interfaces. we do not need the "lo" interface so we are going to delete it and edit the global configuration
 
:* the mrtg.cfg files contains all the server interfaces. we do not need the "lo" interface so we are going to delete it and edit the global configuration
 +
 +
 +
== Editing mrtg.cfg ==
 +
 +
we will edit the file and add the fallowing lines at the top:
 +
 +
### Global configuration
 +
 +
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
 +
EnableIPv6: no
 +
HtmlDir: /srv/http/mrtg
 +
ImageDir: /srv/http/mrtg
 +
LogDir: /srv/http/mrtg
 +
ThreshDir: /srv/http/mrtg
 +
RunAsDaemon: Yes
 +
Interval: 5
 +
Refresh: 600

Revision as of 20:27, 18 December 2011

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Server Setup

this document assumes that you already have a Apache and net-snmp working and configured properly

The following should all be performed as root.

  • Install the necessary programs
# pacman -S mrtg perl-net-snmp
  • create an mrtg user
# useradd -d /srv/http/mrtg mrtg
  • create the user home directory and change the owner ship to the user
# mkdir /srv/http/mrtg/
# chown mrtg:mrtg /srv/http/mrtg

MRTG Setup

there are meny ways to configure the mrtg for your local server. this document will describe the must easest way to expend the application for other server and network appliances when and if needed.

The following should all be performed as the mrtg user we created.

  • create an HTML directory to hold the png files and the index.html file
# mkdir /srv/http/mrtg/html

now we will begin dealing with the application scripts first we will create a basic mrtg.cfg file

  • the next script will scan our localhost for it's interfaces and create for us the relevent configuration for each interface
# cfgmaker --output=/srv/http/mrtg/mrtg2.cfg --ifdesc=ip --ifref=descr --global "WorkDir: /srv/http/mrtg" --global "Options[_]: bits,growright" public@localhost
  • the mrtg.cfg files contains all the server interfaces. we do not need the "lo" interface so we are going to delete it and edit the global configuration


Editing mrtg.cfg

we will edit the file and add the fallowing lines at the top:

### Global configuration

LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
EnableIPv6: no
HtmlDir: /srv/http/mrtg
ImageDir: /srv/http/mrtg
LogDir: /srv/http/mrtg
ThreshDir: /srv/http/mrtg
RunAsDaemon: Yes
Interval: 5
Refresh: 600