In FreeBSD use, sometimes you may need to know your host or network card packet (Packet) of the flow, to understand network traffic and network card load, to the system management personnel for reference. Here, I write my own server configuration in this way and experience, to share with you friends.
I. Installation of MRTG drawing software
Cd/usr/ports/net/mrtg
Make install can be installed successfully!
Second, configure PACKET-MRTG
I plan to put the configuration file in the/usr/local/etc directory.
Vi/usr/local/etc/packet-mrtg.cfg the contents of this document are as follows:
Target[packet]:ifinucastpkts.1&ifoutucastpkts.1:public@www.onlinecq.com
Workdir:/home/onlinecq.com/mrtg/
Maxbytes[packet]: 100000000
Options[packet]:growright,bits
Title[packet]: IP packet Count MRTG
Pagetop[packet]: IP packet Count mrtg–onlinecq.com
#Language: gb2312
Ylegend[packet]: IP packet Count
Colours[packet]: Packet in#ff6600,packet Out#006600,dark green#006600,violet#ff00ff
This,pure-ftpd will automatically include MySQL in the installation, eliminating the hassle of our integration.
Two ﹑ configuration pureftpd
When the system is installed, the relevant profile sample is automatically installed. Sample installation to/usr/local/etc
Directory, so we are also more convenient to find these configuration files.
Cd/usr/local/etc
CP Pureftpd-mysql.conf.sample pureftpd-mysql.conf
CP pure-ftpd.conf.sample Pure-ftpd.conf explains: Target is the way in which data is crawled as if it were public@community in MRTG traffic, and this is the key, because when you want to use MRTG to draw the number of packets , you need to use it to count the number of packets, so use the
Ifinucastpkts.n&ifoutucastpkts.n:community@host.domain where n means your network adapter card, if you have more than one network card, please be careful not to observe the wrong oh, otherwise there is no data out. (usually 1, but if you have more than one, it may be 2,3,4 ...) !)
Public is the SNMP default common string, and of course you can change its settings in SNMP.
Host.domain is your host name, you can also use IP, where mine is www.onlinecq.com.
Personal thought: You can try it, use it to monitor the other host's packet what will be the case? ^_^
MaxBytes: Maximum package value for drawing
Title syntax for title:html Web pages
PageTop: "title" in the display screen
Options: Use a standard format and let MRTG draw from right to left
Ylegend: The y-axis name of the chart