1. Reply to the list, not me personally unless you wish to pay for support.

2. The log is the standard system log, under RedHat, it's usually
/var/log/messages or /var/log/system.log or something like that.

3. If you are seeing insert into in the terminal window, does that mean you
aren't running as a daemon?  No problem, just a ?

4. Don't think odbc is required

5. The problem may be that it's not reporting the return codes, so you may
not be seeing errors.  A lot of the code tests the return code and prints
the line if there was an error, but not the error message.

For example, in void mySQLupdateHostNameInfo()

    if(sprintf(qbuf,"INSERT DELAYED INTO NameMapper (IPaddress, Name)"
               " VALUES ('%s', '%s')", hostName, symbolic) < 0)
      BufferTooShort();
    if(!MYSQL_QUERY(mysql_sock, qbuf)) {
      sprintf(TraceInfoLine, "In mySQLupdateHostNameInfo: %s\n", qbuf);
      traceEvent(TRACE_INFO, TraceInfoLine);
    }

Really should be:

    if(sprintf(qbuf,"INSERT DELAYED INTO NameMapper (IPaddress, Name)"
               " VALUES ('%s', '%s')", hostName, symbolic) < 0)
      BufferTooShort();
    if((rc = MYSQL_QUERY(mysql_sock, qbuf)) != 0) {
      traceEvent(TRACE_ERROR, "Error (%d-%s) %s\n", rc,
mysql_error(mysql_sock), qbuf);
    }

That's a lot of changes.  Instead, try changing this:

int MYSQL_QUERY_UL(MYSQL * sock, char * query) {
  int res;
  res = mysql_query(sock,query) ;
  return res;
};

to:

int MYSQL_QUERY_UL(MYSQL * sock, char * query) {
  int res;
  res = mysql_query(sock,query) ;
  if (res != 0) {
      traceEvent(TRACE_ERROR, "Error (%d-%s) %s", rc,
mysql_error(mysql_sock), query);
  }
  return res;
};

(It compiles, I haven't actually tested it)

To see if you are getting mySQL errors.

-----Burton

-----Original Message-----
From: Bp Sm [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 08, 2002 8:31 AM
To: [EMAIL PROTECTED]
Subject: RE: [Ntop] Database problem


Hello!

We don't have ODBC installed, is that required?

Yes we are running in default mode.

About the log-file, we didn't find any log file, can you tell which file,
and were it is.

Our environment is Red Hat 7.3.

We doesn't know for sure that ntop is sending data to the dbms, but we can
se lines like insert into... in the terminal window.

Yes we have tried using the statement in database/mySQLdefs.txt

/Grepen & Jansson


>From: "Burton M. Strauss III" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>CC: <[EMAIL PROTECTED]>
>Subject: RE: [Ntop] Database problem
>Date: Fri, 5 Jul 2002 10:01:40 -0500
>
>What is your EXACT command string when it seems to run (mask off the
>password, please)
>
>Are you running mySQL in autocommit mode (the default)?
>http://www.mysql.com/doc/C/O/COMMIT.html
>
>Any messages in the ntop log about insert problems?
>
>What's the rest of the environment?
>
>How do you know it's sending to the dbms?
>
>You may need to insert some debugging-type traceEvent() statements in
>mysql.c to show what's sent and the return code...
>
>Did you really use the create table syntax you show?  What about field
>types?  The usual statements are in database/mySQLdefs.txt
>
>-----Burton
>
>
>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Bp Sm
>Sent: Friday, July 05, 2002 9:36 AM
>To: [EMAIL PROTECTED]
>Subject: [Ntop] Database problem
>
>
>Hello!
>
>We have problem with ntop and mySQL. We have created the tables for the
>database, like the pattern ntop sends to the database.
>
>CREATE TABLE TCPsessions (Client VARCHAR(16), Server VARCHAR(16),
>CLientPort
>VARCHAR(20), ServerPort(20), DataSent(20), DataRcvd(20), FirstSeen(20),
>LastSeen(20));
>
>and then started ntop with the following command: ntop -P <db path> -u
><user> -b localhost.localdomain:3306
>
>Then ntop starts, and it looks like ntop is sending info to the database,
>with insert into command. But when we check the database after quiting ntop
>the database is empty.
>
>We have tried -v option and -b option and only -v option, then ntop says
>unknown ntop option. Any suggestion what to do?
>
>/Grepen and Jansson
>
>
>
>_________________________________________________________________
>Skicka snabbmeddelanden till dina v�nner online med MSN Messenger:
>http://messenger.msn.se
>
>_______________________________________________
>Ntop mailing list
>[EMAIL PROTECTED]
>http://lists.ntop.org/mailman/listinfo/ntop
>




_________________________________________________________________
Med MSN Foto kan du enkelt dela med dig av dina fotografier och best�lla
kopior: http://photos.msn.se


_______________________________________________
Ntop mailing list
[EMAIL PROTECTED]
http://lists.ntop.org/mailman/listinfo/ntop

Reply via email to