Agenda: exercise0-build-nfdump-package.txt

File exercise0-build-nfdump-package.txt, 3.4 KB (added by carmas, 6 years ago)

Exercise0-NfSen?

Line 
1% Monitoring Netflow with NFsen
2%
3% Network Monitoring and Management
4
5# Introduction
6
7## Goals
8
9* Build the nfdump package from source
10
11## Notes
12
13* Commands preceded with "$" imply that you should execute the command as
14  a general user - not as root.
15* Commands preceded with "#" imply that you should be working as root.
16* Commands with more specific command lines (e.g. "RTR-GW>" or "mysql>")
17  imply that you are executing commands on remote equipment, or within
18  another program.
19
20We will use the latest definition from Ubuntu's launchpad site:
21
22- Add this line to the file /etc/apt/sources.list:
23
24~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25deb-src http://apt.ws.nsrc.org:3142/archive.ubuntu.com/ubuntu precise main restricted universe multiverse
26~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27
28Then:
29
30$ sudo apt-get update
31
32To build the packages, we'll need the following files:
33
34~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35https://launchpad.net/ubuntu/+archive/primary/+files/nfdump_1.6.6-1.debian.tar.gz
36https://launchpad.net/ubuntu/+archive/primary/+files/nfdump_1.6.6.orig.tar.gz
37https://launchpad.net/ubuntu/+archive/primary/+files/nfdump_1.6.6-1.dsc
38~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39
40They have already been downloaded for you to:
41
42~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43http://noc.ws.nsrc.org/downloads/nfdump_1.6.6-1.debian.tar.gz
44http://noc.ws.nsrc.org/downloads/nfdump_1.6.6.orig.tar.gz
45http://noc.ws.nsrc.org/downloads/nfdump_1.6.6-1.dsc
46~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
47
48So let's get them from the NOC:
49
50~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51cd /tmp/
52wget http://noc.ws.nsrc.org/downloads/nfdump_1.6.6-1.debian.tar.gz
53wget http://noc.ws.nsrc.org/downloads/nfdump_1.6.6.orig.tar.gz
54wget http://noc.ws.nsrc.org/downloads/nfdump_1.6.6-1.dsc
55~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56
57Extract the source:
58
59~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60sudo dpkg-source -x --no-check nfdump_1.6.6-1.dsc
61~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62
63Install prerequisites:
64
65~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66sudo apt-get build-dep nfdump
67~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68
69One more package is required for building:
70
71~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
72sudo apt-get install flow-tools-dev
73~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
74
75Build the tool:
76
77~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78cd nfdump-1.6.6
79sudo dpkg-buildpackage -rfakeroot -b
80~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81
82The package is now built in the "proper" way, let's install it:
83
84~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85cd ..
86ls -l nfdump*.deb
87~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88
89Installation:
90 
91~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92sudo dpkg --install nfdump_1.6.6-1_i386.deb
93sudo dpkg --install nfdump-flow-tools_1.6.6-1_i386.deb
94~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95