Changeset 2 for trunk

Show
Ignore:
Timestamp:
12/01/08 18:39:54 (16 years ago)
Author:
ixs
Message:

Added Direction tracking to the database in order to workaround flowprobes who omit this value

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/flowmon-dbspooler.py

    r1 r2  
    133133 
    134134                    cursor.execute("""INSERT INTO Flows (FlowSrc, TimeStart, TimeStop, IPProto, IPSrc, IPDst, IntIn, 
    135                                       IntOut, PortSrc, PortDst, MaskSrc, MaskDst, Bytes, Pakets) 
     135                                      IntOut, PortSrc, PortDst, MaskSrc, MaskDst, Direction, Bytes, Pakets) 
    136136                                      VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);""", 
    137137                                      (sourceid, unix_starttime + ( flow['FIRST_SWITCHED'] / 1000 ), 
    138138                                      unix_starttime + ( flow['LAST_SWITCHED'] / 1000), flow['PROTOCOL'], IPy.IP(flow['IPV4_SRC_ADDR']).strDec(), 
    139139                                      IPy.IP(flow['IPV4_DST_ADDR']).strDec(), flow['INPUT_SNMP'], flow['OUTPUT_SNMP'], 
    140                                       flow['L4_SRC_PORT'], flow['L4_DST_PORT'], flow['SRC_MASK'], flow['DST_MASK'], bytes, pkts)) 
     140                                      flow['L4_SRC_PORT'], flow['L4_DST_PORT'], flow['SRC_MASK'], flow['DST_MASK'], 
     141                                      flow['DIRECTION'], bytes, pkts)) 
    141142 
    142143                debug("Flow ready to insert: %s:%s -> %s:%s" % (flow['IPV4_SRC_ADDR'], flow['L4_SRC_PORT'], flow['IPV4_DST_ADDR'], flow['L4_DST_PORT'])) 
  • trunk/mysql.sql

    r1 r2  
    2929  `TimeStart` int(11) unsigned NOT NULL default '0', 
    3030  `TimeStop` int(11) unsigned NOT NULL default '0', 
     31  `Direction` smallint(11) unsigned NULL default NULL, 
    3132  `Bytes` int(11) unsigned NOT NULL default '0', 
    3233  `Pakets` int(11) unsigned NOT NULL default '0',