You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(19) |
Oct
(10) |
Nov
(14) |
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
(5) |
Mar
(33) |
Apr
(31) |
May
(3) |
Jun
(30) |
Jul
(4) |
Aug
(26) |
Sep
(23) |
Oct
|
Nov
(6) |
Dec
(56) |
2008 |
Jan
(12) |
Feb
(9) |
Mar
(2) |
Apr
(8) |
May
(2) |
Jun
(3) |
Jul
(4) |
Aug
(1) |
Sep
|
Oct
|
Nov
(16) |
Dec
(4) |
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(36) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
|
Dec
|
From: Florian G. <re...@us...> - 2007-03-15 00:02:07
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25545/db_tools Modified Files: convert.c Log Message: ncurses tweaks Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** convert.c 14 Mar 2007 00:05:40 -0000 1.17 --- convert.c 15 Mar 2007 00:01:58 -0000 1.18 *************** *** 145,149 **** int iNDBnumrows; ! int i; // ncurses variables --- 145,149 ---- int iNDBnumrows; ! int i,x,y; // ncurses variables *************** *** 155,158 **** --- 155,162 ---- getmaxyx(stdscr,iNCrows,iNCcols); + // switch on scrolling + idlok(stdscr,TRUE); + scrollok(stdscr,TRUE); + printw(_("The database schema for perfparse changed dramatically. ")); printw(_("Changing the tables\nwould be too error-prone, so we decided to copy the data into a new database.\n")); *************** *** 218,223 **** refresh(); echo(); ! if(scanw("%s64",sODBhost) == 0) { ! printw("localhost"); } refresh(); --- 222,230 ---- refresh(); echo(); ! getyx(stdscr,y,x); ! if(scanw("%s64",sODBhost) == ERR) { ! move(y,x); ! printw("localhost\n"); ! sprintf(sODBhost,"localhost"); } refresh(); |
From: Florian G. <re...@us...> - 2007-03-14 00:05:41
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv960/db_tools Modified Files: Makefile.am Makefile.in convert.c Log Message: switching to ncurses Index: Makefile.in =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/Makefile.in,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Makefile.in 20 Dec 2006 22:57:46 -0000 1.18 --- Makefile.in 14 Mar 2007 00:05:40 -0000 1.19 *************** *** 163,166 **** --- 163,167 ---- GMSGFMT = @GMSGFMT@ GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ *************** *** 226,235 **** ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ - ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ - ac_ct_RANLIB = @ac_ct_RANLIB@ - ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ --- 227,233 ---- *************** *** 250,253 **** --- 248,254 ---- cgidir = @cgidir@ datadir = @datadir@ + datarootdir = @datarootdir@ + docdir = @docdir@ + dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ *************** *** 256,259 **** --- 257,261 ---- host_os = @host_os@ host_vendor = @host_vendor@ + htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ *************** *** 261,271 **** --- 263,276 ---- libdir = @libdir@ libexecdir = @libexecdir@ + localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ + pdfdir = @pdfdir@ phpuidir = @phpuidir@ prefix = @prefix@ program_transform_name = @program_transform_name@ + psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ *************** *** 283,287 **** @USE_DB_POSTGRESQL_TRUE@USE_POSTGRESQL_LIBS = -L${top_builddir}/libpp_postgresql -lpp_postgresql ${POSTGRESQL_LIBS} PERFPARSE_DB_INCLUDES = '-DLOCALSTATEDIR="${localstatedir}"' '-DSYSCONFDIR="$(sysconfdir)"' '-DLOCALEDIR="${datadir}/locale"' ${USE_MYSQL_CFLAGS} ${USE_POSTGRESQL_CFLAGS} ${GLIB_CFLAGS} -I${top_srcdir}/libpp_common -I${top_srcdir} ! PERFPARSE_DB_LDADD = ${USE_MYSQL_LIBS} ${USE_POSTGRESQL_LIBS} -L${top_builddir}/libpp_common -lpp_common ${GLIB_LIBS} @LTLIBINTL@ perfparse_db_tool_SOURCES = perfparse-db-tool.c convert.c convert.h perfparse_db_tool_LDADD = ${PERFPARSE_DB_LDADD} --- 288,292 ---- @USE_DB_POSTGRESQL_TRUE@USE_POSTGRESQL_LIBS = -L${top_builddir}/libpp_postgresql -lpp_postgresql ${POSTGRESQL_LIBS} PERFPARSE_DB_INCLUDES = '-DLOCALSTATEDIR="${localstatedir}"' '-DSYSCONFDIR="$(sysconfdir)"' '-DLOCALEDIR="${datadir}/locale"' ${USE_MYSQL_CFLAGS} ${USE_POSTGRESQL_CFLAGS} ${GLIB_CFLAGS} -I${top_srcdir}/libpp_common -I${top_srcdir} ! PERFPARSE_DB_LDADD = ${USE_MYSQL_LIBS} ${USE_POSTGRESQL_LIBS} -L${top_builddir}/libpp_common -lpp_common -lncurses ${GLIB_LIBS} @LTLIBINTL@ perfparse_db_tool_SOURCES = perfparse-db-tool.c convert.c convert.h perfparse_db_tool_LDADD = ${PERFPARSE_DB_LDADD} Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** convert.c 13 Mar 2007 06:45:03 -0000 1.16 --- convert.c 14 Mar 2007 00:05:40 -0000 1.17 *************** *** 40,43 **** --- 40,44 ---- #include <sys/types.h> #include <regex.h> + #include <ncurses.h> /* *************** *** 65,68 **** --- 66,70 ---- int dbtool_rows(MYSQL_RES *p_tmp_query_result); char *read_line (char *buf, size_t length); + char *read_string_from_line(char *buf, size_t length); void *************** *** 145,180 **** int i; ! printf(_("The database schema for perfparse changed dramatically. ")); ! printf(_("Changing the tables\nwould be too error-prone, so we decided to copy the data into a new database.\n")); ! printf(_("This step can take days for large databases. ")); ! printf(_("You should have prepared a new\ndatabase for this conversion step. ")); ! printf(_("This database should contain the v 0.20\ndatabase schema. ")); ! printf(_("You should have enough disk space to duplicate your old\ndatabase. ")); ! printf(_("To minimize downtime you can use the new schema with your new\nperfparse while old data are copied. ")); ! printf(_("For more information visit\nhttp://perfparse.de/tiki-index.php?page=DatabaseUpgrade \n")); ! printf(_("\nAre you sure to start the conversion (y/n)? ")); ! while((yesno=getchar())) { ! if(yesno == 'y') break; if(yesno == 'n') { ! printf(_("\nBye.\n")); exit(1); } } ! printf(_("\n\nIn the next step you will have to provide data of the old and the new database.\n")); ! printf(_("With the commandline or in the configuration file you provided these data:\n")); ! printf(_("Database Host:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_HOST)); ! printf(_("Database User:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_USER)); ! printf(_("Database Password:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_PWD)); ! printf(_("Database Name:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_DATABASE)); ! printf(_("Database TCP Port:\t%d\n"),config_get_value_as_integer(CONFIG_ITEM_ID_DB_PORT)); ! printf(_("Database Unix Socket:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_SOCKET)); ! printf(_("\n\nAre these values for the old or the new database? (o/n) or none of both (x)?")); ! while((yesno=getchar())) { if(yesno == 'o' || yesno == 'n' || yesno == 'x') break; } // old database connection --- 147,205 ---- int i; ! // ncurses variables ! int iNCrows, iNCcols; ! ! // init ncurses ! initscr(); ! cbreak(); ! getmaxyx(stdscr,iNCrows,iNCcols); ! ! printw(_("The database schema for perfparse changed dramatically. ")); ! printw(_("Changing the tables\nwould be too error-prone, so we decided to copy the data into a new database.\n")); ! printw(_("This step can take days for large databases. ")); ! printw(_("You should have prepared a new\ndatabase for this conversion step. ")); ! printw(_("This database should contain the v 0.20\ndatabase schema. ")); ! printw(_("You should have enough disk space to duplicate your old\ndatabase. ")); ! printw(_("To minimize downtime you can use the new schema with your new\nperfparse while old data are copied. ")); ! printw(_("For more information visit\nhttp://perfparse.de/tiki-index.php?page=DatabaseUpgrade \n")); ! printw(_("\nAre you sure to start the conversion (y/n)? ")); ! refresh(); ! noecho(); ! attron(A_BOLD); ! while((yesno=getch())) { ! if(yesno == 'y'){ ! printw("%c\n",yesno); break; + } if(yesno == 'n') { ! printw("%c",yesno); ! attroff(A_BOLD); ! printw(_("\nBye.\n")); ! refresh(); ! sleep(2); ! endwin(); exit(1); } } + attroff(A_BOLD); + refresh(); ! printw(_("\n\nIn the next step you will have to provide data of the old and the new database.\n")); ! printw(_("With the commandline or in the configuration file you provided these data:\n")); ! printw(_("Database Host:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_HOST)); ! printw(_("Database User:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_USER)); ! printw(_("Database Password:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_PWD)); ! printw(_("Database Name:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_DATABASE)); ! printw(_("Database TCP Port:\t%d\n"),config_get_value_as_integer(CONFIG_ITEM_ID_DB_PORT)); ! printw(_("Database Unix Socket:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_SOCKET)); ! printw(_("\n\nAre these values for the old or the new database? (o/n) or none of both (x)?")); ! refresh(); ! while((yesno=getch())) { if(yesno == 'o' || yesno == 'n' || yesno == 'x') break; } + attron(A_BOLD); printw("%c\n",yesno); attroff(A_BOLD); + refresh(); // old database connection *************** *** 187,215 **** sODBsocket=config_get_value_as_string(CONFIG_ITEM_ID_DB_SOCKET); } else { //ask user ! printf(_("Please enter the connection data for the old database below:\n")); sODBhost=malloc(65); ! printf(_("Database Host: ")); ! while(TRUE) { ! if(read_line(sTmpBuf,64)!=NULL) { ! //printf("readed line %s \n",sTmpBuf); ! if(sscanf(sTmpBuf,"%s64",sODBhost)) { ! break; ! } ! } ! printf(_("Wrong input!\n")); } sODBuser=malloc(65); printf(_("Database User: ")); ! fscanf(stdin,"%s64",sODBuser); sODBpass=malloc(65); printf(_("Database Password: ")); ! fscanf(stdin,"%s64",sODBpass); sODBdatabase=malloc(65); printf(_("Database Name: ")); ! fscanf(stdin,"%s64",sODBdatabase); printf(_("Database Port: ")); --- 212,239 ---- sODBsocket=config_get_value_as_string(CONFIG_ITEM_ID_DB_SOCKET); } else { //ask user ! printw(_("Please enter the connection data for the old database below:\n")); sODBhost=malloc(65); ! printw(_("Database Host (default: localhost): ")); ! refresh(); ! echo(); ! if(scanw("%s64",sODBhost) == 0) { ! printw("localhost"); } + refresh(); + + sODBuser=malloc(65); printf(_("Database User: ")); ! read_string_from_line(sODBuser,64); sODBpass=malloc(65); printf(_("Database Password: ")); ! read_string_from_line(sODBpass,64); sODBdatabase=malloc(65); printf(_("Database Name: ")); ! read_string_from_line(sODBdatabase,64); printf(_("Database Port: ")); *************** *** 218,222 **** sODBsocket=malloc(65); printf(_("Database Socket: ")); ! fscanf(stdin,"%s64",sODBsocket); } --- 242,246 ---- sODBsocket=malloc(65); printf(_("Database Socket: ")); ! read_string_from_line(sODBsocket,64); } *************** *** 452,456 **** char *input_line; ! if (input_line = fgets (buf, length, stdin)) { size_t last = strlen (buf) - 1; --- 476,480 ---- char *input_line; ! if ((input_line = fgets (buf, length, stdin))) { size_t last = strlen (buf) - 1; *************** *** 466,470 **** } ! void dbtool_mysql_query(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result) { --- 490,504 ---- } ! char *read_string_from_line(char *buf, size_t length) { ! while(TRUE) { ! if(read_line(buf,length)!=NULL) { ! if(strlen(buf)>0) { ! return(buf); ! } ! } ! printf(_("Wrong input! Please try again: :")); ! } ! } ! void dbtool_mysql_query(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result) { Index: Makefile.am =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/Makefile.am,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile.am 26 Sep 2005 14:36:33 -0000 1.1.1.1 --- Makefile.am 14 Mar 2007 00:05:40 -0000 1.2 *************** *** 12,16 **** PERFPARSE_DB_INCLUDES='-DLOCALSTATEDIR="${localstatedir}"' '-DSYSCONFDIR="$(sysconfdir)"' '-DLOCALEDIR="${datadir}/locale"' ${USE_MYSQL_CFLAGS} ${USE_POSTGRESQL_CFLAGS} ${GLIB_CFLAGS} -I${top_srcdir}/libpp_common -I${top_srcdir} ! PERFPARSE_DB_LDADD=${USE_MYSQL_LIBS} ${USE_POSTGRESQL_LIBS} -L${top_builddir}/libpp_common -lpp_common ${GLIB_LIBS} @LTLIBINTL@ bin_PROGRAMS=${MYSQL_DBTOOLS} ${POSTGRESQL_DBTOOLS} --- 12,16 ---- PERFPARSE_DB_INCLUDES='-DLOCALSTATEDIR="${localstatedir}"' '-DSYSCONFDIR="$(sysconfdir)"' '-DLOCALEDIR="${datadir}/locale"' ${USE_MYSQL_CFLAGS} ${USE_POSTGRESQL_CFLAGS} ${GLIB_CFLAGS} -I${top_srcdir}/libpp_common -I${top_srcdir} ! PERFPARSE_DB_LDADD=${USE_MYSQL_LIBS} ${USE_POSTGRESQL_LIBS} -L${top_builddir}/libpp_common -lpp_common -lncurses ${GLIB_LIBS} @LTLIBINTL@ bin_PROGRAMS=${MYSQL_DBTOOLS} ${POSTGRESQL_DBTOOLS} |
From: Florian G. <re...@us...> - 2007-03-13 21:59:57
|
Update of /cvsroot/perfparse/_perfparse/perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17082/perfparse Modified Files: log_reader.c Log Message: Corrected bug where perfparsed does not close the client socket. Thanks to Tamas Erdei for the patch. (FG) Index: log_reader.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/perfparse/log_reader.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** log_reader.c 23 Dec 2006 00:03:46 -0000 1.4 --- log_reader.c 13 Mar 2007 21:59:50 -0000 1.5 *************** *** 529,532 **** --- 529,536 ---- if((LOG_FD_CLIENT_SOCKET != log_fd[i]->type) && (r!= 10)) break; } + if((LOG_FD_SOCKET == log_fd[i]->type) && (r==0)) { + close_log_source(i,1); + return(NULL); + } } |
From: Florian G. <re...@us...> - 2007-03-13 21:59:57
|
Update of /cvsroot/perfparse/_perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17082 Modified Files: ChangeLog Log Message: Corrected bug where perfparsed does not close the client socket. Thanks to Tamas Erdei for the patch. (FG) Index: ChangeLog =================================================================== RCS file: /cvsroot/perfparse/_perfparse/ChangeLog,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ChangeLog 5 Mar 2007 10:59:47 -0000 1.16 --- ChangeLog 13 Mar 2007 21:59:49 -0000 1.17 *************** *** 1,3 **** --- 1,4 ---- Version 0.106.2 + Corrected bug where perfparsed does not close the client socket. Thanks to Tamas Erdei for the patch. (FG) Image link corrected in "Read Nagios config" (Cedric Temple) Add French translation (Cedric Temple) |
From: Florian G. <re...@us...> - 2007-03-13 06:45:06
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19360/db_tools Modified Files: convert.c Log Message: more conversion Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** convert.c 11 Mar 2007 01:28:44 -0000 1.15 --- convert.c 13 Mar 2007 06:45:03 -0000 1.16 *************** *** 64,67 **** --- 64,68 ---- void dbtool_freeResult(MYSQL_RES *p_tmp_query_result); int dbtool_rows(MYSQL_RES *p_tmp_query_result); + char *read_line (char *buf, size_t length); void *************** *** 119,126 **** char yesno; ! char *sODBhost,*sODBuser,*sODBpass,*sODBdatabase,*sODBsocket; ! int iODBport; ! char *sNDBhost,*sNDBuser,*sNDBpass,*sNDBdatabase,*sNDBsocket; ! int iNDBport; int iStep=1; --- 120,128 ---- char yesno; ! char *sODBhost="localhost",*sODBuser="root",*sODBpass="",*sODBdatabase="",*sODBsocket="/var/lib/mysql/mysql.sock"; ! int iODBport=3306; ! char *sNDBhost="localhost",*sNDBuser="root",*sNDBpass="",*sNDBdatabase="",*sNDBsocket="/var/lib/mysql/mysql.sock"; ! int iNDBport=3306; ! char *sTmpBuf=malloc(256); int iStep=1; *************** *** 189,193 **** sODBhost=malloc(65); printf(_("Database Host: ")); ! fscanf(stdin,"%s64",sODBhost); sODBuser=malloc(65); --- 191,203 ---- sODBhost=malloc(65); printf(_("Database Host: ")); ! while(TRUE) { ! if(read_line(sTmpBuf,64)!=NULL) { ! //printf("readed line %s \n",sTmpBuf); ! if(sscanf(sTmpBuf,"%s64",sODBhost)) { ! break; ! } ! } ! printf(_("Wrong input!\n")); ! } sODBuser=malloc(65); *************** *** 244,249 **** printf(_("Database Socket: ")); fscanf(stdin,"%s64",sNDBsocket); } ! // connect to both databases --- 254,264 ---- printf(_("Database Socket: ")); fscanf(stdin,"%s64",sNDBsocket); + + } ! printf(_("Summary old Database:\nDatabase Host: '%s'\nDatabase User: '%s'\nDatabase Password: '%s'\nDatabase Name: '%s'\nDatabase Port: '%d'\nDatabase Socket: '%s'\n"), ! sODBhost,sODBuser,sODBpass,sODBdatabase,iODBport,sODBsocket); ! printf(_("Summary new Database:\nDatabase Host: '%s'\nDatabase User: '%s'\nDatabase Password: '%s'\nDatabase Name: '%s'\nDatabase Port: '%d'\nDatabase Socket: '%s'\n"), ! sNDBhost,sNDBuser,sNDBpass,sNDBdatabase,iNDBport,sNDBsocket); // connect to both databases *************** *** 433,436 **** --- 448,470 ---- } + char *read_line (char *buf, size_t length) + { + char *input_line; + + if (input_line = fgets (buf, length, stdin)) { + size_t last = strlen (buf) - 1; + + if (buf[last] == '\n') { + buf[last] = '\0'; + } else { + //clear stdin + fscanf (stdin, "%*[^\n]"); + (void) fgetc (stdin); + } + } + return input_line; + } + + void dbtool_mysql_query(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result) { |
From: Florian G. <re...@us...> - 2007-03-11 01:28:45
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26207/db_tools Modified Files: convert.c Log Message: first table copy. Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** convert.c 6 Mar 2007 23:57:04 -0000 1.14 --- convert.c 11 Mar 2007 01:28:44 -0000 1.15 *************** *** 61,65 **** void addTableRawSummaryData (); void pp_mysql_convert_sql_failure(char*f,int l, const char*str, const char *error); ! void --- 61,67 ---- void addTableRawSummaryData (); void pp_mysql_convert_sql_failure(char*f,int l, const char*str, const char *error); ! void dbtool_mysql_query(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result); ! void dbtool_freeResult(MYSQL_RES *p_tmp_query_result); ! int dbtool_rows(MYSQL_RES *p_tmp_query_result); void *************** *** 122,125 **** --- 124,129 ---- int iNDBport; + int iStep=1; + int iNumSteps=20; // Number of steps to convert the database MYSQL db_mysql_old; *************** *** 130,133 **** --- 134,146 ---- MYSQL_ROW result_row_new; + + GString *gsNDBSql = g_string_new (""); + GString *gsODBSql = g_string_new (""); + + int iODBnumrows; + int iNDBnumrows; + + int i; + printf(_("The database schema for perfparse changed dramatically. ")); printf(_("Changing the tables\nwould be too error-prone, so we decided to copy the data into a new database.\n")); *************** *** 233,237 **** } ! // connect to old databases if (!mysql_init (&db_mysql_old)) { --- 246,250 ---- } ! // connect to both databases if (!mysql_init (&db_mysql_old)) { *************** *** 243,247 **** sODBhost,sODBuser,sODBpass,sODBdatabase, iODBport,sODBsocket,0)) { ! printf(_("Cannot connect to old database. Errormessage: %s")); exit(EXIT_FAILURE); } --- 256,261 ---- sODBhost,sODBuser,sODBpass,sODBdatabase, iODBport,sODBsocket,0)) { ! printf(_("Cannot connect to old database. Errormessage: %s"), ! mysql_error(&db_mysql_old)); exit(EXIT_FAILURE); } *************** *** 250,257 **** sNDBhost,sNDBuser,sNDBpass,sNDBdatabase, iNDBport,sNDBsocket,0)) { ! printf(_("Cannot connect to new database. Errormessage: %s")); exit(EXIT_FAILURE); } /* --- 264,285 ---- sNDBhost,sNDBuser,sNDBpass,sNDBdatabase, iNDBport,sNDBsocket,0)) { ! printf(_("Cannot connect to new database. Errormessage: %s"), ! mysql_error(&db_mysql_new)); exit(EXIT_FAILURE); } + printf(_("Copying data of old perfdata_host_group to new perfdata_groups table.\n")); + printf(_("(Step %d of %d)\n"),iStep,iNumSteps); + + g_string_printf(gsODBSql, "select * from perfdata_host_group"); + dbtool_mysql_query(gsODBSql->str, &db_mysql_old, query_result_old); + iODBnumrows=dbtool_rows(query_result_old); + for (i=1 ; i<=iODBnumrows; i++) { + printf(_("Copying entry %d/%d"),i,iODBnumrows); + g_string_printf(gsNDBSql, "insert into perfdata_groups(group_name) values('%s')"); + dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); + printf("\r"); + } + printf(_("\ndone\n")); /* *************** *** 405,408 **** --- 433,480 ---- } + void dbtool_mysql_query(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result) + { + #ifdef SHOW_SQL + printf("SQL: \"%s\"\n", sql); + fflush(stdout); + #endif + dbtool_freeResult(p_tmp_query_result); + + if (mysql_query(p_tmp_db_mysql, sql)) { + printf(_("A error occured executing the sql command %s. The error message is: %s"), + sql, mysql_error(p_tmp_db_mysql)); + exit(EXIT_FAILURE); + } + + /*iRowsAffected = mysql_affected_rows(&tmp_db_mysql);*/ + + p_tmp_query_result = mysql_store_result(p_tmp_db_mysql); + + #ifdef SHOW_SQL + printf("Rows: %d\n", dbtool_rows(p_tmp_query_result)); + fflush(stdout); + #endif + + } + + void dbtool_freeResult(MYSQL_RES *p_tmp_query_result) + { + if (p_tmp_query_result) { + mysql_free_result(p_tmp_query_result); + p_tmp_query_result = NULL; + } + + } + + + int dbtool_rows(MYSQL_RES *p_tmp_query_result) + { + if (p_tmp_query_result) + return mysql_num_rows(p_tmp_query_result); + else + return 0; + } + + void pp_mysql_convert_sql_failure(char*f,int l, const char*str, const char *error) { printf(f,l,"%s (%s)",str,error); |
From: Florian G. <re...@us...> - 2007-03-06 23:57:06
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5644/db_tools Modified Files: convert.c Log Message: work in progress ... Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** convert.c 4 Mar 2007 00:08:07 -0000 1.13 --- convert.c 6 Mar 2007 23:57:04 -0000 1.14 *************** *** 60,63 **** --- 60,64 ---- void addTableRawSummary (); void addTableRawSummaryData (); + void pp_mysql_convert_sql_failure(char*f,int l, const char*str, const char *error); *************** *** 121,124 **** --- 122,133 ---- int iNDBport; + + MYSQL db_mysql_old; + MYSQL_RES *query_result_old = NULL; + MYSQL_ROW result_row_old; + MYSQL db_mysql_new; + MYSQL_RES *query_result_new = NULL; + MYSQL_ROW result_row_new; + printf(_("The database schema for perfparse changed dramatically. ")); printf(_("Changing the tables\nwould be too error-prone, so we decided to copy the data into a new database.\n")); *************** *** 189,194 **** --- 198,258 ---- } + // new database connection + if(yesno == 'n') { // copy connection information + sNDBhost=config_get_value_as_string(CONFIG_ITEM_ID_DB_HOST); + sNDBuser=config_get_value_as_string(CONFIG_ITEM_ID_DB_USER); + sNDBpass=config_get_value_as_string(CONFIG_ITEM_ID_DB_PWD); + sNDBdatabase=config_get_value_as_string(CONFIG_ITEM_ID_DB_DATABASE); + iNDBport=config_get_value_as_integer(CONFIG_ITEM_ID_DB_PORT); + sNDBsocket=config_get_value_as_string(CONFIG_ITEM_ID_DB_SOCKET); + } else { //ask user + printf(_("Please enter the connection data for the new database below:\n")); + + sNDBhost=malloc(65); + printf(_("Database Host: ")); + fscanf(stdin,"%s64",sNDBhost); + + sNDBuser=malloc(65); + printf(_("Database User: ")); + fscanf(stdin,"%s64",sNDBuser); + + sNDBpass=malloc(65); + printf(_("Database Password: ")); + fscanf(stdin,"%s64",sNDBpass); + + sNDBdatabase=malloc(65); + printf(_("Database Name: ")); + fscanf(stdin,"%s64",sNDBdatabase); + + printf(_("Database Port: ")); + fscanf(stdin,"%d",&iNDBport); + + sNDBsocket=malloc(65); + printf(_("Database Socket: ")); + fscanf(stdin,"%s64",sNDBsocket); + } + // connect to old databases + + if (!mysql_init (&db_mysql_old)) { + printf(_("Cannot initialise MySQL\n")); + exit(EXIT_FAILURE); + } + if (!mysql_real_connect(&db_mysql_old, + sODBhost,sODBuser,sODBpass,sODBdatabase, + iODBport,sODBsocket,0)) { + printf(_("Cannot connect to old database. Errormessage: %s")); + exit(EXIT_FAILURE); + } + + if (!mysql_real_connect(&db_mysql_new, + sNDBhost,sNDBuser,sNDBpass,sNDBdatabase, + iNDBport,sNDBsocket,0)) { + printf(_("Cannot connect to new database. Errormessage: %s")); + exit(EXIT_FAILURE); + } + + /* int i_steps=20; *************** *** 341,344 **** --- 405,412 ---- } + void pp_mysql_convert_sql_failure(char*f,int l, const char*str, const char *error) { + printf(f,l,"%s (%s)",str,error); + exit(EXIT_FAILURE); + } void setConversionStep(int i) { |
From: Cedric T. <ced...@us...> - 2007-03-05 11:00:03
|
Update of /cvsroot/perfparse/_perfparse-phpgui/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32145/phpgui/lang Added Files: fr.php Log Message: French translation. --- NEW FILE: fr.php --- <?php $language = array( ); ?> |
From: Cedric T. <ced...@us...> - 2007-03-05 10:59:58
|
Update of /cvsroot/perfparse/_perfparse-phpgui/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32145/phpgui/templates Modified Files: edit_host_list.tpl.html edit_delete_policies.tpl.html all_raw.tpl.html all_bin.tpl.html read_nag_config.tpl.html Log Message: French translation. Index: all_raw.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/all_raw.tpl.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** all_raw.tpl.html 8 Apr 2006 23:59:47 -0000 1.7 --- all_raw.tpl.html 5 Mar 2007 10:59:46 -0000 1.8 *************** *** 104,108 **** <input type=checkbox name="normal" value="1" <{if $normal}>checked<{/if}>> <{tr}>Normal<{/tr}> <input type=checkbox name="warning" value="1" <{if $warning}>checked<{/if}>> <{tr}>Warning<{/tr}> ! <input type=checkbox name="critical" value="1" <{if $critical}>checked<{/if}>> <{tr}>Critial<{/tr}> <input type=checkbox name="unknown" value="1" <{if $unknown}>checked<{/if}>> <{tr}>Unknown<{/tr}> </td> </tr> --- 104,108 ---- <input type=checkbox name="normal" value="1" <{if $normal}>checked<{/if}>> <{tr}>Normal<{/tr}> <input type=checkbox name="warning" value="1" <{if $warning}>checked<{/if}>> <{tr}>Warning<{/tr}> ! <input type=checkbox name="critical" value="1" <{if $critical}>checked<{/if}>> <{tr}>Critical<{/tr}> <input type=checkbox name="unknown" value="1" <{if $unknown}>checked<{/if}>> <{tr}>Unknown<{/tr}> </td> </tr> Index: read_nag_config.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/read_nag_config.tpl.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** read_nag_config.tpl.html 21 Apr 2005 15:00:05 -0000 1.2 --- read_nag_config.tpl.html 5 Mar 2007 10:59:46 -0000 1.3 *************** *** 6,10 **** <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr> ! <td width="60"><img src="images/perfparse-logo-sm.png" border="0"></td> <td align="center"><font face="Arial, Helvetica" size="2"> <b><{tr}>Read Nagios Config<{/tr}></b><br> --- 6,10 ---- <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr> ! <td width="60"><img src="<{$http_image_path}>/perfparse-logo-sm.png" border="0"></td> <td align="center"><font face="Arial, Helvetica" size="2"> <b><{tr}>Read Nagios Config<{/tr}></b><br> Index: edit_host_list.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/edit_host_list.tpl.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** edit_host_list.tpl.html 2 Dec 2006 21:31:11 -0000 1.3 --- edit_host_list.tpl.html 5 Mar 2007 10:59:46 -0000 1.4 *************** *** 30,35 **** <font face="Arial, Helvetica" size=2> <{if $group_id}> ! <{tr}>Selected group: <{/tr}><{$groups.$group_id}><br /> ! <{tr}>Select another group: <{/tr}> <{/if}> <select name="group_id"> --- 30,35 ---- <font face="Arial, Helvetica" size=2> <{if $group_id}> ! <{tr}>Selected group<{/tr}>: <{$groups.$group_id}><br /> ! <{tr}>Select another group<{/tr}>: <{/if}> <select name="group_id"> *************** *** 54,58 **** <tr> <td align=center width="33%"><font face="Arial, Helvetica" size=2> ! Add new Host to Group: </td> <td> --- 54,58 ---- <tr> <td align=center width="33%"><font face="Arial, Helvetica" size=2> ! <{tr}>Add new Host to Group<{/tr}>: </td> <td> *************** *** 73,77 **** <tr> <td align=center><font face="Arial, Helvetica" size=2> ! <b>Host List</b><br> </td> </tr> --- 73,77 ---- <tr> <td align=center><font face="Arial, Helvetica" size=2> ! <b><{tr}>Host List<{/tr}></b><br> </td> </tr> *************** *** 79,84 **** <table width="100%" border=1 cellpadding=2 cellspacing=0> <tr bgcolor="#FFFFCC"> ! <td align=center><font face="Arial, Helvetica" size=2><b>Host Name</b></td> ! <td align=center width="1%"><font face="Arial, Helvetica" size=2><b>Remove</td> </tr> <{foreach from=$group_hosts item=hostinfo}> --- 79,84 ---- <table width="100%" border=1 cellpadding=2 cellspacing=0> <tr bgcolor="#FFFFCC"> ! <td align=center><font face="Arial, Helvetica" size=2><b><{tr}>Host Name<{/tr}></b></td> ! <td align=center width="1%"><font face="Arial, Helvetica" size=2><b><{tr}>Remove<{/tr}></td> </tr> <{foreach from=$group_hosts item=hostinfo}> Index: all_bin.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/all_bin.tpl.html,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** all_bin.tpl.html 22 Feb 2007 16:26:54 -0000 1.8 --- all_bin.tpl.html 5 Mar 2007 10:59:46 -0000 1.9 *************** *** 34,38 **** <{/foreach}> </select> ! <input type=submit value="Enter"> </td></form> </tr> --- 34,38 ---- <{/foreach}> </select> ! <input type=submit value="<{tr}>Enter<{/tr}>"> </td></form> </tr> *************** *** 94,98 **** <td bgcolor="#FFFFFF"><font face="Arial, Helvetica" size=2> <{$item.service_description}> </td> <td align="center" bgcolor="#FFFFFF"><font face="Arial, Helvetica" size="2"> ! <a href=perfparse.php?page=graph&graphs[<{$item.metric_id}>> <img src="<{$http_image_path}>perfgraph-sm.png" border=0></a> </td> --- 94,98 ---- <td bgcolor="#FFFFFF"><font face="Arial, Helvetica" size=2> <{$item.service_description}> </td> <td align="center" bgcolor="#FFFFFF"><font face="Arial, Helvetica" size="2"> ! <a href=perfparse.php?page=graph&graphs[<{$item.metric_id}>]> <img src="<{$http_image_path}>perfgraph-sm.png" border=0></a> </td> Index: edit_delete_policies.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/edit_delete_policies.tpl.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** edit_delete_policies.tpl.html 29 Dec 2006 23:19:25 -0000 1.3 --- edit_delete_policies.tpl.html 5 Mar 2007 10:59:46 -0000 1.4 *************** *** 121,125 **** <td><font face="Arial, Helvetica" size=2><{$policy.policy_name}></td> <td><font face="Arial, Helvetica" size=2><{$policy.policy_comment}></td> ! <td><font face="Arial, Helvetica" size=2><{$policy.delete_policy_seconds|difftime}></td> <td align=center><font face="Arial, Helvetica" size=2> <a href="perfparse.php?page=edit_delete_policies&delete_policy=<{$policy.policy_id}>"><{tr}>Remove<{/tr}></a> --- 121,125 ---- <td><font face="Arial, Helvetica" size=2><{$policy.policy_name}></td> <td><font face="Arial, Helvetica" size=2><{$policy.policy_comment}></td> ! <td><font face="Arial, Helvetica" size=2><{$policy.delete_policy_seconds}></td> <td align=center><font face="Arial, Helvetica" size=2> <a href="perfparse.php?page=edit_delete_policies&delete_policy=<{$policy.policy_id}>"><{tr}>Remove<{/tr}></a> |
From: Cedric T. <ced...@us...> - 2007-03-05 10:59:58
|
Update of /cvsroot/perfparse/_perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32145 Modified Files: ChangeLog Added Files: .project Log Message: French translation. --- NEW FILE: .project --- <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>perfparse-all</name> <comment></comment> <projects> </projects> <buildSpec> </buildSpec> <natures> </natures> </projectDescription> Index: ChangeLog =================================================================== RCS file: /cvsroot/perfparse/_perfparse/ChangeLog,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ChangeLog 23 Feb 2007 17:39:32 -0000 1.15 --- ChangeLog 5 Mar 2007 10:59:47 -0000 1.16 *************** *** 1,3 **** --- 1,5 ---- Version 0.106.2 + Image link corrected in "Read Nagios config" (Cedric Temple) + Add French translation (Cedric Temple) Correct link of "Edit delete policies" (Cedric Temple) Correct creation of table perfdata_delete_policy (MySQL) (Cedric Temple) |
From: Florian G. <re...@us...> - 2007-03-04 00:08:09
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10918/db_tools Modified Files: convert.c Log Message: work not finished Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** convert.c 1 Mar 2007 23:52:02 -0000 1.12 --- convert.c 4 Mar 2007 00:08:07 -0000 1.13 *************** *** 115,118 **** --- 115,124 ---- { char yesno; + + char *sODBhost,*sODBuser,*sODBpass,*sODBdatabase,*sODBsocket; + int iODBport; + char *sNDBhost,*sNDBuser,*sNDBpass,*sNDBdatabase,*sNDBsocket; + int iNDBport; + printf(_("The database schema for perfparse changed dramatically. ")); printf(_("Changing the tables\nwould be too error-prone, so we decided to copy the data into a new database.\n")); *************** *** 141,151 **** printf(_("Database TCP Port:\t%d\n"),config_get_value_as_integer(CONFIG_ITEM_ID_DB_PORT)); printf(_("Database Unix Socket:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_SOCKET)); ! printf(_("\n\nAre these values for the old or new database? (o/n)")); while((yesno=getchar())) { ! if(yesno == 'o' || yesno == 'n' ) break; } /* --- 147,193 ---- printf(_("Database TCP Port:\t%d\n"),config_get_value_as_integer(CONFIG_ITEM_ID_DB_PORT)); printf(_("Database Unix Socket:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_SOCKET)); ! printf(_("\n\nAre these values for the old or the new database? (o/n) or none of both (x)?")); while((yesno=getchar())) { ! if(yesno == 'o' || yesno == 'n' || yesno == 'x') break; } + // old database connection + if(yesno == 'o') { // copy connection information + sODBhost=config_get_value_as_string(CONFIG_ITEM_ID_DB_HOST); + sODBuser=config_get_value_as_string(CONFIG_ITEM_ID_DB_USER); + sODBpass=config_get_value_as_string(CONFIG_ITEM_ID_DB_PWD); + sODBdatabase=config_get_value_as_string(CONFIG_ITEM_ID_DB_DATABASE); + iODBport=config_get_value_as_integer(CONFIG_ITEM_ID_DB_PORT); + sODBsocket=config_get_value_as_string(CONFIG_ITEM_ID_DB_SOCKET); + } else { //ask user + printf(_("Please enter the connection data for the old database below:\n")); + + sODBhost=malloc(65); + printf(_("Database Host: ")); + fscanf(stdin,"%s64",sODBhost); + + sODBuser=malloc(65); + printf(_("Database User: ")); + fscanf(stdin,"%s64",sODBuser); + + sODBpass=malloc(65); + printf(_("Database Password: ")); + fscanf(stdin,"%s64",sODBpass); + + sODBdatabase=malloc(65); + printf(_("Database Name: ")); + fscanf(stdin,"%s64",sODBdatabase); + + printf(_("Database Port: ")); + fscanf(stdin,"%d",&iODBport); + + sODBsocket=malloc(65); + printf(_("Database Socket: ")); + fscanf(stdin,"%s64",sODBsocket); + } + + /* *************** *** 286,294 **** // checkTables (); - /* - * Set to current: - */ - version = DB_VERSION; - setVersion (version); /* --- 328,331 ---- |
From: Florian G. <re...@us...> - 2007-03-01 23:52:04
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13565/phpgui Modified Files: Makefile.in Log Message: start rework database upgrade Index: Makefile.in =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/Makefile.in,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.in 17 Dec 2006 22:11:55 -0000 1.8 --- Makefile.in 1 Mar 2007 23:52:02 -0000 1.9 *************** *** 128,131 **** --- 128,132 ---- GMSGFMT = @GMSGFMT@ GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ *************** *** 191,200 **** ZLIB_CFLAGS = @ZLIB_CFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ - ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ - ac_ct_RANLIB = @ac_ct_RANLIB@ - ac_ct_STRIP = @ac_ct_STRIP@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ --- 192,198 ---- *************** *** 215,218 **** --- 213,219 ---- cgidir = @cgidir@ datadir = @datadir@ + datarootdir = @datarootdir@ + docdir = @docdir@ + dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ *************** *** 221,224 **** --- 222,226 ---- host_os = @host_os@ host_vendor = @host_vendor@ + htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ *************** *** 226,236 **** --- 228,241 ---- libdir = @libdir@ libexecdir = @libexecdir@ + localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ + pdfdir = @pdfdir@ phpuidir = ${INST_PHPUI_PATH} prefix = @prefix@ program_transform_name = @program_transform_name@ + psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ *************** *** 249,252 **** --- 254,258 ---- perfparse.php \ smarty_extensions/block.tr.php \ + smarty_extensions/modifier.difftime.php \ templates/flo/add_amend_host_group.tpl.html \ templates/flo/all_bin.tpl.html \ |
From: Florian G. <re...@us...> - 2007-03-01 23:52:04
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13565/db_tools Modified Files: convert.c Log Message: start rework database upgrade Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** convert.c 12 Dec 2006 23:44:18 -0000 1.11 --- convert.c 1 Mar 2007 23:52:02 -0000 1.12 *************** *** 3,7 **** * convert.c - Automatic conversion of database for new versions. * ! * Copyright (c) 2004 Ben Clewett (per...@cl...) * $Id$ * --- 3,8 ---- * convert.c - Automatic conversion of database for new versions. * ! * Copyright (c) 2004-2007 Ben Clewett (per...@cl...), ! * Florian Gleixner * $Id$ * *************** *** 83,87 **** DB_VERSION_CHAR); printf (_("Starting...\n\n")); - sleep (1); } else --- 84,87 ---- *************** *** 105,144 **** version = getVersion (); ! if (version < 0.15) ! { ! printf (_("Warning, this stage may take some time:\n")); ! addField ("perfdata_service_raw", "nagios_status", ! "TINYINT DEFAULT NULL"); ! } ! ! if (version < 0.16) ! { ! addField ("perfdata_graphs", "refresh_time", ! "INT NOT NULL DEFAULT 0"); ! } ! ! if (version < 0.17) ! { ! /* ! * Add and populate the new ID fields: ! */ ! addIdFields (); ! } ! ! if (version < 0.18) { ! /* ! * Drop the old summary tables: ! */ ! query ("DROP TABLE IF EXISTS perfdata_summary"); ! query ("DROP TABLE IF EXISTS perfdata_summary_data"); ! /* ! * Also drop new ones, error in last version Ben :) ! */ ! query ("DROP TABLE IF EXISTS perfdata_bin_summary_data"); } if (version < 0.20) { int i_steps=20; int i=0; --- 105,153 ---- version = getVersion (); ! if (version < 0.19) { ! printf(_("Conversion from older database schemas not supported.\n")); ! printf(_("Please visit the perfparse project page to get a older version (0.106.1) of perfparse")); ! exit(1); } if (version < 0.20) { + char yesno; + printf(_("The database schema for perfparse changed dramatically. ")); + printf(_("Changing the tables\nwould be too error-prone, so we decided to copy the data into a new database.\n")); + printf(_("This step can take days for large databases. ")); + printf(_("You should have prepared a new\ndatabase for this conversion step. ")); + printf(_("This database should contain the v 0.20\ndatabase schema. ")); + printf(_("You should have enough disk space to duplicate your old\ndatabase. ")); + printf(_("To minimize downtime you can use the new schema with your new\nperfparse while old data are copied. ")); + printf(_("For more information visit\nhttp://perfparse.de/tiki-index.php?page=DatabaseUpgrade \n")); + printf(_("\nAre you sure to start the conversion (y/n)? ")); + while((yesno=getchar())) { + if(yesno == 'y') + break; + if(yesno == 'n') { + printf(_("\nBye.\n")); + exit(1); + } + } + + printf(_("\n\nIn the next step you will have to provide data of the old and the new database.\n")); + printf(_("With the commandline or in the configuration file you provided these data:\n")); + printf(_("Database Host:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_HOST)); + printf(_("Database User:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_USER)); + printf(_("Database Password:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_PWD)); + printf(_("Database Name:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_DATABASE)); + printf(_("Database TCP Port:\t%d\n"),config_get_value_as_integer(CONFIG_ITEM_ID_DB_PORT)); + printf(_("Database Unix Socket:\t%s\n"),config_get_value_as_string(CONFIG_ITEM_ID_DB_SOCKET)); + printf(_("\n\nAre these values for the old or new database? (o/n)")); + + while((yesno=getchar())) { + if(yesno == 'o' || yesno == 'n' ) + break; + } + + + /* int i_steps=20; int i=0; *************** *** 201,204 **** --- 210,214 ---- } + */ /* if(i_cont_step < i++) { *************** *** 221,225 **** } */ ! if(i_cont_step < i++) { printf(_("[Step %d/%d] Fixing keys of perfdata_host table pt. 3\n"),i,i_steps); --- 231,235 ---- } */ ! /* if(i_cont_step < i++) { printf(_("[Step %d/%d] Fixing keys of perfdata_host table pt. 3\n"),i,i_steps); *************** *** 263,266 **** --- 273,278 ---- setConversionStep(i); } + + */ } |
From: Cedric T. <ced...@us...> - 2007-02-23 17:39:34
|
Update of /cvsroot/perfparse/_perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22892 Modified Files: ChangeLog Log Message: Correct link of 'Edit delete policies' (Cedric Temple) Index: ChangeLog =================================================================== RCS file: /cvsroot/perfparse/_perfparse/ChangeLog,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ChangeLog 22 Feb 2007 16:26:54 -0000 1.14 --- ChangeLog 23 Feb 2007 17:39:32 -0000 1.15 *************** *** 1,3 **** --- 1,4 ---- Version 0.106.2 + Correct link of "Edit delete policies" (Cedric Temple) Correct creation of table perfdata_delete_policy (MySQL) (Cedric Temple) Correct bug in page "all_bin" when selected one graph (Cedric Temple) |
From: Cedric T. <ced...@us...> - 2007-02-22 16:27:06
|
Update of /cvsroot/perfparse/_perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22382/perfparse-all Modified Files: ChangeLog Log Message: Correct creation of table perfdata_delete_policy (MySQL) Index: ChangeLog =================================================================== RCS file: /cvsroot/perfparse/_perfparse/ChangeLog,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ChangeLog 29 Dec 2006 00:29:32 -0000 1.13 --- ChangeLog 22 Feb 2007 16:26:54 -0000 1.14 *************** *** 1,3 **** --- 1,5 ---- Version 0.106.2 + Correct creation of table perfdata_delete_policy (MySQL) (Cedric Temple) + Correct bug in page "all_bin" when selected one graph (Cedric Temple) Added comments to policies (FG) Changed database schema. Normalized some tables (FG) |
From: Cedric T. <ced...@us...> - 2007-02-22 16:27:03
|
Update of /cvsroot/perfparse/_perfparse/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22382/perfparse-all/scripts Modified Files: mysql_create.sql Log Message: Correct creation of table perfdata_delete_policy (MySQL) Index: mysql_create.sql =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/mysql_create.sql,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mysql_create.sql 28 Dec 2006 23:28:29 -0000 1.10 --- mysql_create.sql 22 Feb 2007 16:26:54 -0000 1.11 *************** *** 25,29 **** policy_name VARCHAR(20) NOT NULL UNIQUE, delete_policy_seconds INT DEFAULT NULL, ! policy_comment TEXT, ) TYPE=InnoDB; --- 25,29 ---- policy_name VARCHAR(20) NOT NULL UNIQUE, delete_policy_seconds INT DEFAULT NULL, ! policy_comment TEXT ) TYPE=InnoDB; |
From: Cedric T. <ced...@us...> - 2007-02-22 16:27:01
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22382/perfparse-all/phpgui Modified Files: utils.php Log Message: Correct creation of table perfdata_delete_policy (MySQL) Index: utils.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** utils.php 29 Dec 2006 23:19:24 -0000 1.33 --- utils.php 22 Feb 2007 16:26:54 -0000 1.34 *************** *** 312,316 **** // build query ! $query ='SELECT h.host_name,s.service_description,m.metric,b.ctime,value,m.unit,b.state from '; $query.='perfdata_service_metric m, perfdata_host h,perfdata_service_bin b, perfdata_service s '; // group_id==0 means all groups --- 312,316 ---- // build query ! $query ='SELECT h.host_name,s.service_description,m.metric,b.ctime,value,m.unit,b.state,b.metric_id from '; $query.='perfdata_service_metric m, perfdata_host h,perfdata_service_bin b, perfdata_service s '; // group_id==0 means all groups |
From: Cedric T. <ced...@us...> - 2007-02-22 16:27:00
|
Update of /cvsroot/perfparse/_perfparse-phpgui/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22382/perfparse-all/phpgui/templates Modified Files: all_bin.tpl.html Log Message: Correct creation of table perfdata_delete_policy (MySQL) Index: all_bin.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/all_bin.tpl.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** all_bin.tpl.html 10 Nov 2006 14:53:28 -0000 1.7 --- all_bin.tpl.html 22 Feb 2007 16:26:54 -0000 1.8 *************** *** 94,98 **** <td bgcolor="#FFFFFF"><font face="Arial, Helvetica" size=2> <{$item.service_description}> </td> <td align="center" bgcolor="#FFFFFF"><font face="Arial, Helvetica" size="2"> ! <a href=perfparse.php?page=graph&host_name=<{$item.host_name_url|escape:"url"}>&service=<{$item.service_description_url|escape:"url"}>&metric=<{$item.metric|escape:"url"}>> <img src="<{$http_image_path}>perfgraph-sm.png" border=0></a> </td> --- 94,98 ---- <td bgcolor="#FFFFFF"><font face="Arial, Helvetica" size=2> <{$item.service_description}> </td> <td align="center" bgcolor="#FFFFFF"><font face="Arial, Helvetica" size="2"> ! <a href=perfparse.php?page=graph&graphs[<{$item.metric_id}>> <img src="<{$http_image_path}>perfgraph-sm.png" border=0></a> </td> |
From: Florian G. <re...@us...> - 2006-12-29 23:19:26
|
Update of /cvsroot/perfparse/_perfparse-phpgui/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20553/templates Modified Files: edit_delete_policies.tpl.html Log Message: finalized edit delete policies dialog Index: edit_delete_policies.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/edit_delete_policies.tpl.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** edit_delete_policies.tpl.html 29 Dec 2006 00:27:07 -0000 1.2 --- edit_delete_policies.tpl.html 29 Dec 2006 23:19:25 -0000 1.3 *************** *** 5,8 **** --- 5,10 ---- PerfParse</TITLE> <BODY BGcolor="#EEFFFF" TEXT="#000000" LINK="#000000" VLINK="#000000" ALINK="#000000"> + + <!-- Header --> <p align=center> <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> *************** *** 18,21 **** --- 20,25 ---- </table> </td></tr></table></p> + + <!-- Error Window --> <{if $sql_error}> <p align=center> *************** *** 25,28 **** --- 29,34 ---- </p> <{/if}> + + <!-- Create policy --> <p align=center> <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> *************** *** 32,92 **** <input type=hidden name="page" value="edit_delete_policies"> <tr> ! <td align=center width="33%"><font face="Arial, Helvetica" size=2> ! <{tr}>Create a delete policy template<{/tr}>: </td> <td> <font face="Arial, Helvetica" size=2> ! <{tr}>Name<{/tr}>: <input type="text" name="create_policy" size="25" /><br /> ! <{tr}>Comment<{/tr}>: <input type="text" name="create_policy_comment" size="50" /><br /> ! <input type=submit value="<{tr}>Enter<{/tr}>"> </td><td> <font face="Arial, Helvetica" size=2> ! <{tr}>Days<{/tr}>: <input type="text" name="create_policy_days" size="4" value="0"/> ! <{tr}>Hours<{/tr}>: <input type="text" name="create_policy_hours" size="2" value="0"/> ! <{tr}>Minutes<{/tr}>: <input type="text" name="create_policy_minutes" size="2" value="0"/> ! <{tr}>Seconds<{/tr}>: <input type="text" name="create_policy_seconds" size="2" value="0"/> </td> </tr> - </form> - - <form method="get"> - <input type=hidden name="page" value="edit_delete_policies"> <tr> - <td align=center width="33%"><font face="Arial, Helvetica" size=2> - <{tr}>Delete a delete policy template<{/tr}>: - </td> <td> ! <font face="Arial, Helvetica" size=2> ! <select name="delete_policy"> ! <{foreach from=$policies item=policy}> ! <option value="<{$policy.policy_id}>"><{$policy.policy_name}></option> ! <{/foreach}> ! </select> ! <input type=submit value="<{tr}>Enter<{/tr}>"> </td> </tr> ! </form> ! ! <form method="get"> ! <input type=hidden name="page" value="edit_delete_policies"> ! <tr> ! <td align=center width="33%"><font face="Arial, Helvetica" size=2> ! <{tr}>Edit delete policy template<{/tr}>: ! </td> ! <td> ! <font face="Arial, Helvetica" size=2> ! <select name="edit_policy"> ! <{foreach from=$policies item=policy}> ! <option value="<{$policy.policy_id}>" ><{$policy.policy_name}></option> ! <{/foreach}> ! </select> ! <input type=submit value="<{tr}>Enter<{/tr}>"> </td> ! </tr> ! </form> ! </table> </td></tr></table></p> <{if $policies}> <p align=center> --- 38,103 ---- <input type=hidden name="page" value="edit_delete_policies"> <tr> ! <td align=center width="33%" colspan="6" ><font face="Arial, Helvetica" size=2> ! <{if $edit_policy}> ! <{tr}>Edit the delete policy template<{/tr}>: ! <input type="hidden" name="edit_policy" value="<{$edit_policy}>" /> ! <{else}> ! <{tr}>Create a delete policy template<{/tr}>: ! <{/if}> </td> + </tr> + <tr> <td> <font face="Arial, Helvetica" size=2> ! <{tr}>Name<{/tr}>: ! </td><td> ! <font face="Arial, Helvetica" size=2> ! <input type="text" name="create_policy" size="25" <{if $edit_policy}>value="<{$epolicy.policy_name}>"<{/if}>/> </td><td> <font face="Arial, Helvetica" size=2> ! <{tr}>Days<{/tr}>: ! </td><td> ! <font face="Arial, Helvetica" size=2> ! <input type="text" name="create_policy_days" size="4" value="<{if $edit_policy}><{$epolicy.policy_days}><{else}>0<{/if}>"/> ! </td><td> ! <font face="Arial, Helvetica" size=2> ! <{tr}>Hours<{/tr}>: ! </td><td> ! <font face="Arial, Helvetica" size=2> ! <input type="text" name="create_policy_hours" size="2" value="<{if $edit_policy}><{$epolicy.policy_hours}><{else}>0<{/if}>"/> </td> </tr> <tr> <td> ! <font face="Arial, Helvetica" size=2> ! <{tr}>Comment<{/tr}>: ! </td><td> ! <font face="Arial, Helvetica" size=2> ! <input type="text" name="create_policy_comment" size="40" <{if $edit_policy}>value="<{$epolicy.policy_comment}>"<{/if}>/> ! </td><td> ! <font face="Arial, Helvetica" size=2> ! <{tr}>Minutes<{/tr}>: ! </td><td> ! <font face="Arial, Helvetica" size=2> ! <input type="text" name="create_policy_minutes" size="2" value="<{if $edit_policy}><{$epolicy.policy_minutes}><{else}>0<{/if}>"/> ! </td><td> ! <font face="Arial, Helvetica" size=2> ! <{tr}>Seconds<{/tr}>: ! </td><td> ! <font face="Arial, Helvetica" size=2> ! <input type="text" name="create_policy_seconds" size="2" value="<{if $edit_policy}><{$epolicy.policy_seconds}><{else}>0<{/if}>"/> </td> </tr> ! <td align=center width="33%" colspan="6"> <input type=submit value="<{tr}>Enter<{/tr}>"> </td> ! </tr> ! ! </form> ! </table> ! </td></tr></table></p> + <!-- policies list --> <{if $policies}> <p align=center> *************** *** 104,109 **** <td align=center><font face="Arial, Helvetica" size=2><b><{tr}>Comment<{/tr}></b></td> <td align=center><font face="Arial, Helvetica" size=2><b><{tr}>Value<{/tr}></b></td> ! <td align=center width="1%"><font face="Arial, Helvetica" size=2><b><{tr}>Remove<{/tr}></td> ! <td align=center width="1%"><font face="Arial, Helvetica" size=2><b><{tr}>Edit<{/tr}></td> </tr> <{foreach from=$policies item=policy}> --- 115,119 ---- <td align=center><font face="Arial, Helvetica" size=2><b><{tr}>Comment<{/tr}></b></td> <td align=center><font face="Arial, Helvetica" size=2><b><{tr}>Value<{/tr}></b></td> ! <td align=center width="1%"><font face="Arial, Helvetica" size=2><b><{tr}>Actions<{/tr}></td> </tr> <{foreach from=$policies item=policy}> *************** *** 112,118 **** <td><font face="Arial, Helvetica" size=2><{$policy.policy_comment}></td> <td><font face="Arial, Helvetica" size=2><{$policy.delete_policy_seconds|difftime}></td> ! <td align=center><font face="Arial, Helvetica" size=2><a href="perfparse.php?page=edit_delete_policies&delete_policy=<{$policy.policy_id}>"><{tr}>Remove<{/tr}></a> ! <td align=center><font face="Arial, Helvetica" size=2><a href="perfparse.php?page=edit_delete_policies&edit_policy=<{$policy.policy_id}>"><{tr}>Edit<{/tr}></a> ! </td> </tr> <{/foreach}> --- 122,129 ---- <td><font face="Arial, Helvetica" size=2><{$policy.policy_comment}></td> <td><font face="Arial, Helvetica" size=2><{$policy.delete_policy_seconds|difftime}></td> ! <td align=center><font face="Arial, Helvetica" size=2> ! <a href="perfparse.php?page=edit_delete_policies&delete_policy=<{$policy.policy_id}>"><{tr}>Remove<{/tr}></a> ! <a href="perfparse.php?page=edit_delete_policies&edit_policy=<{$policy.policy_id}>"><{tr}>Edit<{/tr}></a> ! </td> </tr> <{/foreach}> |
From: Florian G. <re...@us...> - 2006-12-29 23:19:26
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20553 Modified Files: perfparse.php utils.php Log Message: finalized edit delete policies dialog Index: utils.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** utils.php 29 Dec 2006 00:27:06 -0000 1.32 --- utils.php 29 Dec 2006 23:19:24 -0000 1.33 *************** *** 499,502 **** --- 499,510 ---- } + function get_delete_policy(&$db,$id) { + $query='select policy_id,policy_name,delete_policy_seconds,policy_comment + from perfdata_delete_policy where policy_id=?'; + $res=$db->GetRow($query,array($id)); + return($res); + } + + function create_delete_policy(&$db,$policy,$seconds,$comment='') { $query='insert into perfdata_delete_policy *************** *** 506,509 **** --- 514,525 ---- } + function edit_delete_policy(&$db,$id,$policy,$seconds,$comment='') { + $query='update perfdata_delete_policy set + policy_name=?, policy_comment=?, delete_policy_seconds=? + where policy_id=?'; + $db->Execute($query,array($policy,$comment,$seconds,$id)); + return($db->ErrorNo()); + } + function delete_delete_policy(&$db,$policy_id) { $query='delete from perfdata_delete_policy where policy_id=?'; Index: perfparse.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/perfparse.php,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** perfparse.php 29 Dec 2006 00:27:06 -0000 1.44 --- perfparse.php 29 Dec 2006 23:19:24 -0000 1.45 *************** *** 490,496 **** break; case 'edit_delete_policies': ! // handle create policy template: get_request_var('create_policy','string',''); ! if(!empty($create_policy)) { get_request_var('create_policy_comment','string',''); get_request_var('create_policy_days','int',0); --- 490,509 ---- break; case 'edit_delete_policies': ! // handle create or edit policy template: ! get_request_var('edit_policy','int',false); get_request_var('create_policy','string',''); ! if(empty($create_policy) && $edit_policy != false) { ! $epolicy=get_delete_policy($db,$edit_policy); ! $s=$epolicy['delete_policy_seconds']; ! $epolicy['policy_seconds']=$s%60; ! $s=floor($s/60); ! $epolicy['policy_minutes']=$s%60; ! $s=floor($s/60); ! $epolicy['policy_hours']=$s%24; ! $epolicy['policy_days']=floor($s/24); ! $smarty->assign_by_ref('epolicy',$epolicy); ! // echo "epolicy:<pre>";print_r($epolicy);echo "</pre>"; ! $smarty->assign('edit_policy',$edit_policy); ! } elseif(!empty($create_policy)) { get_request_var('create_policy_comment','string',''); get_request_var('create_policy_days','int',0); *************** *** 502,507 **** 3600*$create_policy_hours+ 86400*$create_policy_days; ! if(create_delete_policy($db,$create_policy,$create_policy_seconds,$create_policy_comment)!=0) { ! $smarty->assign('sql_error',$db->ErrorMsg()); } } --- 515,528 ---- 3600*$create_policy_hours+ 86400*$create_policy_days; ! if($edit_policy != false) { ! // policy was edited ! if(edit_delete_policy($db,$edit_policy,$create_policy,$create_policy_seconds,$create_policy_comment)!=0) { ! $smarty->assign('sql_error',$db->ErrorMsg()); ! } ! } else { ! // policy was created ! if(create_delete_policy($db,$create_policy,$create_policy_seconds,$create_policy_comment)!=0) { ! $smarty->assign('sql_error',$db->ErrorMsg()); ! } } } *************** *** 515,518 **** --- 536,540 ---- } + // load infos for display $policies=get_delete_policies($db); |
From: Florian G. <re...@us...> - 2006-12-29 00:29:33
|
Update of /cvsroot/perfparse/_perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28991 Modified Files: ChangeLog Log Message: added comments Index: ChangeLog =================================================================== RCS file: /cvsroot/perfparse/_perfparse/ChangeLog,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ChangeLog 14 Sep 2006 21:05:16 -0000 1.12 --- ChangeLog 29 Dec 2006 00:29:32 -0000 1.13 *************** *** 1,3 **** --- 1,4 ---- Version 0.106.2 + Added comments to policies (FG) Changed database schema. Normalized some tables (FG) Added option to set port and/or socket for database connection (FG) |
From: Florian G. <re...@us...> - 2006-12-29 00:27:09
|
Update of /cvsroot/perfparse/_perfparse-phpgui/smarty_extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27891/smarty_extensions Added Files: modifier.difftime.php Log Message: more work on policy management. Added comments to policies. --- NEW FILE: modifier.difftime.php --- <?php /* * Smarty Plugin * $Id: modifier.difftime.php,v 1.1 2006/12/29 00:27:07 redflo Exp $ */ function smarty_modifier_difftime($seconds) { $seconds=(int) $seconds; if($seconds == 0) { return "deleted immediately"; } $o_sec=$seconds % 60; $seconds=floor($seconds/60); // $seconds are now minutes $o_min=$seconds % 60; $seconds=floor($seconds/60); // $seconds are now hours $o_h=$seconds % 24; $seconds=floor($seconds/24); // $seconds are now days if($seconds > 365) { $o_y=floor($seconds / 365); $seconds=$seconds-($o_y*365); } else { $o_y=0; } if($seconds > 30) { $o_mon=floor($seconds / 30); $seconds=$seconds-($o_mon*30); } else { $o_mon=0; } if($seconds > 7 && $o_mon == 0 && $o_y == 0) { $o_week=floor($seconds / 7); $seconds=$seconds-($o_week*7); } else { $o_week=0; } $o_days=$seconds; $output=''; // debug // $output="o_y=$o_y o_mon=$o_mon o_week=$o_week o_days=$o_days o_h=$o_h o_min=$o_min o_sec=$o_sec result: "; $o_y=($o_y==0)?'':"$o_y a "; $o_mon=($o_mon==0)?'':"$o_mon months "; $o_week=($o_week==0)?'':"$o_week weeks "; $o_days=($o_days==0)?'':"$o_days d "; $output=$output.$o_y.$o_mon.$o_week.$o_days; if($o_h != 0 || $o_min != 0 || $o_sec !=0) { $output=$output.sprintf("%02d:%02d:%02d",$o_h,$o_min,$o_sec); } return $output; } |
From: Florian G. <re...@us...> - 2006-12-29 00:27:09
|
Update of /cvsroot/perfparse/_perfparse-phpgui/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27891/templates Modified Files: edit_delete_policies.tpl.html Log Message: more work on policy management. Added comments to policies. Index: edit_delete_policies.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/edit_delete_policies.tpl.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** edit_delete_policies.tpl.html 2 Dec 2006 21:32:47 -0000 1.1 --- edit_delete_policies.tpl.html 29 Dec 2006 00:27:07 -0000 1.2 *************** *** 1,3 **** --- 1,4 ---- <HTML> + <!-- $Id$ --> <HEAD> <TITLE> *************** *** 37,40 **** --- 38,42 ---- <font face="Arial, Helvetica" size=2> <{tr}>Name<{/tr}>: <input type="text" name="create_policy" size="25" /><br /> + <{tr}>Comment<{/tr}>: <input type="text" name="create_policy_comment" size="50" /><br /> <input type=submit value="<{tr}>Enter<{/tr}>"> </td><td> *************** *** 74,84 **** <td> <font face="Arial, Helvetica" size=2> ! <{if $group_id}> ! <{tr}>Selected group: <{/tr}><{$groups.$group_id}><br /> ! <{tr}>Select another group: <{/tr}> ! <{/if}> ! <select name="group_id"> ! <{foreach from=$groups key=groupId item=group_name}> ! <option value="<{$groupId}>" <{if $groupId == $group_id}>selected="selected"<{/if}>><{$group_name}></option> <{/foreach}> </select> --- 76,82 ---- <td> <font face="Arial, Helvetica" size=2> ! <select name="edit_policy"> ! <{foreach from=$policies item=policy}> ! <option value="<{$policy.policy_id}>" ><{$policy.policy_name}></option> <{/foreach}> </select> *************** *** 90,117 **** </table> </td></tr></table></p> ! <{if $group_id}> ! <form method="get"> ! <input type=hidden name="page" value="edit_host_list"> ! <input type=hidden name="group_id" value="<{$group_id}>"> ! <input type=hidden name="action" value="add_host"> ! <p align=center> ! <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> ! <table width="100%" border=0 cellpadding=0 cellspacing=0> ! <tr> ! <td align=center width="33%"><font face="Arial, Helvetica" size=2> ! Add new Host to Group: ! </td> ! <td> ! <select name="host_id"> ! <{foreach from=$notin_group_hosts item=hostinfo}> ! <option value="<{$hostinfo.host_id}>"><{$hostinfo.host_name}></option> ! <{/foreach}> ! </select> ! <input type=submit value="<{tr}>Enter<{/tr}>"> ! </td> ! </tr> ! </table> ! </td></tr></table></p> ! </form> <p align=center> <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> --- 88,93 ---- </table> </td></tr></table></p> ! ! <{if $policies}> <p align=center> <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> *************** *** 119,123 **** <tr> <td align=center><font face="Arial, Helvetica" size=2> ! <b>Host List</b><br> </td> </tr> --- 95,99 ---- <tr> <td align=center><font face="Arial, Helvetica" size=2> ! <b><{tr}>Delete Policies List<{/tr}></b><br> </td> </tr> *************** *** 125,135 **** <table width="100%" border=1 cellpadding=2 cellspacing=0> <tr bgcolor="#FFFFCC"> ! <td align=center><font face="Arial, Helvetica" size=2><b>Host Name</b></td> ! <td align=center width="1%"><font face="Arial, Helvetica" size=2><b>Remove</td> </tr> ! <{foreach from=$group_hosts item=hostinfo}> <tr bgcolor="#FFFFFF"> ! <td><font face="Arial, Helvetica" size=2><{$hostinfo.host_name}></td> ! <td align=center><font face="Arial, Helvetica" size=2><a href="perfparse.php?page=edit_host_list&group_id=<{$group_id}>&action=remove_host&host_id=<{$hostinfo.host_id}>"><{tr}>Remove<{/tr}></a> </td> </tr> --- 101,117 ---- <table width="100%" border=1 cellpadding=2 cellspacing=0> <tr bgcolor="#FFFFCC"> ! <td align=center><font face="Arial, Helvetica" size=2><b><{tr}>Policy Name<{/tr}></b></td> ! <td align=center><font face="Arial, Helvetica" size=2><b><{tr}>Comment<{/tr}></b></td> ! <td align=center><font face="Arial, Helvetica" size=2><b><{tr}>Value<{/tr}></b></td> ! <td align=center width="1%"><font face="Arial, Helvetica" size=2><b><{tr}>Remove<{/tr}></td> ! <td align=center width="1%"><font face="Arial, Helvetica" size=2><b><{tr}>Edit<{/tr}></td> </tr> ! <{foreach from=$policies item=policy}> <tr bgcolor="#FFFFFF"> ! <td><font face="Arial, Helvetica" size=2><{$policy.policy_name}></td> ! <td><font face="Arial, Helvetica" size=2><{$policy.policy_comment}></td> ! <td><font face="Arial, Helvetica" size=2><{$policy.delete_policy_seconds|difftime}></td> ! <td align=center><font face="Arial, Helvetica" size=2><a href="perfparse.php?page=edit_delete_policies&delete_policy=<{$policy.policy_id}>"><{tr}>Remove<{/tr}></a> ! <td align=center><font face="Arial, Helvetica" size=2><a href="perfparse.php?page=edit_delete_policies&edit_policy=<{$policy.policy_id}>"><{tr}>Edit<{/tr}></a> </td> </tr> |
From: Florian G. <re...@us...> - 2006-12-29 00:27:08
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27891 Modified Files: Makefile.am perfparse.php utils.php Log Message: more work on policy management. Added comments to policies. Index: utils.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** utils.php 2 Dec 2006 21:31:11 -0000 1.31 --- utils.php 29 Dec 2006 00:27:06 -0000 1.32 *************** *** 493,497 **** function get_delete_policies(&$db) { ! $query='select policy_id,policy_name,delete_policy_seconds from perfdata_delete_policy'; $res=$db->GetAll($query); --- 493,497 ---- function get_delete_policies(&$db) { ! $query='select policy_id,policy_name,delete_policy_seconds,policy_comment from perfdata_delete_policy'; $res=$db->GetAll($query); *************** *** 499,506 **** } ! function create_delete_policy(&$db,$policy,$seconds) { $query='insert into perfdata_delete_policy ! (policy_name,delete_policy_seconds) values (?,?)'; ! $db->Execute($query,array($policy,$seconds)); return($db->ErrorNo()); } --- 499,506 ---- } ! function create_delete_policy(&$db,$policy,$seconds,$comment='') { $query='insert into perfdata_delete_policy ! (policy_name,policy_comment,delete_policy_seconds) values (?,?,?)'; ! $db->Execute($query,array($policy,$comment,$seconds)); return($db->ErrorNo()); } Index: Makefile.am =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.am 17 Dec 2006 22:11:55 -0000 1.4 --- Makefile.am 29 Dec 2006 00:27:06 -0000 1.5 *************** *** 8,11 **** --- 8,12 ---- perfparse.php \ smarty_extensions/block.tr.php \ + smarty_extensions/modifier.difftime.php \ templates/flo/add_amend_host_group.tpl.html \ templates/flo/all_bin.tpl.html \ Index: perfparse.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/perfparse.php,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** perfparse.php 2 Dec 2006 21:31:11 -0000 1.43 --- perfparse.php 29 Dec 2006 00:27:06 -0000 1.44 *************** *** 493,496 **** --- 493,497 ---- get_request_var('create_policy','string',''); if(!empty($create_policy)) { + get_request_var('create_policy_comment','string',''); get_request_var('create_policy_days','int',0); get_request_var('create_policy_hours','int',0); *************** *** 501,505 **** 3600*$create_policy_hours+ 86400*$create_policy_days; ! if(create_delete_policy($db,$create_policy,$create_policy_seconds)!=0) { $smarty->assign('sql_error',$db->ErrorMsg()); } --- 502,506 ---- 3600*$create_policy_hours+ 86400*$create_policy_days; ! if(create_delete_policy($db,$create_policy,$create_policy_seconds,$create_policy_comment)!=0) { $smarty->assign('sql_error',$db->ErrorMsg()); } *************** *** 516,519 **** --- 517,521 ---- // load infos for display $policies=get_delete_policies($db); + // echo "<pre>";print_r($policies);echo "</pre>"; $smarty->assign_by_ref('policies',$policies); |
From: Florian G. <re...@us...> - 2006-12-28 23:28:34
|
Update of /cvsroot/perfparse/_perfparse/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5790 Modified Files: mysql_create.sql Log Message: added comment to policies Index: mysql_create.sql =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/mysql_create.sql,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mysql_create.sql 12 Dec 2006 23:44:18 -0000 1.9 --- mysql_create.sql 28 Dec 2006 23:28:29 -0000 1.10 *************** *** 24,28 **** policy_id INT AUTO_INCREMENT PRIMARY KEY, policy_name VARCHAR(20) NOT NULL UNIQUE, ! delete_policy_seconds INT DEFAULT NULL ) TYPE=InnoDB; --- 24,29 ---- policy_id INT AUTO_INCREMENT PRIMARY KEY, policy_name VARCHAR(20) NOT NULL UNIQUE, ! delete_policy_seconds INT DEFAULT NULL, ! policy_comment TEXT, ) TYPE=InnoDB; |