On Friday 25 May 2001 9:35 pm, you wrote:
> is there any documentation or how to on how to get the data off ntop into a
> mysql database?.for later use?... any pointers on that issue would be
> greately appreciated..
>
> thanks
> Florian
A late answer might not be better than no answer. However, I hunted for this
info as well and the best I came up with was as follows. If anyone would
care to tell me whether I am totally out to lunch I would be grateful.
1) create and populate database
a) echo "create database NTOP;" | mysql -h somehost -u someuser -p
somepassword
b) mysql -h somehost -u someuser -p somepassword < database/mySQLdefs.txt
2) Edit mySQLserver.pl as appropriate : in my case the mysql server is on a
remote machine (at 192.168.0.2) so :
snip.........
#
# This program needs DBI and DBD installed to works
#
# Listen to the udp port
$socket = IO::Socket::INET->new(
LocalAddr => 'localhost', #this will be used by the
-b option later
LocalPort => 4000, # this will be used by
the -b option later
Proto => 'udp',
Type => SOCK_DGRAM);
# Open the database connection
my $dbh =
DBI->connect('DBI:mysql:NTOP:192.168.0.2:3306','someuser','somepassword') or
die "Couldn't connect to database: " .
snip.................
# note, the above is one line wrapped, we have plugged in the ip address
# and port of the remote mysql server and for good measure added the user
# name and password of the user who may access the db.
3) Then kick off ntop with your favorite options plus
-b localhost:4000 these being the options from the IO::Socket statement
above.
4) Then run the nice perl program
perl database/mySQLserver.pl > /dev/null
This seems to work in my happy little network........ now to figure out what
I am going to do with all those statistics.....
--
After all is said and done, a hell of a lot more is said than done.
_______________________________________________
Ntop mailing list
[EMAIL PROTECTED]
http://listmanager.unipi.it/mailman/listinfo/ntop