Calculating traffic usage

From ISPWiki
Jump to: navigation, search

Traffic collection methods

DCImanager uses the following methods to collect traffic statistics:

  • From switch ports.
  • Using NetFlow/IPFIX.

In the "Global settings module" you can select a desired method

Global settings

If the «Enable NetFlow/IPFIX» is not selected, traffic usage information will be collected from switch ports.

Collecting statistics from switch ports

When collecting traffic usage information from switch ports, DCImanager connects to switches and runs the corresponding cron job.

The information is placed into the directory

/usr/local/mgr5/var/stat/raw/

The cron job is called collectstat. It starts every 5 minutes by default.

NetFlow/IPFIX traffic

To activate traffic collection using NetFlow/IPFIX, select the NetFlow/IPFIX check box in the "Global settings" module and an IP address and port to get the information from.

NetFlow/IPFIX


After NetFlow/IPFIX is activated. DCImanager configures and activates the NetFlow collector (nfacctd).

Path to the nfacctd configuration file:

/usr/local/mgr5/etc/nfacctd.conf

Configure nfacctd by default. We do not recommend that you change the nfacctd settings, as DCImanager regularly rewrites it.

Traffic usage statistics is placed into the /usr/local/mgr5/var/flow/ directory

In the nfacctd configuration file you can select a period to save statistics. The default value is 5 minutes

Once a minute DCImanager checks the /usr/local/mgr5/var/flow/ directory for new files, processes and locates them into /usr/local/mgr5/var/stat/raw/ . Information from the flow directory is deleted.

Processing results

Regardless the collection method selected, the information is placed into the /usr/local/mgr5/var/stat/raw/ directory. DCImanager processes that information once an hour. The data are placed into the DCImanager database. The files that were processed are removed from the raw directory.

Statistical information in the control panel is updated once an hour. This period is specified in the DCImanager code and cannot be changed.

Burstable

Burstable is the channel load collected every 5 minutes. Top 5% are ignored.

Please note, if NetFlow/IPFIX is used to collect traffic usage, Burstable statistics can be innacurate, as the NetFlow collector records only long connections into the file.

Data for collecting burstable are taken from the directory:

/usr/local/mgr5/var/stat/mon/

Data from the raw directory are placed into the mon directory. I.e. after DCImanager processed the information from the raw directory, the data are placed into the mon directory to collectburstable.

Troubleshooting

If NetFlow/IPFIX is used for traffic collection, make sure that:

  • nfacctd is up and running
  • the statistics files are added into the flow director (please note that the files will be shown in that directory for a shot period of time, as DCImanager deletes data once a minute).


  • traffic from the NetFlow agent (tcpdump) is sent to the IP address and port that you selected in the Global settings module,

If traffic is collected from switch ports, go to the "Switches" section -- Ports to check that the load is changed every 5 minutes. If not, this means connection problems with that switch or the switch might be not compatible with the control panel.

Moreover, if the server is connected to incorrect port switches (Servers--Connected devices), traffic wont' be collected or incorrect results will be shown.

When the traffic statistics is placed into the raw directory, in the control panel's log you can see the following information:

NetFlow/IPFIX

ADD TX TRAFIX TO SERVER
ADD RX TRAFFIC TO SERVER

From switch ports

Add Stat For server 2 ip * NetFlowStat is OFF pilicy all_server

(NetFlow data are sent in one flow, switches send them in a separate flow).