Changeset 34

Show
Ignore:
Timestamp:
04/25/07 17:05:21 (16 years ago)
Author:
andreu
Message:

bug on bad reading of routers configuration file fixed
bug on wrong sampled value fixed
in tool, we add a supervisor script shell

Location:
trunk
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • trunk/README

    r8 r34  
    33 ---------------------- 
    44 
    5         tar xvzf renetcol-0.0.2.tar.gz 
    6         cd renetcol-0.0.2 
     5        tar xvzf renetcol-0.0.9.tar.gz 
     6        cd renetcol-0.0.9 
    77        ./configure 
     8        (./configure --help) 
    89        (before the make command you MUST change some values in renetcol.h, see below) 
    910        make 
     
    2526 
    2627        - create your IPv4 prefix file (or keep the default for test:  
    27 IPv4_prefix.txt, in this release the file must be present with a good syntax, 
    28 but data are not important) 
     28IPv4_prefix.txt, in "quick start" with "--enable-ipv4agg=no" you don't  
     29need a such file 
    2930        - create your router list file *REQUIRED* (exemple in src/routers.txt): 
    3031syntax: <id> <name> <first IPv4 address> <second IPv4 or NULL> 
    3132keep this first line: 0 null 0.0.0.0 null 
    3233 
    33 Note: no comment line in this two files. 
     34Note: no comment lines in this two files. 
    3435 
    3536 
     
    5455colnet:/tmp/renetcol_user/src# ./renetcolMsgCtl renetcol 
    5556 
     57We recommand to use in a crontab the script check.sh who is in tool/ directory. 
     58 
    5659 ---------------------------------- 
    5760| Use the client tool (python+GTK) | 
     
    6063    on Linux: 
    6164       cd tool 
    62        python renetcolGUI_0_0_2.py 
     65       python renetcolGUI_0_0_7.py 
    6366    on Win32: 
    64        copy the file renetcolGUI_0_0_2.py on your system 
     67       copy the file renetcolGUI_0_0_7.py on your system 
    6568       install python, GTK and requirements: 
    6669               for python: 
    6770                   http://www.python.org/ download section 
    68                    the last release is the 2.4.1 (python-2.4.1.msi) 
    6971               for pyGTK: 
    7072                   http://www.pcpm.ucl.ac.be/~gustin/win32_ports/ 
    7173                   section pygtk on win32 
    72                    last release is pygtk 2.6 (pygtk-2.6.2-2.win32-py2.4.exe) 
    7374               for GTK+: 
    7475                   http://gladewin32.sourceforge.net/ 
    75                    last release 2.6.8 (Runtime Environment Installer 2.6.8-rc1) 
    7676 
    7777    Collector (renetcolSender) and remote client communication *REQUIRED*: 
    78         you MUST change few values in the renetcolGUI_0_0_2.py file: 
     78        you MUST change few values in the renetcolGUI_0_0_7.py file: 
    7979                - line 28 : path to GTK 
    8080                - line 47 to 53 : IP protocol choice and collector address 
    8181 
    82     *REQUIRED* In this release (0.0.2) the client tool host MUST be have a 
     82    *REQUIRED* In this release (0.0.9) the client tool host MUST be have a 
    8383 reverse DNS for his name. If not the collector will not be able to  
    8484communicate with the client. Explication: the rules are registered on the  
     
    9292    Note: For your first action from the client to the collector it's  
    9393possible to have a delay (>20s, it depends on the delay between two template 
    94 definition). This delay desappears after.  
     94definition).  
  • trunk/configure.in

    r32 r34  
    33 
    44AC_PREREQ(2.59) 
    5 AC_INIT(RENETCOL, 0.0.8, andreu@renater.fr) 
     5AC_INIT(RENETCOL, 0.0.9, andreu@renater.fr) 
    66AC_CONFIG_SRCDIR(src/) 
    77AC_PROG_MAKE_SET 
  • trunk/src/dataFlowSet.c

    r32 r34  
    109109#ifdef DEBUG 
    110110    fprintf(stderr,"{d id: %hu, lg %hu", (*myPtrs->currentFlowsetIdPtr), data_length); 
    111     if ( (*myPtrs->currentFlowsetIdPtr) > 270 ) { 
     111    if ( (*myPtrs->currentFlowsetIdPtr) > TRESHOLD_TEMPLATE_ID ) { 
    112112/*      fprintf(stderr,"Bad TID from router: %lu.%lu.%lu.%lu\n", */ 
    113113/*              (*myPtrs->currentFlowsetIdPtr), */ 
     
    893893          buffer4[0]= *(myPtrs->ptr_buffer+(*myPtrs->offsetV9Ptr)); (*myPtrs->offsetV9Ptr)++; 
    894894          if (pftmp->fieldType==34){ 
    895             if (myPtrs->currentRouterPtr->sampled != *((unsigned long*)&buffer4) ) { 
     895            if ((*((unsigned long*)&buffer4)==1)  
     896                || (*((unsigned long*)&buffer4)==10)  
     897                || (*((unsigned long*)&buffer4)==1000)) { 
     898              if (myPtrs->currentRouterPtr->sampled != *((unsigned long*)&buffer4) ) { 
    896899#ifdef DEBUGAGG 
    897               fprintf(stderr,"SV (p) %lu != %lu (r)\n", *((unsigned long*)&buffer4), 
    898                       myPtrs->currentRouterPtr->sampled); 
     900                fprintf(stderr,"\n SV (p) %lu != %lu (r)", *((unsigned long*)&buffer4), 
     901                        myPtrs->currentRouterPtr->sampled); 
    899902#endif                      
    900               myPtrs->currentRouterPtr->sampled = *((unsigned long*)&buffer4); 
    901               for (i=0; i<nbPV4; i++) { 
    902                 /* we update the PrefixV4 structure with the sampled information */ 
    903                 if ( myPtrs->currentRouterPtr->IpAddress == myPtrs->routersID[V4PTab[i].routerNb]) { 
    904                   V4PTab[i].sampling = *((unsigned long*)&buffer4); 
    905                   myPtrs->secondV4Tab[i].sampling = *((unsigned long*)&buffer4);  
     903                myPtrs->currentRouterPtr->sampled = *((unsigned long*)&buffer4); 
     904                for (i=0; i<nbPV4; i++) { 
     905                  /* we update the PrefixV4 structure with the sampled information */ 
     906                  if ( myPtrs->currentRouterPtr->IpAddress == myPtrs->routersID[V4PTab[i].routerNb]) { 
     907                    V4PTab[i].sampling = *((unsigned long*)&buffer4); 
     908                    myPtrs->secondV4Tab[i].sampling = *((unsigned long*)&buffer4); 
     909                  } 
    906910                } 
    907911              } 
  • trunk/src/dataFlowSet.h

    r31 r34  
    3333#include "get_conf.h" 
    3434#include "prefix_mgmt.h" 
     35 
     36#define TRESHOLD_TEMPLATE_ID 300 
    3537 
    3638struct IPFLowCache { 
  • trunk/src/get_conf.c

    r29 r34  
    5858  int nbR = 0; 
    5959  char tindex[5]; 
    60   char tname[20]; 
    61   char tad[15]; 
    62   char tad2[15]; 
     60  char tname[40]; 
     61  char tad[16]; 
     62  char tad2[16]; 
    6363  int ind=0; 
    6464  unsigned short n0, n1, n2, n3; 
  • trunk/src/template.c

    r30 r34  
    149149             || badFieldLength == 1  
    150150             || (badFieldCount == 1)) { 
    151           fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu, %d,%d\n", 
    152                   cr->IpAddress>>24, 
    153                   cr->IpAddress<<8>>24, 
    154                   cr->IpAddress<<16>>24, 
    155                   cr->IpAddress<<24>>24, 
    156                   badFieldNumber, 
    157                   badFieldLength 
    158                   ); 
    159           fprintf (stderr, "\n cTFSPtr->templateFlowSetId: %hu\n",  
    160                    cTFSPtr->templateFlowSetId); 
     151/*        fprintf(stderr,"\n IP: %lu.%lu.%lu.%lu, %d,%d\n", */ 
     152/*                cr->IpAddress>>24, */ 
     153/*                cr->IpAddress<<8>>24, */ 
     154/*                cr->IpAddress<<16>>24, */ 
     155/*                cr->IpAddress<<24>>24, */ 
     156/*                badFieldNumber, */ 
     157/*                badFieldLength */ 
     158/*                ); */ 
     159/*        fprintf (stderr, "\n cTFSPtr->templateFlowSetId: %hu\n",  */ 
     160/*                 cTFSPtr->templateFlowSetId); */ 
    161161          while ( ((*offV9))> (index)){ 
    162162            buffer2[1]= *(buf+index); index++; 
    163163            buffer2[0]= *(buf+index); index++; 
    164164            tmp = *((unsigned short*)&buffer2); 
    165             fprintf (stderr, " %hu ", tmp); 
     165/*          fprintf (stderr, " %hu ", tmp); */ 
    166166          } 
    167167          syslog (LOG_INFO,  
    168168                  "in new template: field nb gt 89, field lg gt 16 or too many fields, bad template definition possibility"); 
    169           fprintf(stderr,  
    170                   "\n in new template function: too many fields, bug collector or wrong template def \n");  
     169/*        fprintf(stderr,  */ 
     170/*                "\n in new template function: too many fields, bug collector or wrong template def \n");  */ 
    171171          ptpltmp = cTFSPtr; 
    172172          if (ptpltmp->prev == NULL) { 
     
    260260            buffer2[0]= *(buf+index); index++; 
    261261            tmp = *((unsigned short*)&buffer2); 
    262             fprintf (stderr, " %hu ", tmp); 
     262/*          fprintf (stderr, " %hu ", tmp); */ 
    263263          } 
    264264          syslog (LOG_INFO,  
    265265                  "in update template function: too many fields, bug collector or wrong template def in template update"); 
    266           fprintf(stderr, 
    267                   "\nin update template function: too many fields, bug collector or wrong template def in template update\n"); 
     266/*        fprintf(stderr, */ 
     267/*                "\nin update template function: too many fields, bug collector or wrong template def in template update\n"); */ 
    268268          ptpltmp = cTFSPtr; 
    269269          if (ptpltmp->prev == NULL) { 
  • trunk/tool/check.sh

    r31 r34  
    99  killall renetcolAgg 
    1010  sleep 1 
    11   /home/maintenance/renetcol-0.0.8/src/renetcolMsgCtl /home/maintenance/renetcol-0.0.8/src/renetcol 
     11  /home/maintenance/renetcol-0.0.9/src/renetcolMsgCtl /home/maintenance/renetcol-0.0.9/src/renetcol 
    1212  echo "renetcolMsgCtl started" 
    1313  sleep 5 
    14   /home/maintenance/renetcol-0.0.8/src/renetcol /home/maintenance/renetcol-0.0.8/src/info_routeur_netflow.txt /home/maintenance/renetcol-0.0.8/src/donneesblocsadresses2 /home/maintenance/renetcol-0.0.8/src/rules.txt 
     14  /home/maintenance/renetcol-0.0.9/src/renetcol /home/maintenance/renetcol-0.0.9/src/info_routeur_netflow.txt /home/maintenance/renetcol-0.0.8/src/donneesblocsadresses2 /home/maintenance/renetcol-0.0.8/src/rules.txt 
    1515  echo "renetcol restarted" 
    16   /home/maintenance/renetcol-0.0.8/src/renetcolSender /home/maintenance/renetcol-0.0.8/src/renetcol 1 /home/maintenance/renetcol-0.0.8/src/rules.txt 
     16  /home/maintenance/renetcol-0.0.9/src/renetcolSender /home/maintenance/renetcol-0.0.9/src/renetcol 1 /home/maintenance/renetcol-0.0.8/src/rules.txt 
    1717  echo "renetcolSender restarted" 
    18   /home/maintenance/renetcol-0.0.8/src/renetcolAgg  
     18  /home/maintenance/renetcol-0.0.9/src/renetcolAgg  
    1919else 
    2020  echo "All is up"