7) Third part is installing MySQL server:
Link for download page:
https://dev.mysql.com/downloads/windows/installer/Attachment:
6.png [ 57.89 KiB | Viewed 7044 times ]
I advice to choose installation type - Only server. And don't forget about root password!
tip: after install I've got a bug: MySQL server tries to create pid file in the programdata directory:
Code:
2017-01-15T10:50:51.723567Z 0 [ERROR] mysqld: Can't create/write to file 'C:\ProgramData\MySQL\MySQL Server 5.7\Data\noname-??.pid' (Errcode: 2 - No such file or directory)
2017-01-15T10:50:51.723567Z 0 [ERROR] Can't start server: can't create PID file: No such file or directory
So it seems you will need to add some settings to file
C:\ProgramData\MySQL\MySQL Server 5.7\my.cnf
Code:
[mysqld]
tmpdir=c:/temp
pid_file=c:/temp/mysql.pid
this is only because of stupid windows. don't blame MySQL and yourself. (AND DO NOT USE NOTEPAD!!!)
8 Now we need create database for our system:
C:\>cd Program Files\MySQL\MySQL Server 5.7\bin
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql.exe -u root -p
Enter password:Code:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.7.17-log MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
CREATE DATABASE IF NOT EXISTS `flow` CHARACTER SET utf16;Code:
Query OK, 1 row affected (0.00 sec)
mysql>
USE `flow`;Code:
Database changed
mysql>
CREATE USER 'netflow'@'localhost' IDENTIFIED BY PASSWORD '*993AA45E0B64915AFBD1A5BE5713FD509A8E6C2C';Code:
Query OK, 0 rows affected (0.00 sec)
mysql>
GRANT ALL PRIVILEGES ON `flow` . * TO 'netflow'@'localhost' WITH GRANT OPTION;Code:
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Code:
Bye
9) Now we can check our collector:
Code:
C:\Program Files\MySQL\MySQL Server 5.7\bin>cd \nflows.0.0.7\collector
C:\nflows.0.0.7\collector>perl threaded.pl
Expected output:
Code:
C:\nflows.0.0.7\collector>perl threaded.pl
Smartmatch is experimental at threaded.pl line 64.
Smartmatch is experimental at threaded.pl line 64.
given is experimental at threaded.pl line 66.
when is experimental at threaded.pl line 67.
when is experimental at threaded.pl line 68.
Connect to DB via socket...
Check database structure:
Table "devices"
1. Field list
device_id,device_header,device_description,device_data,device_snmpstr - OK
2. Structure check:
device_id, int(10) unsigned, NO, PRI, , auto_increment - OK
device_header, varchar(100), YES, , , - OK
device_description, varchar(100), YES, , , - OK
device_data, varchar(100), YES, , , - OK
device_snmpstr, varchar(100), YES, , , - OK
Table "devices" - DONE
Table "interfaces"
1. Field list
id,device_id,interface_id,interface_name,interface_description,interface_moni
toring - OK
2. Structure check:
id, bigint(20) unsigned, NO, PRI, , auto_increment - OK
device_id, int(10) unsigned, NO, , , - OK
interface_id, int(10) unsigned, NO, , , - OK
interface_name, varchar(256), YES, , , - OK
interface_description, varchar(256), YES, , , - OK
interface_monitoring, tinyint(1), NO, , 0, - OK
Table "interfaces" - DONE
Table "ip4temp"
1. Field list
id,device_id,dtime,srcaddr,dstaddr,nexthop,input,output,dpkts,doctets,srcport
,dstport,tcp_flags,prot,tos,src_as,dst_as,src_mask,dst_mask - OK
2. Structure check:
id, bigint(20) unsigned, NO, PRI, , auto_increment - OK
device_id, int(10) unsigned, NO, , , - OK
dtime, int(10) unsigned, YES, , , - OK
srcaddr, int(10) unsigned, YES, , , - OK
dstaddr, int(10) unsigned, YES, , , - OK
nexthop, int(10) unsigned, YES, , , - OK
input, smallint(5) unsigned, YES, , , - OK
output, smallint(5) unsigned, YES, , , - OK
dpkts, int(10) unsigned, YES, , , - OK
doctets, int(10) unsigned, YES, , , - OK
srcport, smallint(5) unsigned, YES, , , - OK
dstport, smallint(5) unsigned, YES, , , - OK
tcp_flags, tinyint(3) unsigned, YES, , , - OK
prot, tinyint(3) unsigned, YES, , , - OK
tos, tinyint(3) unsigned, YES, , , - OK
src_as, smallint(5) unsigned, YES, , , - OK
dst_as, smallint(5) unsigned, YES, , , - OK
src_mask, smallint(5) unsigned, YES, , , - OK
dst_mask, smallint(5) unsigned, YES, , , - OK
Table "ip4temp" - DONE
Table "ip4temp1"
1. Field list
id,device_id,dtime,srcaddr,dstaddr,nexthop,input,output,dpkts,doctets,srcport
,dstport,tcp_flags,prot,tos,src_as,dst_as,src_mask,dst_mask - OK
2. Structure check:
id, bigint(20) unsigned, NO, PRI, , auto_increment - OK
device_id, int(10) unsigned, NO, , , - OK
dtime, int(10) unsigned, YES, , , - OK
srcaddr, int(10) unsigned, YES, , , - OK
dstaddr, int(10) unsigned, YES, , , - OK
nexthop, int(10) unsigned, YES, , , - OK
input, smallint(5) unsigned, YES, , , - OK
output, smallint(5) unsigned, YES, , , - OK
dpkts, int(10) unsigned, YES, , , - OK
doctets, int(10) unsigned, YES, , , - OK
srcport, smallint(5) unsigned, YES, , , - OK
dstport, smallint(5) unsigned, YES, , , - OK
tcp_flags, tinyint(3) unsigned, YES, , , - OK
prot, tinyint(3) unsigned, YES, , , - OK
tos, tinyint(3) unsigned, YES, , , - OK
src_as, smallint(5) unsigned, YES, , , - OK
dst_as, smallint(5) unsigned, YES, , , - OK
src_mask, smallint(5) unsigned, YES, , , - OK
dst_mask, smallint(5) unsigned, YES, , , - OK
Table "ip4temp1" - DONE
10) Start perl service as daemon:
create service by using sc command:
Code:
sc create netflow binPath= "C:\Strawberry\perl\bin\perl.exe c:\nflows.0.0.7\collector\threaded.pl"
now you have netflow service.
That's it folks!

P.S.: I hate windows. Really... This system are not about server software. This is a system for user applications like a Internet browser, PC games and multimedia players...