Install the open-source traffic monitoring software Bandwidthd in CentOS6.3

Source: Internet
Author: User
Tags image processing library

For example, it contains the traffic of the FTP, HTTP, P2P, TCP, UDP, and ICMP protocols, and takes the IP address as the statistical object.

1. Install the basic compilation component

[Root @ localhost ~] # Yum install gcc cpp glibc-devel gcc-c ++

2. PCAP/PNG/GD Library (image processing Library)

[Root @ localhost ~] # Yum install libpcap-devel libpng-devel gd-devel

3. Install httpd

[Root @ localhost ~] # Yum install httpd mod_ssl

[Root @ localhost ~] # Service httpd start

[Root @ localhost ~] # Chkconfig httpd on

4. Download bandwidthd

[Root @ localhost ~] #

Wgethttp: // response

5. Andon bandwidthd

Decompress bandwidthd

[Root @ localhost ~] # Tar-zxvf bandwidthd-2.0.1.tgz

Compile

[Root @ localhost ~] # Cd bandwidthd-2.0.1

[Root @ localhost bandwidthd-2.0.1] #./configure

[Root @ localhost bandwidthd-2.0.1] # make; make install

[Root @ localhost ~] # Ll/usr/local/bandwidthd

Total usage 64

-Rwxr-xr-x 1 root 53320 March 19 15:15 bandwidthd // start the bandwidthd File

Drwxr-xr-x 2 root 4096 March 19 15:51 etc // configuration file

Drwxr-xr-x 2 root 4096 March 19 15:25 htdocs // web access directory, which can be referred as a virtual host

6. Modify the bandwidthd configuration file

[Root @ localhost ~] # Vim/usr/local/bandwidthd/etc/bandwidthd. conf

######################################## ############

# Bandwidthd. conf

#

# Commented out options are here to provide

# Documentation and represent ults

# Subnets to collect statistics on. Traffic that

# Matches none of these subnets will be ignored.

# Syntax is either IP Subnet Mask or CIDR

Subnet 10.1.3.0 255.255.255.255.0 # Set the monitored CIDR Block

# Subnet 192.168.0.0/24

Subnet 172.16.1.0/24

# Device to listen on

# Bandwidthd listens on the first device it detects

# By default. Run "bandwidthd-l" for a list

# Devices.

Dev "any" # (this is the network adapter ethx or any (all) You want to detect. You can change it to the corresponding network connection device)

######################################## ###########

# Options that don't usually get changed

# An interval is 2.5 minutes, this is how many

# Intervals to skip before doing a graphing run

Skip_intervals 1 #2.5 minutes refresh by default

# Graph cutoff is how many k must be transfered by

# Ip before we bother to graph it

Graph_cutoff 1024 # graphics are available for traffic above 1 m by default

# Put interface in promiscuous mode to score to traffic

# That may not be routing through the host machine.

# Promiscuous true # Set the NIC to record in hybrid mode

# Log data to cdf file htdocs/log. cdf

Output_cdf true # generate log2.cdf data record in log. cdf format in the bandwidthd directory

# Read back the cdf file on startup

Recover_cdf true # re-read cdf data when bandwidth is enabled

# Libpcap format filter string used to control what bandwidthd see's

# Please always include "ip" in the string to avoid strange problems

Filter "ip" # filter objects with ip addresses

# Draw Graphs-This default to true to graph the traffic bandwidthd is recording

# Usually set this to false if you only want cdf output or

# You are using the database output option. Bandwidthd will use very little

# Ram and cpu if this is set to false.

Graph true # graph Generation

# Set meta refresh seconds (default 150, use 0 to disable ).

Meta_refresh 150 # webpage refresh time

: Wq # Save

7. Perform the bandwidthd soft connection in the main web directory and execute

[Root @ localhost ~] # Cd/var/www/html/

[Root @ localhost html] # ln-s/usr/local/bandwidthd/htdocs bandwidthd

8. Start bandwidthd and httpd

[Root @ localhost ~] # Cd/usr/local/bandwidthd

[Root @ localname bandwidthd] #./bandwidthd

[Root @ localhost bandwidthd] # service httpd restart

9. Set the automatic start of bandwidthd

[Root @ localhost ~] # Vim/etc/rc. local

Add the following content at the end:

# Bandwidthd traffic monitoring

/Usr/local/bandwidthd

11. In a few minutes, you can browse the graph reports generated by bandwidthd.

Http: // IP/bandwidthd


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.