So write the code...

It's conceptually not difficult.  For simplicity, you probably want to do
this as part of shutting down ntop, otherwise you have to suspend a lot of
processing - everything except packet capture & queue - while you write out
the data.  Maybe you use the existing code like this:

    if(!myGlobals.capturePackets) break;

as a three value switch - -1, 0 and 1 (0 and 1 keep existing stop/run
values, -1 means pause), so code becomes

    if(!myGlobals.capturePackets) break;
    else while(myGlobals.capturePackets == -1) {
        sleep(10);
    }


Then you define a dump routine which:


Opens a file

Walks each of the ntop structures and output the data in some format you
could re-read.  It's a little complex because the key structures are arrays
which have pointers to other structures and dynamically allocated space
(e.g. the node name).  I suggest an xml layout, as that would give you
ready-made ability to terminate data.

Then continue with ntop's normal shutdown.

On startup, if the file is given, you read it, re-creating the structures.
And then begin processing.


Not difficult, just a lot of work...

-----Burton

-----Original Message-----
From: Chris Nicola [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 09, 2002 3:24 PM
To: Burton M. Strauss III
Subject: RE: -S option (was NTOP Configuration Questions)


No I understand that and I agree.  I am referring to the general statistics
for the thoughput graphs generated and the totals for data transferred, etc,
etc.  Those get reset when the system is reset and I would like it to just
continue where it left off.

Thanks,
Chris

-----Original Message-----
From: Burton M. Strauss III [mailto:[EMAIL PROTECTED]]
Sent: May 9, 2002 1:24 PM
To: [EMAIL PROTECTED]
Cc: Chris Nicola
Subject: -S option (was NTOP Configuration Questions)

(Yes, it is two and you're going to get two answers so that the archives are
easier to search)

#1 -S works the way it's documented and you are correct.  Some of the
information recorded about a host is stored and then retrieved when the host
is 1st seen again during the new run.

The question you have to ask is why do it differently?

Given that ntop purges inactive sessions and then inactive hosts, what value
does old data have?

It's certainly be po$$ible to write a dump/restore, just nobody has done it.


-----Burton

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Chris
Nicola
Sent: Thursday, May 09, 2002 1:42 PM
To: [EMAIL PROTECTED]
Subject: [Ntop] NTOP Configuration Questions


I have been running NTOP for a bit and I am pretty impressed with it
overall.  There were a few things I want to be able to do but the available
FAQs and MAN pages don't really give any detailed info on how it is done.
Maybe someone here can help me.

1)       I want to be able to store all of the statistics so that a reset
does not reset statistics.  I know that -S1 and -S2 options will store stats
for specific hosts but I have been told they do not store overall stats so
that information still gets reset.
2)       I want to be able to add new protocols to the list that NTOP
currently has so that it recognizes some of the odd ports I use instead of
just grouping them all in Other.  I can't find anything on that either (I
have no idea why it isn't in the man pages or documentation anywhere)

That is really it as suppose it is 2 things and not a few.  There are more
but I figure I will start small.

Thanks,
Chris Nicola

_______________________________________________
Ntop mailing list
[EMAIL PROTECTED]
http://listgateway.unipi.it/mailman/listinfo/ntop

Reply via email to