Changeset 6209

Show
Ignore:
Timestamp:
08/20/08 17:31:11 (5 months ago)
Author:
rbertholon
Message:

add Makefile.am and directory for new modules

Location:
trunk/centstorage
Files:
21 added
22 modified

Legend:

Unmodified
Added
Removed
  • trunk/centstorage/Makefile

    r6171 r6209  
    101101CC = gcc 
    102102CCDEPMODE = depmode=gcc3 
    103 CFLAGS =  -I/usr/include/oci/ -I/usr/include/openssl -I/usr/include 
     103CFLAGS =  -I/usr/include/openssl -I/usr/include 
    104104CPP = gcc -E 
    105 CPPFLAGS =  -I/usr/include/oci/ 
     105CPPFLAGS =  
    106106CYGPATH_W = echo 
    107107DBLDFLAGS =  -L/usr/lib/mysql 
    108 DBLIBS =  -lmysqlclient -lpq  -lnnz11 -lclntsh -locijdbc11 -lm 
     108DBLIBS =  -lmysqlclient -lpq 
    109109DEFS = -DHAVE_CONFIG_H 
    110110DEPDIR = .deps 
     
    195195top_srcdir = . 
    196196EXTRA_DIST = reconf configure CentStorage.conf CentStorageCtl CentStorage.pid 
    197 SUBDIRS = src lib/libmd5 includes modules/recup_perf_datas \ 
    198           modules/recup_perf_datas_client 
     197SUBDIRS = src                           \ 
     198                lib/libmd5                      \ 
     199                includes                        \ 
     200                modules/recup_perf_datas        \ 
     201                modules/recup_perf_datas_client \ 
     202                modules/purge                   \ 
     203                modules/rebuild                 \ 
     204                modules/sync 
    199205 
    200206all: all-recursive 
  • trunk/centstorage/Makefile.am

    r5739 r6209  
    2222EXTRA_DIST = reconf configure CentStorage.conf CentStorageCtl CentStorage.pid 
    2323 
    24 SUBDIRS = src lib/libmd5 includes modules/recup_perf_datas \ 
    25           modules/recup_perf_datas_client 
     24SUBDIRS =       src                             \ 
     25                lib/libmd5                      \ 
     26                includes                        \ 
     27                modules/recup_perf_datas        \ 
     28                modules/recup_perf_datas_client \ 
     29                modules/purge                   \ 
     30                modules/rebuild                 \ 
     31                modules/sync 
  • trunk/centstorage/Makefile.in

    r5925 r6209  
    195195top_srcdir = @top_srcdir@ 
    196196EXTRA_DIST = reconf configure CentStorage.conf CentStorageCtl CentStorage.pid 
    197 SUBDIRS = src lib/libmd5 includes modules/recup_perf_datas \ 
    198           modules/recup_perf_datas_client 
     197SUBDIRS = src                           \ 
     198                lib/libmd5                      \ 
     199                includes                        \ 
     200                modules/recup_perf_datas        \ 
     201                modules/recup_perf_datas_client \ 
     202                modules/purge                   \ 
     203                modules/rebuild                 \ 
     204                modules/sync 
    199205 
    200206all: all-recursive 
  • trunk/centstorage/config.status

    r6122 r6209  
    302302 
    303303# Files that config.status was made for. 
    304 config_files=" Makefile src/Makefile lib/libmd5/Makefile modules/recup_perf_datas/Makefile modules/recup_perf_datas_client/Makefile" 
     304config_files=" Makefile src/Makefile lib/libmd5/Makefile modules/recup_perf_datas/Makefile modules/rebuild/Makefile modules/sync/Makefile modules/purge/Makefile modules/recup_perf_datas_client/Makefile" 
    305305config_headers=" includes/config.h" 
    306306config_commands=" depfiles" 
     
    336336config.status 
    337337configured by ./configure, generated by GNU Autoconf 2.61, 
    338   with options \"'--with-oracle-inc=/usr/include/oci/'\" 
     338  with options \"\" 
    339339 
    340340Copyright (C) 2006 Free Software Foundation, Inc. 
     
    411411 
    412412if $ac_cs_recheck; then 
    413   echo "running CONFIG_SHELL=/bin/bash /bin/bash ./configure " '--with-oracle-inc=/usr/include/oci/' $ac_configure_extra_args " --no-create --no-recursion" >&6 
     413  echo "running CONFIG_SHELL=/bin/bash /bin/bash ./configure " $ac_configure_extra_args " --no-create --no-recursion" >&6 
    414414  CONFIG_SHELL=/bin/bash 
    415415  export CONFIG_SHELL 
    416   exec /bin/bash "./configure" '--with-oracle-inc=/usr/include/oci/' $ac_configure_extra_args --no-create --no-recursion 
     416  exec /bin/bash "./configure" $ac_configure_extra_args --no-create --no-recursion 
    417417fi 
    418418 
     
    442442    "lib/libmd5/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libmd5/Makefile" ;; 
    443443    "modules/recup_perf_datas/Makefile") CONFIG_FILES="$CONFIG_FILES modules/recup_perf_datas/Makefile" ;; 
     444    "modules/rebuild/Makefile") CONFIG_FILES="$CONFIG_FILES modules/rebuild/Makefile" ;; 
     445    "modules/sync/Makefile") CONFIG_FILES="$CONFIG_FILES modules/sync/Makefile" ;; 
     446    "modules/purge/Makefile") CONFIG_FILES="$CONFIG_FILES modules/purge/Makefile" ;; 
    444447    "modules/recup_perf_datas_client/Makefile") CONFIG_FILES="$CONFIG_FILES modules/recup_perf_datas_client/Makefile" ;; 
    445448 
     
    571574s,@host_os@,|#_!!_#|linux-gnu,g 
    572575s,@CC@,|#_!!_#|gcc,g 
    573 s,@CFLAGS@,|#_!!_#| -I/usr/include/oci/ -I/usr/include/openssl -I/usr/include,g 
     576s,@CFLAGS@,|#_!!_#| -I/usr/include/openssl -I/usr/include,g 
    574577s,@LDFLAGS@,|#_!!_#|  -L/usr/lib/mysql -L/usr/lib,g 
    575 s,@CPPFLAGS@,|#_!!_#| -I/usr/include/oci/,g 
     578s,@CPPFLAGS@,|#_!!_#|,g 
    576579s,@ac_ct_CC@,|#_!!_#|gcc,g 
    577580s,@EXEEXT@,|#_!!_#|,g 
     
    594597s,@XML_HEADER@,|#_!!_#|-I/usr/include/libxml,g 
    595598s,@HAVE_SSL@,|#_!!_#|,g 
    596 s,@DBLIBS@,|#_!!_#| -lmysqlclient -lpq  -lnnz11 -lclntsh -locijdbc11 -lm,g 
     599s,@DBLIBS@,|#_!!_#| -lmysqlclient -lpq,g 
    597600s,@DBLDFLAGS@,|#_!!_#| -L/usr/lib/mysql,g 
    598601s,@LIBOBJS@,|#_!!_#|,g 
     
    891894s,^\([   #]*\)[^         ]*\([   ]*USE_MYSQL\)[  (].*,\1define\2 1 , 
    892895s,^\([   #]*\)[^         ]*\([   ]*USE_PGSQL\)[  (].*,\1define\2 1 , 
    893 s,^\([   #]*\)[^         ]*\([   ]*USE_ORACLE\)[         (].*,\1define\2  , 
    894896s,^\([   #]*\)[^         ]*\([   ]*HAVE_SSL\)[   (].*,\1define\2 1 , 
    895897s/ $// 
  • trunk/centstorage/configure

    r6185 r6209  
    17391739ac_compiler_gnu=$ac_cv_c_compiler_gnu 
    17401740 
    1741  ac_config_headers="$ac_config_headers includes/config.h" 
     1741 
     1742ac_config_headers="$ac_config_headers includes/config.h" 
    17421743 
    17431744 
     
    22212222 
    22222223am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' 
    2223  
    2224  
    2225  
    22262224 
    22272225 
     
    58225820 
    58235821        ORACLELIBFOUND=no 
    5824  
    5825                                                 { echo "$as_me:$LINENO: checking for ocierr in -lclntsh" >&5 
     5822        { echo "$as_me:$LINENO: checking for ocierr in -lclntsh" >&5 
    58265823echo $ECHO_N "checking for ocierr in -lclntsh... $ECHO_C" >&6; } 
    58275824if test "${ac_cv_lib_clntsh_ocierr+set}" = set; then 
     
    58895886  ORACLELIBFOUND=no 
    58905887fi 
    5891  
    58925888 
    58935889                if test x$ORACLELIBFOUND = xno; then 
     
    60736069        fi 
    60746070fi 
    6075  
    6076  
    60776071 
    60786072# Check whether --enable-ssl was given. 
     
    62026196 
    62036197 
    6204 ac_config_files="$ac_config_files Makefile src/Makefile lib/libmd5/Makefile modules/recup_perf_datas/Makefile modules/recup_perf_datas_client/Makefile" 
     6198ac_config_files="$ac_config_files Makefile src/Makefile lib/libmd5/Makefile modules/recup_perf_datas/Makefile modules/rebuild/Makefile modules/sync/Makefile modules/purge/Makefile modules/recup_perf_datas_client/Makefile" 
    62056199 
    62066200 
     
    67156709    "lib/libmd5/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libmd5/Makefile" ;; 
    67166710    "modules/recup_perf_datas/Makefile") CONFIG_FILES="$CONFIG_FILES modules/recup_perf_datas/Makefile" ;; 
     6711    "modules/rebuild/Makefile") CONFIG_FILES="$CONFIG_FILES modules/rebuild/Makefile" ;; 
     6712    "modules/sync/Makefile") CONFIG_FILES="$CONFIG_FILES modules/sync/Makefile" ;; 
     6713    "modules/purge/Makefile") CONFIG_FILES="$CONFIG_FILES modules/purge/Makefile" ;; 
    67176714    "modules/recup_perf_datas_client/Makefile") CONFIG_FILES="$CONFIG_FILES modules/recup_perf_datas_client/Makefile" ;; 
    67186715 
  • trunk/centstorage/configure.in

    r6185 r6209  
    2525AC_DEFINE([USE_PGSQL], [], [using libmysqlclient]) 
    2626AC_DEFINE([HAVE_SSL], [], [compiling with ssl]) 
    27 AC_INIT dnl (src/centstorage.c) 
     27AC_INIT 
    2828AM_CONFIG_HEADER(includes/config.h) 
    2929AC_PREFIX_DEFAULT(/usr/local/) 
     
    289289 
    290290        ORACLELIBFOUND=no 
    291  
    292         dnl check compress lib for Mac OSX as well... 
    293         dnl AC_CHECK_LIB(z,compress) 
    294         dnl AC_CHECK_LIB(mysqlclient,_store_result,ORACLELIBFOUND=yes,ORACLELIBFOUND=no) 
    295         dnl LD_LIBRARY_PATH=/home/nagios/ndoutils-1.4b7-oracle/liboci/lib/oracle_instantclient_10_2/lib 
    296         dnl LD_RUN_PATH=/home/nagios/ndoutils-1.4b7-oracle/liboci/lib/oracle_instantclient_10_2/lib 
    297291        AC_CHECK_LIB(clntsh,ocierr,ORACLELIBFOUND=yes,ORACLELIBFOUND=no) 
    298  
    299292        dnl Did we find the ORACLE libraries? 
    300293        if test x$ORACLELIBFOUND = xno; then 
     
    348341        fi 
    349342fi 
    350  
    351  
    352 dnl AC_DEFINE([HAVE_KRB5_H], [], [*** define HAVE_KRB5_H ***]) 
    353 dnl AC_DEFINE([HAVE_SSL], [], [define have ssl]) 
    354343 
    355344dnl Does user want to check for SSL? 
     
    375364        ssl_lib_dir=$withval 
    376365        ]) 
    377 dnl AC_ARG_WITH(kerberos-inc,--with-kerberos-inc=DIR sets location of the Kerberos include files,[ 
    378 dnl         kerberos_inc_dir=$withval 
    379 dnl         ]) 
    380366 
    381367dnl Check for SSL support 
     
    462448AC_SUBST(LDFLAGS) 
    463449AC_SUBST(LIBS) 
    464 AC_OUTPUT(Makefile              \ 
    465           src/Makefile          \ 
    466           lib/libmd5/Makefile   \ 
    467           modules/recup_perf_datas/Makefile \ 
     450AC_OUTPUT(Makefile                              \ 
     451          src/Makefile                          \ 
     452          lib/libmd5/Makefile                   \ 
     453          modules/recup_perf_datas/Makefile     \ 
     454          modules/rebuild/Makefile              \ 
     455          modules/sync/Makefile                 \ 
     456          modules/purge/Makefile                \ 
    468457          modules/recup_perf_datas_client/Makefile) 
    469458 
  • trunk/centstorage/includes/centstorage.h

    r5649 r6209  
    2525#include <Conf.h> 
    2626 
    27 #define USAGE                   "CentStorage: Usage: CentStorage [-f ConfFile] [-l logfile]" 
     27#define USAGE   "CentStorage: Usage: CentStorage [-f ConfFile] [-l logfile]" 
    2828 
    2929#define WELCOME_MESSAGE         "##################################################\n\ 
     
    3333#define EXIT_MESSAGE "Good  bye" 
    3434 
    35 #define CENTSTORAGE_START       " [Core] CentStorage started" 
    36 #define ERROR_INFOS_LOGS        "Cannot log informations." 
     35#define CENTSTORAGE_START " [Core] CentStorage started" 
     36#define ERROR_INFOS_LOGS "Cannot log informations." 
    3737 
    3838 
     
    4040   for the configuration. The -f optin allow the user tu choose his own configuration 
    4141   file*/ 
    42 #define DEFAULT_CONF_FILE       "CentStorage.conf" 
     42#define DEFAULT_CONF_FILE "CentStorage.conf" 
    4343 
    4444typedef struct  argv_s 
  • trunk/centstorage/includes/config.h

    r6122 r6209  
    9090 
    9191/* Define if using Oracle */ 
    92 #define USE_ORACLE  
     92/* #undef USE_ORACLE */ 
    9393 
    9494/* using libmysqlclient */ 
  • trunk/centstorage/lib/libmd5/Makefile

    r6173 r6209  
    5252CC = gcc 
    5353CCDEPMODE = depmode=gcc3 
    54 CFLAGS =  -I/usr/include/oci/ -I/usr/include/openssl -I/usr/include 
     54CFLAGS =  -I/usr/include/openssl -I/usr/include 
    5555CPP = gcc -E 
    56 CPPFLAGS =  -I/usr/include/oci/ 
     56CPPFLAGS =  
    5757CYGPATH_W = echo 
    5858DBLDFLAGS =  -L/usr/lib/mysql 
    59 DBLIBS =  -lmysqlclient -lpq  -lnnz11 -lclntsh -locijdbc11 -lm 
     59DBLIBS =  -lmysqlclient -lpq 
    6060DEFS = -DHAVE_CONFIG_H 
    6161DEPDIR = .deps 
  • trunk/centstorage/modules/recup_perf_datas/Makefile

    r6173 r6209  
    100100CC = gcc 
    101101CCDEPMODE = depmode=gcc3 
    102 CFLAGS =  -I/usr/include/oci/ -I/usr/include/openssl -I/usr/include 
     102CFLAGS =  -I/usr/include/openssl -I/usr/include 
    103103CPP = gcc -E 
    104 CPPFLAGS =  -I/usr/include/oci/ 
     104CPPFLAGS =  
    105105CYGPATH_W = echo 
    106106DBLDFLAGS =  -L/usr/lib/mysql 
    107 DBLIBS =  -lmysqlclient -lpq  -lnnz11 -lclntsh -locijdbc11 -lm 
     107DBLIBS =  -lmysqlclient -lpq 
    108108DEFS = -DHAVE_CONFIG_H 
    109109DEPDIR = .deps 
     
    212212 
    213213dir_INCLUDES = ../../includes 
    214 INCLUDES = -I$(dir_INCLUDES) -I. -pg -I/usr/include/libxml 
    215 recup_perf_datas_so_LDADD = -lpthread -lxml2  -lmysqlclient -lpq  -lnnz11 -lclntsh -locijdbc11 -lm 
     214INCLUDES = -I$(dir_INCLUDES) -I. -I/usr/include/libxml 
     215recup_perf_datas_so_LDADD = -lpthread -lxml2  -lmysqlclient -lpq 
    216216recup_perf_datas_so_CFLAGS = -fPIC 
    217 #options -shares and -nostartfiles required to compile a shared library 
    218217recup_perf_datas_so_LDFLAGS = -shared -W -Wall -ansi -pedantic  \ 
    219218                                 -L/usr/lib/mysql `xml2-config --cflags` 
  • trunk/centstorage/modules/recup_perf_datas/Makefile.am

    r6163 r6209  
    4242dir_INCLUDES = ../../includes 
    4343 
    44 INCLUDES = -I$(dir_INCLUDES) -I. -pg @XML_HEADER@ 
     44INCLUDES = -I$(dir_INCLUDES) -I. @XML_HEADER@ 
    4545 
    4646recup_perf_datas_so_LDADD =  -lpthread @XML_LIBS@ @DBLIBS@ 
    4747 
    4848recup_perf_datas_so_CFLAGS = @MOD_CFLAGS@ 
    49 #options -shares and -nostartfiles required to compile a shared library 
    50 recup_perf_datas_so_LDFLAGS = @MOD_LDFLAGS@ -W -Wall -ansi -pedantic    \ 
     49 
     50recup_perf_datas_so_LDFLAGS =   @MOD_LDFLAGS@ -W -Wall -ansi -pedantic  \ 
    5151                                @DBLDFLAGS@ `xml2-config --cflags` 
    5252 
  • trunk/centstorage/modules/recup_perf_datas/Makefile.in

    r6163 r6209  
    212212 
    213213dir_INCLUDES = ../../includes 
    214 INCLUDES = -I$(dir_INCLUDES) -I. -pg @XML_HEADER@ 
     214INCLUDES = -I$(dir_INCLUDES) -I. @XML_HEADER@ 
    215215recup_perf_datas_so_LDADD = -lpthread @XML_LIBS@ @DBLIBS@ 
    216216recup_perf_datas_so_CFLAGS = @MOD_CFLAGS@ 
    217 #options -shares and -nostartfiles required to compile a shared library 
    218217recup_perf_datas_so_LDFLAGS = @MOD_LDFLAGS@ -W -Wall -ansi -pedantic    \ 
    219218                                @DBLDFLAGS@ `xml2-config --cflags` 
  • trunk/centstorage/modules/recup_perf_datas/connection_SSL.c

    r6192 r6209  
    345345    free(serverCrt); 
    346346  free(tmp); 
     347 
     348  pthread_mutex_destroy(&SSL_mutex); 
     349  pthread_mutex_destroy(&SSL_conf_mutex); 
     350 
    347351  pthread_exit(NULL); 
    348352} 
  • trunk/centstorage/modules/recup_perf_datas/insertValInDataBase.c

    r6192 r6209  
    115115    { 
    116116      nb_request = 0; 
    117       data_request = malloc(DATA_BIN_SIZE); 
     117      data_request = malloc(REQUEST_SIZE * confModule->nb_request); 
    118118      if (!data_request) 
    119119        { 
     
    444444  if (!data_request) 
    445445    { 
    446       data_request = malloc(DATA_BIN_SIZE); 
     446      data_request = malloc(REQUEST_SIZE * confModule->nb_request); 
    447447      if (!data_request) 
    448448        { 
     
    710710        PQclear(res); 
    711711        free(data_request); 
     712        data_request = NULL; 
    712713      } 
    713714 
  • trunk/centstorage/modules/recup_perf_datas/insertValInDataBase.h

    r6192 r6209  
    4141#include <parseDatas.h> 
    4242 
    43 #define REQUEST_SIZE    256 
    44 #define DATA_BIN_SIZE   4096 
    45 #define PGSQL_REQ_SIZE  512 
     43#define REQUEST_SIZE    128 
     44//#define DATA_BIN_SIZE 4096 
     45#define PGSQL_REQ_SIZE  128 
    4646 
    4747/* error messages */ 
     
    6565ORDER BY metric_id DESC LIMIT 1" 
    6666 
    67 #define BUILD_REQUEST(begin, request, host, svce) {     \ 
     67#define BUILD_REQUEST(begin, request, host, svce) {             \ 
    6868    sprintf(request, "%s%s\' AND service_description=\'%s\'",   \ 
    6969            begin, host, svce); } 
     
    9090 
    9191#define CONCAT_REQUEST_FIELDS(request, value, name) {   \ 
    92     if (value)                                  \ 
    93       {                                         \ 
    94         strcat(request, ", ");                  \ 
    95         strcat(request, name);                  \ 
    96       }                                         \ 
     92    if (value)                                          \ 
     93      {                                                 \ 
     94        strcat(request, ", ");                          \ 
     95        strcat(request, name);                          \ 
     96      }                                                 \ 
    9797  } 
    9898 
     
    111111#define REQUEST_INSERT_METRIC_PG "INSERT INTO metrics (metric_id, index_id, metric_name" 
    112112 
    113 #define BUILD_INSERT_METRIC_REQUEST_PG(begin, request, index_id, metric_name, \ 
    114 unit, warn, crit, min, max) {                           \ 
    115   strcpy(request, begin);                               \ 
    116   CONCAT_REQUEST_FIELDS(request, unit, "unit_name");    \ 
    117   CONCAT_REQUEST_FIELDS(request, warn, "warn");         \ 
    118   CONCAT_REQUEST_FIELDS(request, crit, "crit");         \ 
    119   CONCAT_REQUEST_FIELDS(request, min, "min");           \ 
    120   CONCAT_REQUEST_FIELDS(request, max, "max");           \ 
    121   strcat(request, ") VALUES (");                        \ 
    122   strcat(request, "nextval(\'metrics_metric_id_seq\'),");\ 
    123   CONCAT_REQUEST_VAL(request, index_id);                \ 
    124   CONCAT_REQUEST_VAL(request, metric_name);             \ 
    125   CONCAT_REQUEST_VAL(request, unit);                    \ 
    126   CONCAT_REQUEST_VAL(request, warn);                    \ 
    127   CONCAT_REQUEST_VAL(request, crit);                    \ 
    128   CONCAT_REQUEST_VAL(request, min);                     \ 
    129   CONCAT_REQUEST_VAL(request, max);                     \ 
    130   request[strlen(request) - 1] = ')';                   \ 
     113#define BUILD_INSERT_METRIC_REQUEST_PG(begin, request, index_id, metric_name,   \ 
     114unit, warn, crit, min, max) {                                                   \ 
     115  strcpy(request, begin);                                                       \ 
     116  CONCAT_REQUEST_FIELDS(request, unit, "unit_name");                            \ 
     117  CONCAT_REQUEST_FIELDS(request, warn, "warn");                                 \ 
     118  CONCAT_REQUEST_FIELDS(request, crit, "crit");                                 \ 
     119  CONCAT_REQUEST_FIELDS(request, min, "min");                                   \ 
     120  CONCAT_REQUEST_FIELDS(request, max, "max");                                   \ 
     121  strcat(request, ") VALUES (");                                                \ 
     122  strcat(request, "nextval(\'metrics_metric_id_seq\'),");                       \ 
     123  CONCAT_REQUEST_VAL(request, index_id);                                        \ 
     124  CONCAT_REQUEST_VAL(request, metric_name);                                     \ 
     125  CONCAT_REQUEST_VAL(request, unit);                                            \ 
     126  CONCAT_REQUEST_VAL(request, warn);                                            \ 
     127  CONCAT_REQUEST_VAL(request, crit);                                            \ 
     128  CONCAT_REQUEST_VAL(request, min);                                             \ 
     129  CONCAT_REQUEST_VAL(request, max);                                             \ 
     130  request[strlen(request) - 1] = ')';                                           \ 
    131131} 
    132132#endif 
    133133 
    134 #define BUILD_INSERT_METRIC_REQUEST(begin, request, index_id, metric_name, \ 
    135 unit, warn, crit, min, max) {                           \ 
    136   strcpy(request, begin);                               \ 
    137   CONCAT_REQUEST_FIELDS(request, unit, "unit_name");    \ 
    138   CONCAT_REQUEST_FIELDS(request, warn, "warn");         \ 
    139   CONCAT_REQUEST_FIELDS(request, crit, "crit");         \ 
    140   CONCAT_REQUEST_FIELDS(request, min, "min");           \ 
    141   CONCAT_REQUEST_FIELDS(request, max, "max");           \ 
    142   strcat(request, ") VALUES (");                        \ 
    143   CONCAT_REQUEST_VAL(request, index_id);                \ 
    144   CONCAT_REQUEST_VAL(request, metric_name);             \ 
    145   CONCAT_REQUEST_VAL(request, unit);                    \ 
    146   CONCAT_REQUEST_VAL(request, warn);                    \ 
    147   CONCAT_REQUEST_VAL(request, crit);                    \ 
    148   CONCAT_REQUEST_VAL(request, min);                     \ 
    149   CONCAT_REQUEST_VAL(request, max);                     \ 
    150   request[strlen(request) - 1] = ')';                   \ 
    151 } 
     134#define BUILD_INSERT_METRIC_REQUEST(begin, request, index_id, metric_name,      \ 
     135unit, warn, crit, min, max) {                                                   \ 
     136  strcpy(request, begin);                                                       \ 
     137  CONCAT_REQUEST_FIELDS(request, unit, "unit_name");                            \ 
     138  CONCAT_REQUEST_FIELDS(request, warn, "warn");                                 \ 
     139  CONCAT_REQUEST_FIELDS(request, crit, "crit");                                 \ 
     140  CONCAT_REQUEST_FIELDS(request, min, "min");                                   \ 
     141  CONCAT_REQUEST_FIELDS(request, max, "max");                                   \ 
     142  strcat(request, ") VALUES (");                                                \