MRTG monitoring network traffic in FreeBSD
http://www.axin.net/Article/showArticle.asp?articleid=2708
[Author: A New Copy from: Site author Hits: 129 articles Entry: A New]
As a system administrator, understanding network traffic and network load conditions are required. I found a lot about FreeBSD with MRTG to draw Packet charts, but it is not comprehensive, installed unsuccessful, finally installed on a late night. It's so simple to install this under FreeBSD, write it out and share it.
First update ports, this is nothing to say, this article is too much.
1, install SNMP
CD / USR / PORTS / NET-MGMT / P5-SNMP
Make Install Clean
I will call you to fill in your email operating system.
Installation success will have a snmpd.sh in /usr/local/tc/rc.d, but I don't know why this cannot be used to delete something renamed / usr / local / sbin / snmpd save run / usr / local / etc / Rc.d / snmpd.sh snmp is started
2, install MRTG
CD / USR / PORTS / NET-MGMT / MRTG
Make Install Clean
3, configure packet-mrtg files
EE /USR /LOCAL/etc/mrtg/packet-mrtg.cfg
Write the following
Target [Packet]: ifinucastpkts.1 & imp /TUCastpkts.1: public@server5.axin.net
Workdir: / Pub / WWW / ROOT / Server-Stats
MaxBytes [Packet]: 100000000
Options [Packet]: GrowRight, Bits
Title [Packet]: IP Packet Count MRTG - Server5.Axin.net
PageTop [Packet]: IP Packet Count MRTG - Server5.Axin.net
Language: GB2312
YLELEND [Packet]: IP Packet COUNT
Colors [Packet]: Packet in # ff6600, packet out # 006600, Dark Green # 006600, ViOLET # ff00ff
Note: TARGET is the way the data is grabbed like the public @ community when the MRTG measurement is measured. Here is the key because it is necessary to use the MRTG drawing package number, first use it to the number of packages, so it is
Ifinucastpkts.n & ifoutucastpkts.n: community@host.domain
Where n means your network adapter card, if you have multiple network cards, please pay attention to not observing the wrong, or there is no data. (Usually should be 1, but if you have multiple, it may be 2, 3, 4 ...
Public is a SNMP default public string, of course, you can change its settings in SNMP.
Host.Domain is your host name, or IP
MaxBytes: Maximum package value
Title: Title syntax for html
PageTop: "Title" in the display screen
Options: Adopt standard format, and let MRTG draw from right to left
YLEGEND: Y-axis name of the chart
SHOTLEGEND: Unit of the chart Y axis
Workdir: Work Directory is also the path to display chart in the web page, which is usually accessible by your browser: language
Colors: Color
4, generate traffic graph
/ usr / local / bin / mrtg /usr/local/etc/mrtg/packet-mrtg.cfg
Because the system does not have some old graphics files required by the system for the first time, there may be an error, please execute 2-5 times.
This time, in front of the Workdir directory set in the previous packet-mrtg.cfg file, some PNG graphics files and a .html file will be generated, we can access it via the webpage:
HTTP: // Website Name /mrtg/packet.html
If you can see the Packet packet traffic map, you will explain that you have everything in front, congratulations.
EE / ETC / CRONTAB
Plus * / 5 * * * root / usr / local / bin mrtg /usr/local/etc/mrtg/packet-mrtg.cfg
Let him execute once 5 minutes
· Previous article: Using PureftPD MySQL PureftPD_php_manager in FreeBSD 5.2 to set up FTP Server
· Next article: Kernel configuration and optimization of FreeBSD 5-CURRENT
[Published comments] [Tell your friends] [Print this article] [Close window]