Visualizing Network Traffic with Netflow and FlowScan
Pages: 1, 2, 3
Saving Netflow Records from FlowScan
By default, FlowScan deletes flow files that it has processed. I suggest you retain those files for a few months, or as long as disk space allows. Create a saved subdirectory under your Netflow log directory and FlowScan will automatically move processed logs to this subdirectory.
Even if you don't want to retain records as ongoing practice, I recommend keeping them until you know FlowScan is working correctly. If your FlowScan configuration is broken, it will destroy the data you've already gathered without recording it properly. This is vastly annoying when troubleshooting.
Starting FlowScan
In theory, you have everything configured now. Cross your fingers and start FlowScan.
# /usr/local/var/db/flows/bin/flowscan
FlowScan will start spewing out all sorts of messages.
2004/09/02 11:35:17 working on file /var/log/netflows/ft-v01.2004-08-31.142629-0400...
2004/09/02 11:35:18 flowscan-1.020 CUFlow: Cflow::find took 1 wallclock secs ( 0.60 usr + 0.02 sys = 0.62 CPU) for 43011 flow file bytes, flow hit ratio: 2759/2760
2004/09/02 11:35:18 flowscan-1.020 CUFlow: report took 0 wallclock secs ( 0.15 usr 0.19 sys + 0.02 cusr 0.09 csys = 0.44 CPU)
FlowScan is parsing all the old flow files. This can take quite a while, depending on how many flows you've accumulated between implementing your collector and starting FlowScan. One interesting thing to look for here is the "flow hit ratio," or how many flows FlowScan found described in the configuration file. This particular flow file had a hit ratio of 2759 out of 2760; one flow out of 2760 didn't fit FlowScan's expectations. That's pretty good. If you have a hit ratio of 0, you probably messed up your FlowScan install or your Subnet statement.
If FlowScan complains about an "Invalid index in cflowd flow file," you probably didn't install the newest Flowscan.pm module. This is perhaps the most common error people make with FlowScan. If you have this problem, go get the appropriate version of the module as described earlier.
When FlowScan finishes parsing all your old flow files, it will print out "sleep 300...", wait for five minutes, and check your log directory for new flow files. You can Ctrl-C out of FlowScan.
You probably want FlowScan to start automatically at boot rather than taking over your terminal, so go under /usr/local/etc/rc.d and copy the sample startup script to flowscan.sh. This file works unedited, but I usually change the logfile to /var/log/flowscan.log simply because I like all my logs in one place.
Generating Graphs
"This is nice, but where are my graphs? You promised me pretty pictures!"
Fortunately, getting graphs out of the RRD files is trivial. CUFlow includes a CGI script, CUGrapher.pl. Copy this to your web server's cgi-bin directory. You only need to set two variables: $rrddir and $organization.
The $rrddir variable contains the directory where CUFlow stores the RRD files.
my $rrddir = "/var/log/cuflow";
To print your company's name at the top of the page, be sure to set the $organization variable.
my $organization = "LogicaCMG US IDT development area";
Now browse to the URL for this script and select, say, a network. You'll see an array of drop-down menus. Choose some item--say, a network, or a protocol--and hit "Generate graph."
Congratulations! You have better bandwidth graphs than MRTG alone provides.
One drawback with CUFlow is that it doesn't break down traffic by network and service. For example, if you choose "Dev network" and "http," you'll get entries for the amount of traffic to and from the dev network added to the amount of HTTP traffic the whole network sees. This isn't exactly useful. To generate more fine-grained reports than this, you'll have to write some custom Netflow reports. I'll explain that in a future article.
Return to the Sysadmin DevCenter
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 12 of 12.
-
Some errors in flowscan log
2006-11-28 05:05:18 Aladar [Reply | View]
-
Some errors in flowscan log
2007-03-20 12:28:15 virtual-Flow [Reply | View]
Hi I am getting the same thing and I am not seeing anything in my graph except the populated legend==>>>2007/03/20 14:27:08 flowscan-1.020 CUFlow: Cflow::find took 79 wallclock secs (78.18 usr 0.14 sys + 8.80 cusr 0.25 csys = 87.37 CPU) for 4653042 flow file bytes, flow hit ratio: 34084/286707
2007/03/20 14:27:08 flowscan-1.020 CUFlow: report took 0 wallclock secs ( 0.00 usr 0.01 sys + 0.43 cusr 0.13 csys = 0.57 CPU)
Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Table.pm line 1684.
2007/03/20 14:27:09 working on file /opt/netflow/ft-v05.2007-03-19.100000-0500...
Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Table.pm line 1684.
Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Table.pm line 1684
-
Graph Time Span
2006-03-06 12:01:44 freeride [Reply | View]
I got the previous setup to work although it did require following the directions exactly as laid out. I had to re-install Cflow several times but finally got it to work by upgrading all the dependencies and then installing it from the tarball that came with flow tools. Also, I'm using an OpenBSD sensor with pfflow....
Anyway, silly question-
How far back will my data go? The CUGrapher.pl time period drop down menu only goes up to one month. Can i change this or will it grow as my data grows?
thanx -
Graph Time Span
2006-03-06 14:13:03 agshekeloh [Reply | View]
There's an "hours" value in the CGI.
You can just edit this in CUGrapher.pl to provide whatever values you like. I've added 4 and 8 hours, but I imagine that nothing prevents you from going back further.
Usually, RRD data goes back for more than a month.
Try it and let us know what happens!
==ml
-
Problem with flowscan..?
2006-02-15 13:20:04 deevil [Reply | View]
I followed all the directions from both articles, except that I'm using NetFlow on my Cisco router.
I'm running RELENG_6_0.
When I start flowscan, it complains bout not being able to update the .rrd files:
ERROR updating /var/log/cuflow/protocol_tcp.rrd: Not enough arguments
ERROR updating /var/log/cuflow/gateway/protocol_tcp.rrd: Not enough arguments
ERROR updating /var/log/cuflow/protocol_icmp.rrd: Not enough arguments
ERROR updating /var/log/cuflow/gateway/protocol_icmp.rrd: Not enough arguments
ERROR updating /var/log/cuflow/protocol_udp.rrd: Not enough arguments
ERROR updating /var/log/cuflow/gateway/protocol_udp.rrd: Not enough arguments
It prints out about 60 lines of this.
It looks like the scoreboard and aggregate html pages are being generated, but I'd love to be able to use the CUGrapher.pl script.
Any help would be much appreciated!
-
problems with flowscan
2005-10-19 14:25:25 whegge [Reply | View]
I am working on a Debian machine. I downloaded the FlowScan.pm file and put it in the /usr/bin directory. This is the directory that flowscan was located in. I found the flowscan.cf file in the /etc/flowscan directory though.
When I ran flowscan the first time I received this error "use: command not found" 5 time on 5 different lines. I seemed to have fixed that by adding "#!/usr/bin/perl" to the top of the script. That removed the errors but now nothing happens when I do /usr/bin/flowscan.
I have 2 questions:
1) Is the 01-FlowScan.pm file that I downloaded from the link in the article a patch file? According to the article it does not look like it.
2) Any ideas on why this is not working?
Thanks,
Wes
-
Broken
2005-09-19 16:27:58 jasontaylor1 [Reply | View]
2005/09/20 00:25:28 working on file /var/log/netflows/ft-v05.2005-09-20.002331+0100...
/var/log/netflows/ft-v05.2005-09-20.002331+0100: Invalid index in cflowd flow file: 0xCF100103! Version 5 flow-export is required with *all* fields being saved.
2005/09/20 00:25:28 flowscan-1.020 CUFlow: Cflow::find took 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU) for 2761 flow file bytes, flow hit ratio: 0/0
2005/09/20 00:25:28 flowscan-1.020 CUFlow: report took 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
sleep 300...
Version of FlowScan.pm:
# $Id: FlowScan.pm,v 1.6 2001/03/27 20:48:01 dplonka Exp $
# Dave Plonka <plonka@doit.wisc.edu>
flowdumper doesn't work for me either.
A google search on these problems, reveals lots of other people experiencing similar problems with no solutions.
There seems to be something seriously wrong with these tools, are there any solid alternatives?
Jason -
Broken
2005-09-20 15:10:07 jasontaylor1 [Reply | View]
Never mind, it's now working.
Jason






I have installed all required stuff for network monitoring as found in the articles. The only trouble was installing Cflow.pm. Manual install from flow-tools solve that problem (although the warning Note (probably harmless): No library found for -lnsl was displayed during manual install too. Flowdumper showed some statistics in spite of the warning)
So, everything seems working fine.
But, as I promised :) there is one problem (if it is ...). My flowscan.cf contains line: Verbose 1, so that all messages goes to var/log/flowscan.log.
Here I can see following warning:
Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/site_perl/5.8.8/HTML/Table.pm line 1684. I cant recognized importance of this message. I will be delighted if someone can help.
Here are components versions:
OS: FreeBSD 6.1
flowscan_1.006_7 (FlowScan.pm 1.6 flowscan executable 1.20)
flow-tools_0.68_1
perl-5.8.8
rrdtool-1.2.12_1
P5-HTML-Table-2.04
softflowd-0.9.7
CUflow.pm 1.66
CUGrapher.pl 1.53