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-04-27 21:25:46
|
Update of /cvsroot/perfparse/_perfparse/cgi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16308/cgi Modified Files: perfgant.c Log Message: fix more compiler warnings Index: perfgant.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/cgi/perfgant.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** perfgant.c 27 Apr 2007 21:20:06 -0000 1.3 --- perfgant.c 27 Apr 2007 21:25:45 -0000 1.4 *************** *** 158,162 **** double d; int i; ! unsigned char s[20]; struct tm *r; time_t t; --- 158,162 ---- double d; int i; ! char s[20]; struct tm *r; time_t t; *************** *** 170,175 **** gdImageLine(gant, (int)d, iBorder, (int)d, iHeight - iBorder, grey2); sprintf(s, "%02d:00", i); ! gdImageString(gant, gdFontSmall, (int)d - 15, iBorder - 13, s, black); ! gdImageString(gant, gdFontSmall, (int)d - 15, iHeight - 30, s, black); } else { gdImageLine(gant, (int)d, iBorder, (int)d, iHeight - iBorder, grey1); --- 170,175 ---- gdImageLine(gant, (int)d, iBorder, (int)d, iHeight - iBorder, grey2); sprintf(s, "%02d:00", i); ! gdImageString(gant, gdFontSmall, (int)d - 15, iBorder - 13,(unsigned char*) s, black); ! gdImageString(gant, gdFontSmall, (int)d - 15, iHeight - 30,(unsigned char*) s, black); } else { gdImageLine(gant, (int)d, iBorder, (int)d, iHeight - iBorder, grey1); *************** *** 183,187 **** // sprintf(s, "%04d-%02d-%02d", r->tm_year + 1900, r->tm_mon + 1, r->tm_mday); sprintf(s, "%02d-%02d", r->tm_mon + 1, r->tm_mday); ! gdImageString(gant, gdFontSmall, 8, i * (iRowHeight + iRowGap) + iBorder + 12, s, black); switch (r->tm_wday) { case 0: strncpy(s, _("Sun"),4); break; --- 183,187 ---- // sprintf(s, "%04d-%02d-%02d", r->tm_year + 1900, r->tm_mon + 1, r->tm_mday); sprintf(s, "%02d-%02d", r->tm_mon + 1, r->tm_mday); ! gdImageString(gant, gdFontSmall, 8, i * (iRowHeight + iRowGap) + iBorder + 12,(unsigned char*) s, black); switch (r->tm_wday) { case 0: strncpy(s, _("Sun"),4); break; *************** *** 193,197 **** case 6: strncpy(s, _("Sat"),4); break; } ! gdImageString(gant, gdFontSmall, iWidth - iSideBorder + 15, i * (iRowHeight + iRowGap) + iBorder + 12, s, black); } --- 193,197 ---- case 6: strncpy(s, _("Sat"),4); break; } ! gdImageString(gant, gdFontSmall, iWidth - iSideBorder + 15, i * (iRowHeight + iRowGap) + iBorder + 12,(unsigned char*) s, black); } *************** *** 394,398 **** gdImageFilledRectangle(gant, x, 4, x + 20, 13, iStateColour[i]); gdImageRectangle(gant, x, 4, x + 20, 13, black); ! gdImageString(gant, gdFontSmall, x + 25, 1, sStates[i], black); } --- 394,398 ---- gdImageFilledRectangle(gant, x, 4, x + 20, 13, iStateColour[i]); gdImageRectangle(gant, x, 4, x + 20, 13, black); ! gdImageString(gant, gdFontSmall, x + 25, 1,(unsigned char*) sStates[i], black); } *************** *** 451,455 **** gdImageString(gant, gdFontSmall, 10, 10, (unsigned char*)_("Error:"), black); ! gdImageString(gant, gdFontSmall, 10, 20, sMsg, black); /* Splurge */ --- 451,455 ---- gdImageString(gant, gdFontSmall, 10, 10, (unsigned char*)_("Error:"), black); ! gdImageString(gant, gdFontSmall, 10, 20, (unsigned char*) sMsg, black); /* Splurge */ *************** *** 558,565 **** gdImageString(gant, gdFontSmall, 10, 10, (unsigned char*)_("SQL:"), black); ! gdImageString(gant, gdFontSmall, 10, 20, tmpSQL, black); gdImageString(gant, gdFontSmall, 10, 40, (unsigned char*)_("Error:"), black); ! gdImageString(gant, gdFontSmall, 10, 50, tmpError, black); g_free(tmpSQL); --- 558,565 ---- gdImageString(gant, gdFontSmall, 10, 10, (unsigned char*)_("SQL:"), black); ! gdImageString(gant, gdFontSmall, 10, 20, (unsigned char*) tmpSQL, black); gdImageString(gant, gdFontSmall, 10, 40, (unsigned char*)_("Error:"), black); ! gdImageString(gant, gdFontSmall, 10, 50, (unsigned char*) tmpError, black); g_free(tmpSQL); |
From: Florian G. <re...@us...> - 2007-04-27 21:20:10
|
Update of /cvsroot/perfparse/_perfparse/cgi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13965/cgi Modified Files: perfchart.c perfgant.c Log Message: fix compiler warnings Index: perfgant.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/cgi/perfgant.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** perfgant.c 20 Dec 2006 22:57:45 -0000 1.2 --- perfgant.c 27 Apr 2007 21:20:06 -0000 1.3 *************** *** 158,162 **** double d; int i; ! char s[20]; struct tm *r; time_t t; --- 158,162 ---- double d; int i; ! unsigned char s[20]; struct tm *r; time_t t; *************** *** 573,577 **** } - - - --- 573,574 ---- Index: perfchart.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/cgi/perfchart.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** perfchart.c 20 Dec 2006 22:57:45 -0000 1.8 --- perfchart.c 27 Apr 2007 21:20:06 -0000 1.9 *************** *** 596,600 **** /* Key */ if (bVal) { ! gdImageString(graph, gdFontSmall, i, yTop + 2, "Value", black); gdImageLine(graph, i + 40, yTop + 8, i + 60, yTop + 8, black); gdImageLine(graph, i + 40, yTop + 9, i + 60, yTop + 9, black); --- 596,600 ---- /* Key */ if (bVal) { ! gdImageString(graph, gdFontSmall, i, yTop + 2,(unsigned char *) "Value", black); gdImageLine(graph, i + 40, yTop + 8, i + 60, yTop + 8, black); gdImageLine(graph, i + 40, yTop + 9, i + 60, yTop + 9, black); *************** *** 602,606 **** } if (bSmooth) { ! gdImageString(graph, gdFontSmall, i, yTop + 2, "Smooth", black); gdImageLine(graph, i + 40, yTop + 8, i + 60, yTop + 8, blue); gdImageLine(graph, i + 40, yTop + 9, i + 60, yTop + 9, blue); --- 602,606 ---- } if (bSmooth) { ! gdImageString(graph, gdFontSmall, i, yTop + 2,(unsigned char *) "Smooth", black); gdImageLine(graph, i + 40, yTop + 8, i + 60, yTop + 8, blue); gdImageLine(graph, i + 40, yTop + 9, i + 60, yTop + 9, blue); *************** *** 608,612 **** } if (bStanDev) { ! gdImageString(graph, gdFontSmall, i, yTop + 2, "S.Dev", black); gdImageLine(graph, i + 40, yTop + 8, i + 60, yTop + 8, lblue); gdImageLine(graph, i + 40, yTop + 9, i + 60, yTop + 9, lblue); --- 608,612 ---- } if (bStanDev) { ! gdImageString(graph, gdFontSmall, i, yTop + 2,(unsigned char *) "S.Dev", black); gdImageLine(graph, i + 40, yTop + 8, i + 60, yTop + 8, lblue); gdImageLine(graph, i + 40, yTop + 9, i + 60, yTop + 9, lblue); *************** *** 614,618 **** } if (bWarn) { ! gdImageString(graph, gdFontSmall, i, yTop + 2, "Warn", black); gdImageLine(graph, i + 40, yTop + 8, i + 60, yTop + 8, yellow); gdImageLine(graph, i + 40, yTop + 9, i + 60, yTop + 9, yellow); --- 614,618 ---- } if (bWarn) { ! gdImageString(graph, gdFontSmall, i, yTop + 2,(unsigned char *) "Warn", black); gdImageLine(graph, i + 40, yTop + 8, i + 60, yTop + 8, yellow); gdImageLine(graph, i + 40, yTop + 9, i + 60, yTop + 9, yellow); *************** *** 620,624 **** } if (bCrit) { ! gdImageString(graph, gdFontSmall, i, yTop + 2, "Crit", black); gdImageLine(graph, i + 40, yTop + 8, i + 60, yTop + 8, red); gdImageLine(graph, i + 40, yTop + 9, i + 60, yTop + 9, red); --- 620,624 ---- } if (bCrit) { ! gdImageString(graph, gdFontSmall, i, yTop + 2,(unsigned char *) "Crit", black); gdImageLine(graph, i + 40, yTop + 8, i + 60, yTop + 8, red); gdImageLine(graph, i + 40, yTop + 9, i + 60, yTop + 9, red); *************** *** 630,634 **** /* Version */ sprintf(sLabel, "v%s", VERSION); ! gdImageString(graph, gdFontSmall, 5, iHeight - 14, sLabel, black); /* Unit */ --- 630,634 ---- /* Version */ sprintf(sLabel, "v%s", VERSION); ! gdImageString(graph, gdFontSmall, 5, iHeight - 14,(unsigned char*) sLabel, black); /* Unit */ *************** *** 646,650 **** break; } ! gdImageString(graph, gdFontSmall, 5, iHeight - 28, sLabel, black); } --- 646,650 ---- break; } ! gdImageString(graph, gdFontSmall, 5, iHeight - 28,(unsigned char*) sLabel, black); } *************** *** 657,661 **** } iTitleLeft = iWidth / 2 - (int)((double)strlen(sTitle) * 3.5); ! gdImageString(graph, gdFontMediumBold, iTitleLeft, 6, sTitle, black); } --- 657,661 ---- } iTitleLeft = iWidth / 2 - (int)((double)strlen(sTitle) * 3.5); ! gdImageString(graph, gdFontMediumBold, iTitleLeft, 6,(unsigned char*) sTitle, black); } *************** *** 1027,1031 **** sprintf(sLabel, "%.0f%%", p * 100); ! gdImageString(graph, gdFontSmall, 5, y - 6, sLabel, black); } --- 1027,1031 ---- sprintf(sLabel, "%.0f%%", p * 100); ! gdImageString(graph, gdFontSmall, 5, y - 6,(unsigned char*) sLabel, black); } *************** *** 1097,1101 **** #endif ! gdImageString(graph, gdFontSmall, 5, y - 6, sLabel, black); i += iScaleYDelta0; --- 1097,1101 ---- #endif ! gdImageString(graph, gdFontSmall, 5, y - 6,(unsigned char*) sLabel, black); i += iScaleYDelta0; *************** *** 1119,1123 **** x = xTranslate(t); sprintf(sLabel, "%02ld", t / 3600); ! gdImageString(graph, gdFontSmall, x - 6, iHeight - iBotBorder + 2, sLabel, black); } --- 1119,1123 ---- x = xTranslate(t); sprintf(sLabel, "%02ld", t / 3600); ! gdImageString(graph, gdFontSmall, x - 6, iHeight - iBotBorder + 2,(unsigned char*) sLabel, black); } *************** *** 1155,1159 **** lt = localtime(&t); sprintf(sLabel, "%04d-%02d-%02d", lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday); ! gdImageString(graph, gdFontSmall, x - 30, iHeight - iBotBorder + 12, sLabel, black); } else { --- 1155,1159 ---- lt = localtime(&t); sprintf(sLabel, "%04d-%02d-%02d", lt->tm_year + 1900, lt->tm_mon + 1, lt->tm_mday); ! gdImageString(graph, gdFontSmall, x - 30, iHeight - iBotBorder + 12,(unsigned char*) sLabel, black); } else { *************** *** 1161,1167 **** lt = localtime(&t); sprintf(sLabel, "%04d-", lt->tm_year + 1900); ! gdImageString(graph, gdFontSmall, x - 13, iHeight - iBotBorder + 2, sLabel, black); sprintf(sLabel, "%02d-%02d", lt->tm_mon + 1, lt->tm_mday); ! gdImageString(graph, gdFontSmall, x - 13, iHeight - iBotBorder + 12, sLabel, black); } --- 1161,1167 ---- lt = localtime(&t); sprintf(sLabel, "%04d-", lt->tm_year + 1900); ! gdImageString(graph, gdFontSmall, x - 13, iHeight - iBotBorder + 2,(unsigned char*) sLabel, black); sprintf(sLabel, "%02d-%02d", lt->tm_mon + 1, lt->tm_mday); ! gdImageString(graph, gdFontSmall, x - 13, iHeight - iBotBorder + 12,(unsigned char*) sLabel, black); } *************** *** 1214,1218 **** if (x < iBorder * 2) continue; sprintf(sLabel, "%02ld", ((t - tFromMidnight) % (3600 * 24)) / 3600); ! gdImageString(graph, gdFontSmall, x - 6, iHeight - iBotBorder + 2, sLabel, black); } --- 1214,1218 ---- if (x < iBorder * 2) continue; sprintf(sLabel, "%02ld", ((t - tFromMidnight) % (3600 * 24)) / 3600); ! gdImageString(graph, gdFontSmall, x - 6, iHeight - iBotBorder + 2,(unsigned char*) sLabel, black); } *************** *** 1268,1272 **** if (x < iBorder * 2) continue; sprintf(sLabel, "%02ld:%02ld", ((t - tFromMidnight) % (3600 * 24)) / 3600, (t / 60) % 60); ! gdImageString(graph, gdFontSmall, x - 15, iHeight - iBotBorder + 12, sLabel, black); } --- 1268,1272 ---- if (x < iBorder * 2) continue; sprintf(sLabel, "%02ld:%02ld", ((t - tFromMidnight) % (3600 * 24)) / 3600, (t / 60) % 60); ! gdImageString(graph, gdFontSmall, x - 15, iHeight - iBotBorder + 12,(unsigned char*) sLabel, black); } *************** *** 1640,1644 **** gdImageString(graph, gdFontSmall, 10, 10, (unsigned char*)_("Error:"), black); ! gdImageString(graph, gdFontSmall, 10, 20, sMsg, black); /* Splurge */ --- 1640,1644 ---- gdImageString(graph, gdFontSmall, 10, 10, (unsigned char*)_("Error:"), black); ! gdImageString(graph, gdFontSmall, 10, 20,(unsigned char*) sMsg, black); /* Splurge */ *************** *** 1772,1779 **** gdImageString(graph, gdFontSmall, 10, 10, (unsigned char*)_("SQL:"), black); ! gdImageString(graph, gdFontSmall, 10, 20, tmpSQL, black); gdImageString(graph, gdFontSmall, 10, 40, (unsigned char*)_("Error:"), black); ! gdImageString(graph, gdFontSmall, 10, 50, tmpError, black); g_free(tmpSQL); --- 1772,1779 ---- gdImageString(graph, gdFontSmall, 10, 10, (unsigned char*)_("SQL:"), black); ! gdImageString(graph, gdFontSmall, 10, 20, (unsigned char*) tmpSQL, black); gdImageString(graph, gdFontSmall, 10, 40, (unsigned char*)_("Error:"), black); ! gdImageString(graph, gdFontSmall, 10, 50, (unsigned char*) tmpError, black); g_free(tmpSQL); *************** *** 1949,1953 **** } - - - --- 1949,1950 ---- |
From: Florian G. <re...@us...> - 2007-04-27 21:20:09
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13965/db_tools Modified Files: convert.c Log Message: fix compiler warnings Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** convert.c 20 Apr 2007 13:43:10 -0000 1.36 --- convert.c 27 Apr 2007 21:20:06 -0000 1.37 *************** *** 40,43 **** --- 40,44 ---- #include <sys/types.h> #include <ncurses.h> + #include <math.h> /* |
From: Florian G. <re...@us...> - 2007-04-27 20:54:04
|
Update of /cvsroot/perfparse/_perfparse/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3821/scripts Modified Files: mysql_create.sql Log Message: fix instance table Index: mysql_create.sql =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/mysql_create.sql,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** mysql_create.sql 26 Apr 2007 21:40:42 -0000 1.18 --- mysql_create.sql 27 Apr 2007 20:54:03 -0000 1.19 *************** *** 30,33 **** --- 30,36 ---- (0,'default instance','Default instance if no instance is selected or instance feature is switched off. Some objects will be visible on all instances if the default instance is used.'); + update perfdata_instances set instance_id=0 where instance_name='default instance'; + + CREATE TABLE IF NOT EXISTS perfdata_delete_policy ( policy_id INT AUTO_INCREMENT PRIMARY KEY, |
From: Florian G. <re...@us...> - 2007-04-26 21:40:46
|
Update of /cvsroot/perfparse/_perfparse/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16407/scripts Modified Files: mysql_create.sql Log Message: Added instance_id to get compatible to NDO utils Index: mysql_create.sql =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/mysql_create.sql,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** mysql_create.sql 19 Apr 2007 12:38:26 -0000 1.17 --- mysql_create.sql 26 Apr 2007 21:40:42 -0000 1.18 *************** *** 20,23 **** --- 20,32 ---- # TODO: Check if we need servicegroups like in nagios 2.6 + # For use of multiple nagios instances + CREATE TABLE IF NOT EXISTS perfdata_instances ( + instance_id INT AUTO_INCREMENT PRIMARY KEY, + instance_name VARCHAR(20) NOT NULL UNIQUE, + instance_text TEXT + ) TYPE=InnoDB; + + insert into perfdata_instances (instance_id,instance_name,instance_text) values + (0,'default instance','Default instance if no instance is selected or instance feature is switched off. Some objects will be visible on all instances if the default instance is used.'); CREATE TABLE IF NOT EXISTS perfdata_delete_policy ( *************** *** 25,29 **** policy_name VARCHAR(20) NOT NULL UNIQUE, delete_policy_seconds INT DEFAULT NULL, ! policy_comment TEXT ) TYPE=InnoDB; --- 34,41 ---- policy_name VARCHAR(20) NOT NULL UNIQUE, delete_policy_seconds INT DEFAULT NULL, ! policy_comment TEXT, ! instance_id INT DEFAULT 0, ! FOREIGN KEY perfdata_delete_policy_ibfk_1 (instance_id) ! REFERENCES perfdata_instances(instance_id) ) TYPE=InnoDB; *************** *** 35,39 **** CREATE TABLE IF NOT EXISTS perfdata_groups ( group_id INT AUTO_INCREMENT PRIMARY KEY, ! group_name VARCHAR(75) UNIQUE ) type=InnoDB; --- 47,54 ---- CREATE TABLE IF NOT EXISTS perfdata_groups ( group_id INT AUTO_INCREMENT PRIMARY KEY, ! group_name VARCHAR(75) UNIQUE, ! instance_id INT DEFAULT 0, ! FOREIGN KEY perfdata_groups_ibfk_1 (instance_id) ! REFERENCES perfdata_instances(instance_id) ) type=InnoDB; *************** *** 53,57 **** REFERENCES perfdata_delete_policy (policy_id) ON DELETE SET NULL, ! is_deleted TINYINT NOT NULL DEFAULT 0 ) type=InnoDB; --- 68,75 ---- REFERENCES perfdata_delete_policy (policy_id) ON DELETE SET NULL, ! is_deleted TINYINT NOT NULL DEFAULT 0, ! instance_id INT DEFAULT 0, ! FOREIGN KEY perfdata_host_ibfk_3 (instance_id) ! REFERENCES perfdata_instances(instance_id) ) type=InnoDB; |
From: Florian G. <re...@us...> - 2007-04-26 21:40:44
|
Update of /cvsroot/perfparse/_perfparse/doc/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16407/doc/database Modified Files: database_schema_v20.odp Log Message: Added instance_id to get compatible to NDO utils Index: database_schema_v20.odp =================================================================== RCS file: /cvsroot/perfparse/_perfparse/doc/database/database_schema_v20.odp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsIzPUoQ and /tmp/cvsC6rfze differ |
From: Florian G. <re...@us...> - 2007-04-20 13:43:12
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3159 Modified Files: convert.c Log Message: better handling of big copy Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** convert.c 19 Apr 2007 23:44:14 -0000 1.35 --- convert.c 20 Apr 2007 13:43:10 -0000 1.36 *************** *** 401,404 **** --- 401,406 ---- 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(_("You should start the database copy with the old or no perfparse running.\n")); + printw(_("Before copying the data tables the update procedure will ask you to switch to the new perfparse.\n")); printw(_("For more information visit\nhttp://perfparse.de/tiki-index.php?page=DatabaseUpgrade \n")); printw(_("\nAre you sure to start the conversion (y/n)? ")); *************** *** 564,567 **** --- 566,571 ---- printw(_("Copying data of old perfdata_host_group to new perfdata_groups table.\n")); refresh(); + + int acttime=time(NULL); g_string_printf(gsODBSql, "select * from perfdata_host_group"); *************** *** 577,586 **** while ((result_row_old=mysql_fetch_row(query_result_old))) { i++; - move(y,x); piODBlengths=mysql_fetch_lengths(query_result_old); ! printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); g_string_printf(gsNDBSql, "insert ignore into perfdata_groups(group_name) values('%.*s')",(int) piODBlengths[0],result_row_old[0]); dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); } printw(_("\ndone\n")); refresh(); --- 581,594 ---- while ((result_row_old=mysql_fetch_row(query_result_old))) { i++; piODBlengths=mysql_fetch_lengths(query_result_old); ! if(acttime != time(NULL)) { ! move(y,x); ! printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); ! acttime= time(NULL); ! } g_string_printf(gsNDBSql, "insert ignore into perfdata_groups(group_name) values('%.*s')",(int) piODBlengths[0],result_row_old[0]); dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); } + printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); printw(_("\ndone\n")); refresh(); *************** *** 597,605 **** getyx(stdscr,y,x); i=0; while ((result_row_old=mysql_fetch_row(query_result_old))) { i++; - move(y,x); piODBlengths=mysql_fetch_lengths(query_result_old); ! printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); g_string_printf(gsNDBSql, \ "insert ignore into perfdata_delete_policy(policy_name,delete_policy_seconds) values ('%.*s',%d)",\ --- 605,617 ---- getyx(stdscr,y,x); i=0; + acttime=time(NULL); while ((result_row_old=mysql_fetch_row(query_result_old))) { i++; piODBlengths=mysql_fetch_lengths(query_result_old); ! if(acttime != time(NULL)) { ! move(y,x); ! printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); ! acttime= time(NULL); ! } g_string_printf(gsNDBSql, \ "insert ignore into perfdata_delete_policy(policy_name,delete_policy_seconds) values ('%.*s',%d)",\ *************** *** 607,610 **** --- 619,623 ---- dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); } + printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); printw(_("\ndone\n")); refresh(); *************** *** 623,626 **** --- 636,640 ---- + acttime=time(NULL); while ((result_row_old=mysql_fetch_row(query_result_old))) { i++; *************** *** 629,636 **** int Hid=-1,Gid=-1; - move(y,x); piODBlengths=mysql_fetch_lengths(query_result_old); ! printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); g_string_printf(gsNDBSql, "insert ignore into perfdata_host(host_name,is_deleted"); g_string_printf(gsNDBSql2," values('%s',%s",result_row_old[0],result_row_old[8]); --- 643,653 ---- int Hid=-1,Gid=-1; piODBlengths=mysql_fetch_lengths(query_result_old); ! if(acttime != time(NULL)) { ! move(y,x); ! printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); ! acttime= time(NULL); ! } g_string_printf(gsNDBSql, "insert ignore into perfdata_host(host_name,is_deleted"); g_string_printf(gsNDBSql2," values('%s',%s",result_row_old[0],result_row_old[8]); *************** *** 675,678 **** --- 692,696 ---- } } + printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); printw(_("\ndone\n")); refresh(); *************** *** 697,700 **** --- 715,719 ---- + acttime= time(NULL); while ((result_row_old=mysql_fetch_row(query_result_old))) { i++; *************** *** 703,710 **** int Hid=-1; - move(y,x); piODBlengths=mysql_fetch_lengths(query_result_old); ! printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); Hid=get_hostId_from_name(result_row_old[0],&db_mysql_new); g_string_printf(gsNDBSql, "insert ignore into perfdata_service(host_id," --- 722,733 ---- int Hid=-1; piODBlengths=mysql_fetch_lengths(query_result_old); ! if(acttime != time(NULL)) { ! move(y,x); ! printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); ! acttime= time(NULL); ! } ! Hid=get_hostId_from_name(result_row_old[0],&db_mysql_new); g_string_printf(gsNDBSql, "insert ignore into perfdata_service(host_id," *************** *** 731,734 **** --- 754,758 ---- } //Todo: Handle last_perfdata row somewhere? Or does it "rapair itself automatically"? + printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); printw(_("\ndone\n")); refresh(); *************** *** 753,757 **** i=0; ! while ((result_row_old=mysql_fetch_row(query_result_old))) { i++; --- 777,782 ---- i=0; ! ! acttime= time(NULL); while ((result_row_old=mysql_fetch_row(query_result_old))) { i++; *************** *** 760,767 **** int Sid=-1; - move(y,x); piODBlengths=mysql_fetch_lengths(query_result_old); - printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); Sid=get_serviceId_from_desc(result_row_old[0],result_row_old[1],&db_mysql_new); if(Sid!=0) { // stale entry --- 785,795 ---- int Sid=-1; piODBlengths=mysql_fetch_lengths(query_result_old); + if(acttime != time(NULL)) { + move(y,x); + printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); + acttime= time(NULL); + } Sid=get_serviceId_from_desc(result_row_old[0],result_row_old[1],&db_mysql_new); if(Sid!=0) { // stale entry *************** *** 792,795 **** --- 820,824 ---- } } + printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); printw(_("\ndone\n")); refresh(); *************** *** 800,806 **** printw(_("(Step %d of %d)\n"),iStep,iNumSteps); printw(_("Copying data of perfdata_service_bin table.\n")); printw(_("Since this table can be really huge i will copy the data in chunks.\n")); ! printw(_("Every 5 minutes i will make a 15 sec. break to give the database a chance to finish outstanding transactions.\n")); refresh(); --- 829,847 ---- printw(_("(Step %d of %d)\n"),iStep,iNumSteps); printw(_("Copying data of perfdata_service_bin table.\n")); + printw(_("You should now switch to the new perfparse. Keep this window open until the new perfparse system is running.\n")); printw(_("Since this table can be really huge i will copy the data in chunks.\n")); ! printw(_("For a online upgrade you should choose 1 or 2 below. For offline upgrade you can choose 3.\n")); ! printw(_("1: Pause 10 sec. every minute (default).\n")); ! printw(_("2: Pause 10 sec. every 5 minutes.\n")); ! printw(_("3: No pause.\n")); ! int iPause=0; ! while(iPause>3 || iPause<1) { ! printw(_("Choose: ")); refresh(); ! iPause=read_int_from_line(1); ! } + int iSleep=60; + if(iPause==2) iSleep=300; + refresh(); *************** *** 820,824 **** int starttime=time(NULL); ! int acttime=time(NULL); g_string_printf(gsODBSql, "select host_name, service_description,metric," "UNIX_TIMESTAMP(ctime),value,warn,critical," --- 861,865 ---- int starttime=time(NULL); ! acttime=time(NULL); g_string_printf(gsODBSql, "select host_name, service_description,metric," "UNIX_TIMESTAMP(ctime),value,warn,critical," *************** *** 876,882 **** dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); } ! if((starttime-time(NULL))%300==0) { ! printw(_("Sleeping 15 Sec.")); ! sleep(15); } } --- 917,924 ---- dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); } ! if(iPause != 3 && time(NULL)-starttime > 0 && (time(NULL)-starttime)%iSleep==0) { ! move(y-1,x); ! printw(_(" Sleeping 10 Sec. ")); refresh(); ! sleep(10); } } |
From: Florian G. <re...@us...> - 2007-04-19 23:44:15
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11772/db_tools Modified Files: convert.c Log Message: cosmetics Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** convert.c 19 Apr 2007 23:09:12 -0000 1.34 --- convert.c 19 Apr 2007 23:44:14 -0000 1.35 *************** *** 836,840 **** int eh=0, emin=0, esec=0; esec=acttime-starttime; ! sec=round(iODBnumrows/i*esec); if(sec>60) { min=floor(sec/60); --- 836,840 ---- int eh=0, emin=0, esec=0; esec=acttime-starttime; ! sec=round(((float)iODBnumrows / (float)i - 1.0) * (float)esec); if(sec>60) { min=floor(sec/60); *************** *** 876,880 **** dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); } ! if((starttime-time(NULL))%600==0) { printw(_("Sleeping 15 Sec.")); sleep(15); --- 876,880 ---- dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); } ! if((starttime-time(NULL))%300==0) { printw(_("Sleeping 15 Sec.")); sleep(15); |
From: Florian G. <re...@us...> - 2007-04-19 23:09:13
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30555/db_tools Modified Files: convert.c Log Message: Fixed mem leak Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** convert.c 19 Apr 2007 12:38:26 -0000 1.33 --- convert.c 19 Apr 2007 23:09:12 -0000 1.34 *************** *** 200,210 **** int Hid,Sid; - // use combined string for querying cache - GString *gsCombined=g_string_new(""); - g_string_printf(gsCombined,"%s : %s",host_name,service_desc); - if((Hid=get_hostId_from_name(host_name,p_db_mysql_new))==FALSE) { return(FALSE); } if((pSid=g_hash_table_lookup(servicesCache,gsCombined->str))) { --- 200,210 ---- int Hid,Sid; if((Hid=get_hostId_from_name(host_name,p_db_mysql_new))==FALSE) { return(FALSE); } + + // use combined string for querying cache + GString *gsCombined=g_string_new(""); + g_string_printf(gsCombined,"%s : %s",host_name,service_desc); if((pSid=g_hash_table_lookup(servicesCache,gsCombined->str))) { *************** *** 213,216 **** --- 213,217 ---- printw("\nServiceId Cache Hit: %s -> %d\n",gsCombined->str,Sid);refresh(); #endif + g_string_free(gsCombined,TRUE); return(Sid); } else { *************** *** 250,261 **** int Sid,Mid; // use combined string for querying cache GString *gsCombined=g_string_new(""); g_string_printf(gsCombined,"%s : %s : %s",host_name,service_desc,metric); - if((Sid=get_serviceId_from_desc(host_name,service_desc,p_db_mysql_new))==FALSE) { - return(FALSE); - } - if((pMid=g_hash_table_lookup(metricCache,gsCombined->str))) { Mid=*pMid; --- 251,262 ---- int Sid,Mid; + if((Sid=get_serviceId_from_desc(host_name,service_desc,p_db_mysql_new))==FALSE) { + return(FALSE); + } + // use combined string for querying cache GString *gsCombined=g_string_new(""); g_string_printf(gsCombined,"%s : %s : %s",host_name,service_desc,metric); if((pMid=g_hash_table_lookup(metricCache,gsCombined->str))) { Mid=*pMid; *************** *** 263,266 **** --- 264,268 ---- printw("\nMetricId Cache Hit: %s -> %d\n",gsCombined->str,Mid);refresh(); #endif + g_string_free(gsCombined,TRUE); return(Mid); } else { *************** *** 853,857 **** } ! printw(_("Copying entry: %d/%d (%.2f %%) Elapsed: %d h, %d min, %d sec Est. remaining: %d h, %d min, %d sec\n"), i,iODBnumrows,(float) i/iODBnumrows,eh,emin,esec,h,min,sec); refresh(); } --- 855,861 ---- } ! printw(_("Copying entry: %d/%d (%.2f %%) Elapsed: %d h, %d min, %d sec " ! "Est. remaining: %d h, %d min, %d sec\n"), i,iODBnumrows, ! (float) i/iODBnumrows*100,eh,emin,esec,h,min,sec); refresh(); } |
From: Florian G. <re...@us...> - 2007-04-19 12:38:29
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19564/db_tools Modified Files: convert.c Log Message: Fixed mem leaks Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** convert.c 15 Apr 2007 23:39:52 -0000 1.32 --- convert.c 19 Apr 2007 12:38:26 -0000 1.33 *************** *** 52,55 **** --- 52,57 ---- void pp_mysql_convert_sql_failure(char*f,int l, const char*str, const char *error); MYSQL_RES *dbtool_mysql_query(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result); + MYSQL_RES *dbtool_mysql_query_cursor(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result); + MYSQL_RES *dbtool_mysql_query_internal(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result, int cursor); void dbtool_freeResult(MYSQL_RES *p_tmp_query_result); int dbtool_rows(MYSQL_RES *p_tmp_query_result); *************** *** 80,83 **** --- 82,96 ---- } + void g_hash_table_insert_copy(GHashTable *hashCache,char *tmp_string,int tmp_int) { + // mallocs space for string and value (int) and inserts it into the table given + int *pInt=malloc(sizeof(int)); + char *pStr=malloc(sizeof(char)*(strlen(tmp_string)+1)); + *pInt=tmp_int; + strncpy(pStr,tmp_string,strlen(tmp_string)+1); + g_hash_table_insert(hashCache,(gpointer) pStr,pInt); + } + + + int get_policyId_from_name(const char *policy_name, MYSQL *p_db_mysql_new) { int *pPid; *************** *** 106,112 **** dbtool_freeResult(query_result_new); // save result in cache ! pPid=malloc(sizeof(int)); ! *pPid=Pid; ! g_hash_table_insert(policiesCache,(gpointer) policy_name,pPid); #ifdef DEBUG printw("\nPolicyId Cache Miss: %s -> %d\n",policy_name,Pid);refresh(); --- 119,123 ---- dbtool_freeResult(query_result_new); // save result in cache ! g_hash_table_insert_copy(policiesCache,policy_name,Pid); #ifdef DEBUG printw("\nPolicyId Cache Miss: %s -> %d\n",policy_name,Pid);refresh(); *************** *** 142,148 **** dbtool_freeResult(query_result_new); // save result in cache ! pGid=malloc(sizeof(int)); ! *pGid=Gid; ! g_hash_table_insert(groupsCache,(gpointer) group_name,pGid); #ifdef DEBUG printw("\nGroupId Cache Miss: %s -> %d\n",group_name,Gid);refresh(); --- 153,157 ---- dbtool_freeResult(query_result_new); // save result in cache ! g_hash_table_insert_copy(groupsCache,group_name,Gid); #ifdef DEBUG printw("\nGroupId Cache Miss: %s -> %d\n",group_name,Gid);refresh(); *************** *** 178,184 **** dbtool_freeResult(query_result_new); // save result in cache ! pHid=malloc(sizeof(int)); ! *pHid=Hid; ! g_hash_table_insert(hostsCache,(gpointer) host_name,pHid); #ifdef DEBUG printw("\nHostId Cache Miss: %s -> %d\n",host_name,Hid);refresh(); --- 187,191 ---- dbtool_freeResult(query_result_new); // save result in cache ! g_hash_table_insert_copy(hostsCache,host_name,Hid); #ifdef DEBUG printw("\nHostId Cache Miss: %s -> %d\n",host_name,Hid);refresh(); *************** *** 215,218 **** --- 222,228 ---- "host_id=%d and service_description='%s'", Hid,service_desc); + #ifdef DEBUG + printw("debug: query: %s\n",gsNDBSql->str); + #endif query_result_new=dbtool_mysql_query(gsNDBSql->str, p_db_mysql_new, query_result_new); if((result_row_new=mysql_fetch_row(query_result_new))) { *************** *** 225,231 **** dbtool_freeResult(query_result_new); // save result in cache ! pSid=malloc(sizeof(int)); ! *pSid=Sid; ! g_hash_table_insert(servicesCache,(gpointer) gsCombined->str,pSid); #ifdef DEBUG printw("\nServiceId Cache Miss: %s -> %d\n",gsCombined->str,Sid);refresh(); --- 235,239 ---- dbtool_freeResult(query_result_new); // save result in cache ! g_hash_table_insert_copy(servicesCache,gsCombined->str,Sid); #ifdef DEBUG printw("\nServiceId Cache Miss: %s -> %d\n",gsCombined->str,Sid);refresh(); *************** *** 274,280 **** dbtool_freeResult(query_result_new); // save result in cache ! pMid=malloc(sizeof(int)); ! *pMid=Mid; ! g_hash_table_insert(metricCache,(gpointer) gsCombined->str,pMid); #ifdef DEBUG printw("\nMetricId Cache Miss: %s -> %d\n",gsCombined->str,Mid);refresh(); --- 282,286 ---- dbtool_freeResult(query_result_new); // save result in cache ! g_hash_table_insert_copy(metricCache,gsCombined->str,Mid); #ifdef DEBUG printw("\nMetricId Cache Miss: %s -> %d\n",gsCombined->str,Mid);refresh(); *************** *** 757,784 **** printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); Sid=get_serviceId_from_desc(result_row_old[0],result_row_old[1],&db_mysql_new); ! g_string_printf(gsNDBSql, "insert ignore into perfdata_service_metric" ! "(service_id,metric,unit,notes,value_max," ! "value_min,is_deleted"); ! g_string_printf(gsNDBSql2," values(%d,'%s','%s','%s',%s,%s,%s", ! Sid,result_row_old[2],result_row_old[3],result_row_old[4], ! result_row_old[5],result_row_old[6],result_row_old[11]); ! // get bin delete policy id if template ! if(strncmp(result_row_old[10],"template",4)==0) { ! iBinPolicyId=get_policyId_from_name(result_row_old[9],&db_mysql_new); ! g_string_append_printf(gsNDBSql,",bin_delete_policy_id"); ! g_string_append_printf(gsNDBSql2,",%d",iBinPolicyId); ! } else { ! if(result_row_old[8]!=NULL) { ! iBinPolicyInd=atoi(result_row_old[8])*86400; ! g_string_append_printf(gsNDBSql,",bin_delete_policy_individual"); ! g_string_append_printf(gsNDBSql2,",%d",iBinPolicyInd); ! } ! } ! g_string_append_printf(gsNDBSql2,")"); ! g_string_append_printf(gsNDBSql,")%s",gsNDBSql2->str); ! // printw("debug: Sql Statement: %s\n",gsNDBSql->str);refresh(); ! dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); } printw(_("\ndone\n")); refresh(); --- 763,792 ---- printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); Sid=get_serviceId_from_desc(result_row_old[0],result_row_old[1],&db_mysql_new); ! if(Sid!=0) { // stale entry ! g_string_printf(gsNDBSql, "insert ignore into perfdata_service_metric" ! "(service_id,metric,unit,notes,value_max," ! "value_min,is_deleted"); ! g_string_printf(gsNDBSql2," values(%d,'%s','%s','%s',%s,%s,%s", ! Sid,result_row_old[2],result_row_old[3],result_row_old[4], ! result_row_old[5],result_row_old[6],result_row_old[11]); ! // get bin delete policy id if template ! if(strncmp(result_row_old[10],"template",4)==0) { ! iBinPolicyId=get_policyId_from_name(result_row_old[9],&db_mysql_new); ! g_string_append_printf(gsNDBSql,",bin_delete_policy_id"); ! g_string_append_printf(gsNDBSql2,",%d",iBinPolicyId); ! } else { ! if(result_row_old[8]!=NULL) { ! iBinPolicyInd=atoi(result_row_old[8])*86400; ! g_string_append_printf(gsNDBSql,",bin_delete_policy_individual"); ! g_string_append_printf(gsNDBSql2,",%d",iBinPolicyInd); ! } ! } ! g_string_append_printf(gsNDBSql2,")"); ! g_string_append_printf(gsNDBSql,")%s",gsNDBSql2->str); ! // printw("debug: Sql Statement: %s\n",gsNDBSql->str);refresh(); ! dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); ! } } printw(_("\ndone\n")); refresh(); *************** *** 790,853 **** printw(_("(Step %d of %d)\n"),iStep,iNumSteps); printw(_("Copying data of perfdata_service_bin table.\n")); ! printw(_("Since this table can be really huge i will copy the data in chunks to avoid table locks.\n")); ! printw(_("Every chunk will consist of the data collected on one day starting with the 1st entry.\n")); ! printw(_("Everytime when data of 30 days are inserted i will make a 15 sec. break to give the database a chance to finish outstanding transactions.\n")); refresh(); ! // get date of oldest entry ! g_string_printf(gsODBSql, "select UNIX_TIMESTAMP(MIN(ctime)) from perfdata_service_bin"); - int iOldestEntry; // oldest Entry not yet copied query_result_old=dbtool_mysql_query(gsODBSql->str, &db_mysql_old, query_result_old); - if((result_row_old=mysql_fetch_row(query_result_old))) { - iOldestEntry=atoi(result_row_old[0]); - } else { - iOldestEntry=time(NULL); - } ! int donedays=0; ! while (iOldestEntry < time(NULL)) { ! g_string_printf(gsODBSql, "select host_name, service_description,metric," ! "UNIX_TIMESTAMP(ctime),value,warn,critical," ! "state from perfdata_service_bin where ctime " ! "between FROM_UNIXTIME(%d) and FROM_UNIXTIME(%d)", ! iOldestEntry,iOldestEntry+24*60*60); ! query_result_old=dbtool_mysql_query(gsODBSql->str, &db_mysql_old,query_result_old); ! iODBnumrows=dbtool_rows(query_result_old); ! printw(_("Copying data from date: %s Affected rows: %d\n"), ! ctime(&iOldestEntry),iODBnumrows); ! getyx(stdscr,y,x); ! i=0; ! while ((result_row_old=mysql_fetch_row(query_result_old))) { ! i++; ! int Mid; ! move(y,x); ! piODBlengths=mysql_fetch_lengths(query_result_old); ! printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); ! Mid=get_metricId_from_text(result_row_old[0],result_row_old[1],result_row_old[2],&db_mysql_new); ! if(Mid!=FALSE) { // stale data ! // TODO: check if ctime is changed everywhere from DATETIME to int (unix timestamp) ! g_string_printf(gsNDBSql, "insert ignore into perfdata_service_bin" ! "(metric_id,ctime,value,warn,critical,state) " ! "values (%d,%s,%s,%s,%s,%s)", ! Mid,result_row_old[3],result_row_old[4], ! result_row_old[5],result_row_old[6], ! result_row_old[7]); ! ! // printw("debug: Sql Statement: %s\n",gsNDBSql->str);refresh(); ! dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); } } ! iOldestEntry+=3600*24; ! donedays++; ! if(donedays%30==0) { printw(_("Sleeping 15 Sec.")); sleep(15); } - move(x,y-2); } move(x,y); --- 798,879 ---- printw(_("(Step %d of %d)\n"),iStep,iNumSteps); printw(_("Copying data of perfdata_service_bin table.\n")); ! printw(_("Since this table can be really huge i will copy the data in chunks.\n")); ! printw(_("Every 5 minutes i will make a 15 sec. break to give the database a chance to finish outstanding transactions.\n")); refresh(); ! // Set transaction level for dirty reads ! g_string_printf(gsODBSql, "SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED"); query_result_old=dbtool_mysql_query(gsODBSql->str, &db_mysql_old, query_result_old); ! // get num of rows in extra query since mysql_num_rows does not work with cursors ! printw(_("Calculating number of records to copy ... ")); refresh(); ! g_string_printf(gsODBSql, "select count(*) from perfdata_service_bin"); ! query_result_old=dbtool_mysql_query(gsODBSql->str, &db_mysql_old, query_result_old); ! result_row_old=mysql_fetch_row(query_result_old); ! iODBnumrows=atoi(result_row_old[0]); ! printw(_("%d records.\n\n"),iODBnumrows); ! ! int starttime=time(NULL); ! int acttime=time(NULL); ! g_string_printf(gsODBSql, "select host_name, service_description,metric," ! "UNIX_TIMESTAMP(ctime),value,warn,critical," ! "state from perfdata_service_bin"); ! query_result_old=dbtool_mysql_query_cursor(gsODBSql->str, &db_mysql_old,query_result_old); ! int Mid; ! i=0; ! getyx(stdscr,y,x); ! while ((result_row_old=mysql_fetch_row(query_result_old))) { ! if(acttime != time(NULL)) { // only update screen every second ! acttime = time(NULL); ! move(y-1,x); ! int h=0, min=0, sec=0; ! int eh=0, emin=0, esec=0; ! esec=acttime-starttime; ! sec=round(iODBnumrows/i*esec); ! if(sec>60) { ! min=floor(sec/60); ! sec=sec%60; ! } ! if(esec>60) { ! emin=floor(esec/60); ! esec=esec%60; ! } ! if(min>60) { ! h=floor(min/60); ! min=min%60; } + if(emin>60) { + eh=floor(emin/60); + emin=emin%60; + } + + printw(_("Copying entry: %d/%d (%.2f %%) Elapsed: %d h, %d min, %d sec Est. remaining: %d h, %d min, %d sec\n"), i,iODBnumrows,(float) i/iODBnumrows,eh,emin,esec,h,min,sec); + refresh(); } ! i++; ! Mid=get_metricId_from_text(result_row_old[0],result_row_old[1],result_row_old[2],&db_mysql_new); ! if(Mid!=FALSE) { // stale data ! // TODO: check if ctime is changed everywhere from DATETIME to int (unix timestamp) ! g_string_printf(gsNDBSql, "insert ignore into perfdata_service_bin" ! "(metric_id,ctime,value,warn,critical,state) " ! "values (%d,%s,%s,%s,%s,%s)", ! Mid,result_row_old[3],result_row_old[4], ! result_row_old[5],result_row_old[6], ! result_row_old[7]); ! ! #ifdef DEBUG ! printw("debug: Sql Statement: %s\n",gsNDBSql->str);refresh(); ! #endif ! dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); ! } ! if((starttime-time(NULL))%600==0) { printw(_("Sleeping 15 Sec.")); sleep(15); } } move(x,y); *************** *** 946,951 **** --- 972,989 ---- } + MYSQL_RES *dbtool_mysql_query(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result) { + return(dbtool_mysql_query_internal(sql,p_tmp_db_mysql,p_tmp_query_result,FALSE)); + } + + MYSQL_RES *dbtool_mysql_query_cursor(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result) + { + return(dbtool_mysql_query_internal(sql,p_tmp_db_mysql,p_tmp_query_result,TRUE)); + } + + + MYSQL_RES *dbtool_mysql_query_internal(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result, int cursor) + { #ifdef SHOW_SQL printf("SQL: \"%s\"\n", sql); *************** *** 963,967 **** /*iRowsAffected = mysql_affected_rows(&tmp_db_mysql);*/ ! p_tmp_query_result = mysql_store_result(p_tmp_db_mysql); #ifdef SHOW_SQL --- 1001,1009 ---- /*iRowsAffected = mysql_affected_rows(&tmp_db_mysql);*/ ! if(cursor) { ! p_tmp_query_result = mysql_use_result(p_tmp_db_mysql); ! } else { ! p_tmp_query_result = mysql_store_result(p_tmp_db_mysql); ! } #ifdef SHOW_SQL |
From: Florian G. <re...@us...> - 2007-04-19 12:38:27
|
Update of /cvsroot/perfparse/_perfparse/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19564/scripts Modified Files: mysql_create.sql Log Message: Fixed mem leaks Index: mysql_create.sql =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/mysql_create.sql,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** mysql_create.sql 15 Apr 2007 23:39:53 -0000 1.16 --- mysql_create.sql 19 Apr 2007 12:38:26 -0000 1.17 *************** *** 126,129 **** --- 126,130 ---- service_id INT, metric VARCHAR(75) NOT NULL, + UNIQUE INDEX (service_id,metric), FOREIGN KEY (service_id) REFERENCES perfdata_service (service_id) |
From: Florian G. <re...@us...> - 2007-04-15 23:39:54
|
Update of /cvsroot/perfparse/_perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3149 Modified Files: TODO configure configure.ac Log Message: convert service_bin table. Eleminate DATETIME database columns. Converted to INT for Unix Timestamps. Index: configure =================================================================== RCS file: /cvsroot/perfparse/_perfparse/configure,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** configure 14 Apr 2007 00:34:58 -0000 1.25 --- configure 15 Apr 2007 23:39:52 -0000 1.26 *************** *** 1561,1565 **** --with-cgidir=DIR cgi dir (default=sbindir) --with-phpuidir=DIR PHP webinterface dir (default=sbindir) ! --with-apache-user=username Apache user for installation (default=nobody) --with-imagedir=DIR images dir (default=datadir/perfparse/images) --with-http_image_path=DIR HTTP image path (default=/nagios/images) --- 1561,1565 ---- --with-cgidir=DIR cgi dir (default=sbindir) --with-phpuidir=DIR PHP webinterface dir (default=sbindir) ! --with-apacheuser=username Apache user for installation (default=nobody) --with-imagedir=DIR images dir (default=datadir/perfparse/images) --with-http_image_path=DIR HTTP image path (default=/nagios/images) Index: configure.ac =================================================================== RCS file: /cvsroot/perfparse/_perfparse/configure.ac,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** configure.ac 11 Apr 2007 08:24:29 -0000 1.23 --- configure.ac 15 Apr 2007 23:39:52 -0000 1.24 *************** *** 336,340 **** INST_APACHE_USER="nobody" AC_ARG_WITH(apacheuser, ! [ --with-apache-user=username Apache user for installation (default=nobody)],[ if test "$withval" != "no" -a "$withval" != "yes"; then INST_APACHE_USER=$withval --- 336,340 ---- INST_APACHE_USER="nobody" AC_ARG_WITH(apacheuser, ! [ --with-apacheuser=username Apache user for installation (default=nobody)],[ if test "$withval" != "no" -a "$withval" != "yes"; then INST_APACHE_USER=$withval Index: TODO =================================================================== RCS file: /cvsroot/perfparse/_perfparse/TODO,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TODO 21 Dec 2006 13:38:32 -0000 1.7 --- TODO 15 Apr 2007 23:39:52 -0000 1.8 *************** *** 1,4 **** --- 1,6 ---- - make postgres working (scripts and executables) - finish database upgrade program + - check that DATETIME is eleminated and check if all code works with unix ts + (especially ctime fields in database) - Use storage modules also to get data for cgi/phpui similar to saving data. Getting Data should only use first storage module configured. - Integrate ajax framework. Ideas: create tinyurls for graphs via ajax. Make menus more dynamic ... *************** *** 9,10 **** --- 11,14 ---- - make easier interface for deleting or renaming things (hosts, services, metrics) - support for logarithmic scales + - update documentation - remove install options that are outdated + - add option to deliver data via NEB module |
From: Florian G. <re...@us...> - 2007-04-15 23:39:54
|
Update of /cvsroot/perfparse/_perfparse/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3149/scripts Modified Files: mysql_create.sql Log Message: convert service_bin table. Eleminate DATETIME database columns. Converted to INT for Unix Timestamps. Index: mysql_create.sql =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/mysql_create.sql,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mysql_create.sql 14 Apr 2007 00:34:59 -0000 1.15 --- mysql_create.sql 15 Apr 2007 23:39:53 -0000 1.16 *************** *** 105,109 **** REFERENCES perfdata_service (service_id) ON DELETE RESTRICT, ! ctime DATETIME NOT NULL, INDEX perfdata_service_raw_ix1 (ctime), txt_data VARCHAR(255), --- 105,109 ---- REFERENCES perfdata_service (service_id) ON DELETE RESTRICT, ! ctime INT NOT NULL, INDEX perfdata_service_raw_ix1 (ctime), txt_data VARCHAR(255), *************** *** 155,159 **** REFERENCES perfdata_service_metric (metric_id) ON DELETE RESTRICT, ! ctime DATETIME NOT NULL, INDEX perfdata_service_raw_ix1 (metric_id, ctime), value FLOAT, --- 155,159 ---- REFERENCES perfdata_service_metric (metric_id) ON DELETE RESTRICT, ! ctime INT NOT NULL, INDEX perfdata_service_raw_ix1 (metric_id, ctime), value FLOAT, *************** *** 209,213 **** metric_id INT NOT NULL, frequency INT NOT NULL, ! ctime DATETIME NOT NULL, PRIMARY KEY (metric_id, frequency, ctime), FOREIGN KEY (metric_id, frequency) --- 209,213 ---- metric_id INT NOT NULL, frequency INT NOT NULL, ! ctime INT NOT NULL, PRIMARY KEY (metric_id, frequency, ctime), FOREIGN KEY (metric_id, frequency) *************** *** 274,278 **** PRIMARY KEY (host, rkey), rvalue TEXT, ! ctime DATETIME NOT NULL ) type=InnoDB; --- 274,278 ---- PRIMARY KEY (host, rkey), rvalue TEXT, ! ctime INT NOT NULL ) type=InnoDB; |
From: Florian G. <re...@us...> - 2007-04-15 23:39:54
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3149/db_tools Modified Files: convert.c Log Message: convert service_bin table. Eleminate DATETIME database columns. Converted to INT for Unix Timestamps. Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** convert.c 14 Apr 2007 21:59:54 -0000 1.31 --- convert.c 15 Apr 2007 23:39:52 -0000 1.32 *************** *** 47,51 **** // debug ! #define DEBUG void checkTables (); --- 47,51 ---- // debug ! // #define DEBUG void checkTables (); *************** *** 77,80 **** --- 77,81 ---- hostsCache=g_hash_table_new(g_str_hash,g_str_equal); servicesCache=g_hash_table_new(g_str_hash,g_str_equal); + metricCache=g_hash_table_new(g_str_hash,g_str_equal); } *************** *** 783,786 **** --- 784,857 ---- printw(_("\ndone\n")); refresh(); + + + // Step 6 + iStep++; + printw(_("(Step %d of %d)\n"),iStep,iNumSteps); + printw(_("Copying data of perfdata_service_bin table.\n")); + printw(_("Since this table can be really huge i will copy the data in chunks to avoid table locks.\n")); + printw(_("Every chunk will consist of the data collected on one day starting with the 1st entry.\n")); + printw(_("Everytime when data of 30 days are inserted i will make a 15 sec. break to give the database a chance to finish outstanding transactions.\n")); + + + refresh(); + + // get date of oldest entry + g_string_printf(gsODBSql, "select UNIX_TIMESTAMP(MIN(ctime)) from perfdata_service_bin"); + + int iOldestEntry; // oldest Entry not yet copied + query_result_old=dbtool_mysql_query(gsODBSql->str, &db_mysql_old, query_result_old); + if((result_row_old=mysql_fetch_row(query_result_old))) { + iOldestEntry=atoi(result_row_old[0]); + } else { + iOldestEntry=time(NULL); + } + + int donedays=0; + while (iOldestEntry < time(NULL)) { + g_string_printf(gsODBSql, "select host_name, service_description,metric," + "UNIX_TIMESTAMP(ctime),value,warn,critical," + "state from perfdata_service_bin where ctime " + "between FROM_UNIXTIME(%d) and FROM_UNIXTIME(%d)", + iOldestEntry,iOldestEntry+24*60*60); + query_result_old=dbtool_mysql_query(gsODBSql->str, &db_mysql_old,query_result_old); + iODBnumrows=dbtool_rows(query_result_old); + + printw(_("Copying data from date: %s Affected rows: %d\n"), + ctime(&iOldestEntry),iODBnumrows); + getyx(stdscr,y,x); + i=0; + while ((result_row_old=mysql_fetch_row(query_result_old))) { + i++; + int Mid; + move(y,x); + piODBlengths=mysql_fetch_lengths(query_result_old); + + printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); + Mid=get_metricId_from_text(result_row_old[0],result_row_old[1],result_row_old[2],&db_mysql_new); + if(Mid!=FALSE) { // stale data + // TODO: check if ctime is changed everywhere from DATETIME to int (unix timestamp) + g_string_printf(gsNDBSql, "insert ignore into perfdata_service_bin" + "(metric_id,ctime,value,warn,critical,state) " + "values (%d,%s,%s,%s,%s,%s)", + Mid,result_row_old[3],result_row_old[4], + result_row_old[5],result_row_old[6], + result_row_old[7]); + + // printw("debug: Sql Statement: %s\n",gsNDBSql->str);refresh(); + dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); + } + } + iOldestEntry+=3600*24; + donedays++; + if(donedays%30==0) { + printw(_("Sleeping 15 Sec.")); + sleep(15); + } + move(x,y-2); + } + move(x,y); + printw(_("\ndone\n")); refresh(); + //TODO: End comment versioncheck |
From: Florian G. <re...@us...> - 2007-04-14 21:59:55
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv832/db_tools Modified Files: convert.c Log Message: metricId cache Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** convert.c 14 Apr 2007 00:34:59 -0000 1.30 --- convert.c 14 Apr 2007 21:59:54 -0000 1.31 *************** *** 61,64 **** --- 61,65 ---- int get_hostId_from_name(const char *host_name, MYSQL *db_mysql_new); int get_serviceId_from_desc(const char *host_name,const char *service_desc,MYSQL *db_mysql_new); + int get_metricId_from_text(const char *host_name,const char *service_desc, const char *metric,MYSQL *db_mysql_new); void end_curses(void); void exit_curses(int endval); *************** *** 69,72 **** --- 70,74 ---- GHashTable *hostsCache=NULL; GHashTable *servicesCache=NULL; + GHashTable *metricCache=NULL; void init_caches(void) { *************** *** 233,236 **** --- 235,287 ---- } + + int get_metricId_from_text(const char *host_name, const char *service_desc, + const char *metric, MYSQL *p_db_mysql_new) { + int *pMid; + int Sid,Mid; + + // use combined string for querying cache + GString *gsCombined=g_string_new(""); + g_string_printf(gsCombined,"%s : %s : %s",host_name,service_desc,metric); + + if((Sid=get_serviceId_from_desc(host_name,service_desc,p_db_mysql_new))==FALSE) { + return(FALSE); + } + + if((pMid=g_hash_table_lookup(metricCache,gsCombined->str))) { + Mid=*pMid; + #ifdef DEBUG + printw("\nMetricId Cache Hit: %s -> %d\n",gsCombined->str,Mid);refresh(); + #endif + return(Mid); + } else { + MYSQL_RES *query_result_new = NULL; + MYSQL_ROW result_row_new; + GString *gsNDBSql; + gsNDBSql = g_string_new (""); + g_string_printf(gsNDBSql, "select metric_id from perfdata_service_metric where " + "service_id=%d and metric='%s'", + Sid,metric); + query_result_new=dbtool_mysql_query(gsNDBSql->str, p_db_mysql_new, query_result_new); + if((result_row_new=mysql_fetch_row(query_result_new))) { + Mid=atoi(result_row_new[0]); + } else { + Mid=FALSE; + } + // cleanup + g_string_free(gsNDBSql,TRUE); + dbtool_freeResult(query_result_new); + // save result in cache + pMid=malloc(sizeof(int)); + *pMid=Mid; + g_hash_table_insert(metricCache,(gpointer) gsCombined->str,pMid); + #ifdef DEBUG + printw("\nMetricId Cache Miss: %s -> %d\n",gsCombined->str,Mid);refresh(); + #endif + g_string_free(gsCombined,TRUE); + return(Mid); + } + } + void |
From: Florian G. <re...@us...> - 2007-04-14 00:35:06
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18924/db_tools Modified Files: convert.c Log Message: convert perfdata_service_metric table Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** convert.c 11 Apr 2007 13:43:40 -0000 1.29 --- convert.c 14 Apr 2007 00:34:59 -0000 1.30 *************** *** 39,43 **** #include <gettext.h> #include <sys/types.h> - #include <regex.h> #include <ncurses.h> --- 39,42 ---- *************** *** 48,52 **** // debug ! // #define DEBUG void checkTables (); --- 47,51 ---- // debug ! #define DEBUG void checkTables (); *************** *** 59,62 **** --- 58,64 ---- void init_caches(void); int get_policyId_from_name(const char *policy_name, MYSQL *db_mysql_new); + int get_groupId_from_name(const char *group_name, MYSQL *db_mysql_new); + int get_hostId_from_name(const char *host_name, MYSQL *db_mysql_new); + int get_serviceId_from_desc(const char *host_name,const char *service_desc,MYSQL *db_mysql_new); void end_curses(void); void exit_curses(int endval); *************** *** 66,69 **** --- 68,72 ---- GHashTable *groupsCache=NULL; GHashTable *hostsCache=NULL; + GHashTable *servicesCache=NULL; void init_caches(void) { *************** *** 71,74 **** --- 74,78 ---- groupsCache=g_hash_table_new(g_str_hash,g_str_equal); hostsCache=g_hash_table_new(g_str_hash,g_str_equal); + servicesCache=g_hash_table_new(g_str_hash,g_str_equal); } *************** *** 182,185 **** --- 186,236 ---- + int get_serviceId_from_desc(const char *host_name, const char *service_desc, MYSQL *p_db_mysql_new) { + int *pSid; + int Hid,Sid; + + // use combined string for querying cache + GString *gsCombined=g_string_new(""); + g_string_printf(gsCombined,"%s : %s",host_name,service_desc); + + if((Hid=get_hostId_from_name(host_name,p_db_mysql_new))==FALSE) { + return(FALSE); + } + + if((pSid=g_hash_table_lookup(servicesCache,gsCombined->str))) { + Sid=*pSid; + #ifdef DEBUG + printw("\nServiceId Cache Hit: %s -> %d\n",gsCombined->str,Sid);refresh(); + #endif + return(Sid); + } else { + MYSQL_RES *query_result_new = NULL; + MYSQL_ROW result_row_new; + GString *gsNDBSql; + gsNDBSql = g_string_new (""); + g_string_printf(gsNDBSql, "select service_id from perfdata_service where " + "host_id=%d and service_description='%s'", + Hid,service_desc); + query_result_new=dbtool_mysql_query(gsNDBSql->str, p_db_mysql_new, query_result_new); + if((result_row_new=mysql_fetch_row(query_result_new))) { + Sid=atoi(result_row_new[0]); + } else { + Sid=FALSE; + } + // cleanup + g_string_free(gsNDBSql,TRUE); + dbtool_freeResult(query_result_new); + // save result in cache + pSid=malloc(sizeof(int)); + *pSid=Sid; + g_hash_table_insert(servicesCache,(gpointer) gsCombined->str,pSid); + #ifdef DEBUG + printw("\nServiceId Cache Miss: %s -> %d\n",gsCombined->str,Sid);refresh(); + #endif + g_string_free(gsCombined,TRUE); + return(Sid); + } + } + void *************** *** 574,578 **** refresh(); ! g_string_printf(gsODBSql, "select host_name,service_description,last_perfdata_raw,raw_delete_policy,raw_delete_policy_name,raw_delete_policy_type,is_deleted from perfdata_service"); query_result_old=dbtool_mysql_query(gsODBSql->str, &db_mysql_old,query_result_old); iODBnumrows=dbtool_rows(query_result_old); --- 625,633 ---- refresh(); ! g_string_printf(gsODBSql, "select host_name,service_description," ! "last_perfdata_raw,raw_delete_policy," ! "raw_delete_policy_name," ! "raw_delete_policy_type,is_deleted " ! "from perfdata_service"); query_result_old=dbtool_mysql_query(gsODBSql->str, &db_mysql_old,query_result_old); iODBnumrows=dbtool_rows(query_result_old); *************** *** 593,597 **** printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); Hid=get_hostId_from_name(result_row_old[0],&db_mysql_new); ! g_string_printf(gsNDBSql, "insert ignore into perfdata_service(host_id,service_description,is_deleted"); g_string_printf(gsNDBSql2," values(%d,'%s',%s",Hid,result_row_old[1],result_row_old[6]); // get raw delete policy id if template --- 648,653 ---- printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); Hid=get_hostId_from_name(result_row_old[0],&db_mysql_new); ! g_string_printf(gsNDBSql, "insert ignore into perfdata_service(host_id," ! "service_description,is_deleted"); g_string_printf(gsNDBSql2," values(%d,'%s',%s",Hid,result_row_old[1],result_row_old[6]); // get raw delete policy id if template *************** *** 614,620 **** --- 670,735 ---- dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); } + //Todo: Handle last_perfdata row somewhere? Or does it "rapair itself automatically"? printw(_("\ndone\n")); refresh(); + + // Step 5 + iStep++; + printw(_("(Step %d of %d)\n"),iStep,iNumSteps); + printw(_("Copying data of perfdata_service_metric table.\n")); + refresh(); + + g_string_printf(gsODBSql, "select host_name,service_description,metric," + "unit,notes,value_max,value_min," + "last_perfdata_bin,bin_delete_policy," + "bin_delete_policy_name," + "bin_delete_policy_type,is_deleted " + "from perfdata_service_metric"); + query_result_old=dbtool_mysql_query(gsODBSql->str, &db_mysql_old,query_result_old); + iODBnumrows=dbtool_rows(query_result_old); + printw("Affected rows: %d\n",iODBnumrows);refresh(); + getyx(stdscr,y,x); + i=0; + + + while ((result_row_old=mysql_fetch_row(query_result_old))) { + i++; + int iBinPolicyId=-1; + int iBinPolicyInd=-1; + int Sid=-1; + + move(y,x); + piODBlengths=mysql_fetch_lengths(query_result_old); + + printw(_("Copying entry %d/%d"),i,iODBnumrows); refresh(); + Sid=get_serviceId_from_desc(result_row_old[0],result_row_old[1],&db_mysql_new); + g_string_printf(gsNDBSql, "insert ignore into perfdata_service_metric" + "(service_id,metric,unit,notes,value_max," + "value_min,is_deleted"); + g_string_printf(gsNDBSql2," values(%d,'%s','%s','%s',%s,%s,%s", + Sid,result_row_old[2],result_row_old[3],result_row_old[4], + result_row_old[5],result_row_old[6],result_row_old[11]); + // get bin delete policy id if template + if(strncmp(result_row_old[10],"template",4)==0) { + iBinPolicyId=get_policyId_from_name(result_row_old[9],&db_mysql_new); + g_string_append_printf(gsNDBSql,",bin_delete_policy_id"); + g_string_append_printf(gsNDBSql2,",%d",iBinPolicyId); + } else { + if(result_row_old[8]!=NULL) { + iBinPolicyInd=atoi(result_row_old[8])*86400; + g_string_append_printf(gsNDBSql,",bin_delete_policy_individual"); + g_string_append_printf(gsNDBSql2,",%d",iBinPolicyInd); + } + } + + g_string_append_printf(gsNDBSql2,")"); + g_string_append_printf(gsNDBSql,")%s",gsNDBSql2->str); + + // printw("debug: Sql Statement: %s\n",gsNDBSql->str);refresh(); + dbtool_mysql_query(gsNDBSql->str, &db_mysql_new, query_result_new); + } + printw(_("\ndone\n")); refresh(); + //TODO: End comment versioncheck *************** *** 860,862 **** } - --- 975,976 ---- |
From: Florian G. <re...@us...> - 2007-04-14 00:35:06
|
Update of /cvsroot/perfparse/_perfparse/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18924/scripts Modified Files: Makefile.in mysql_create.sql Log Message: convert perfdata_service_metric table Index: Makefile.in =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/Makefile.in,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Makefile.in 10 Apr 2007 14:36:49 -0000 1.20 --- Makefile.in 14 Apr 2007 00:34:59 -0000 1.21 *************** *** 47,60 **** $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ ! $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \ ! $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ ! $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ ! $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ ! $(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \ ! $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ ! $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/uintmax_t.m4 \ ! $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \ ! $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \ ! $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) --- 47,60 ---- $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ ! $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \ ! $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ ! $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longdouble.m4 \ ! $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \ ! $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \ ! $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \ ! $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \ ! $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ ! $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ ! $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) *************** *** 121,124 **** --- 121,125 ---- GMSGFMT = @GMSGFMT@ GOBJECT_QUERY = @GOBJECT_QUERY@ + GREP = @GREP@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ *************** *** 184,193 **** 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@ --- 185,191 ---- *************** *** 208,211 **** --- 206,212 ---- cgidir = @cgidir@ datadir = @datadir@ + datarootdir = @datarootdir@ + docdir = @docdir@ + dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ *************** *** 214,217 **** --- 215,219 ---- host_os = @host_os@ host_vendor = @host_vendor@ + htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ *************** *** 219,229 **** --- 221,234 ---- 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@ Index: mysql_create.sql =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/mysql_create.sql,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mysql_create.sql 10 Apr 2007 14:36:49 -0000 1.14 --- mysql_create.sql 14 Apr 2007 00:34:59 -0000 1.15 *************** *** 123,127 **** CREATE TABLE IF NOT EXISTS perfdata_service_metric ( ! metric_id INT PRIMARY KEY, service_id INT, metric VARCHAR(75) NOT NULL, --- 123,127 ---- CREATE TABLE IF NOT EXISTS perfdata_service_metric ( ! metric_id INT AUTO_INCREMENT PRIMARY KEY, service_id INT, metric VARCHAR(75) NOT NULL, |
From: Florian G. <re...@us...> - 2007-04-14 00:35:05
|
Update of /cvsroot/perfparse/_perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18924 Modified Files: configure Log Message: convert perfdata_service_metric table Index: configure =================================================================== RCS file: /cvsroot/perfparse/_perfparse/configure,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** configure 28 Mar 2007 22:54:26 -0000 1.24 --- configure 14 Apr 2007 00:34:58 -0000 1.25 *************** *** 28369,28375 **** CFLAGS="${CFLAGS} ${GD_CFLAGS}" ! { echo "$as_me:$LINENO: checking for gdMalloc in -lgd" >&5 ! echo $ECHO_N "checking for gdMalloc in -lgd... $ECHO_C" >&6; } ! if test "${ac_cv_lib_gd_gdMalloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else --- 28369,28375 ---- CFLAGS="${CFLAGS} ${GD_CFLAGS}" ! { echo "$as_me:$LINENO: checking for gdImageCreate in -lgd" >&5 ! echo $ECHO_N "checking for gdImageCreate in -lgd... $ECHO_C" >&6; } ! if test "${ac_cv_lib_gd_gdImageCreate+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else *************** *** 28389,28397 **** extern "C" #endif ! char gdMalloc (); int main () { ! return gdMalloc (); ; return 0; --- 28389,28397 ---- extern "C" #endif ! char gdImageCreate (); int main () { ! return gdImageCreate (); ; return 0; *************** *** 28432,28441 **** echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ! ac_cv_lib_gd_gdMalloc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ! ac_cv_lib_gd_gdMalloc=no fi --- 28432,28441 ---- echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ! ac_cv_lib_gd_gdImageCreate=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ! ac_cv_lib_gd_gdImageCreate=no fi *************** *** 28444,28450 **** LIBS=$ac_check_lib_save_LIBS fi ! { echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdMalloc" >&5 ! echo "${ECHO_T}$ac_cv_lib_gd_gdMalloc" >&6; } ! if test $ac_cv_lib_gd_gdMalloc = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGD 1 --- 28444,28450 ---- LIBS=$ac_check_lib_save_LIBS fi ! { echo "$as_me:$LINENO: result: $ac_cv_lib_gd_gdImageCreate" >&5 ! echo "${ECHO_T}$ac_cv_lib_gd_gdImageCreate" >&6; } ! if test $ac_cv_lib_gd_gdImageCreate = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGD 1 |
From: Florian G. <re...@us...> - 2007-04-11 13:43:43
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20268 Modified Files: convert.c Log Message: make cache work and cleanup Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** convert.c 10 Apr 2007 23:24:00 -0000 1.28 --- convert.c 11 Apr 2007 13:43:40 -0000 1.29 *************** *** 48,67 **** // debug ! #define DEBUG - void addIdFields (); void checkTables (); - void addTableHostGroup (void); - void addTableDeletePolicy (void); - void addTableRegistry (void); - void addTablePrefs (void); - void addTableGraphs (void); - void addTableBinSummaryDelPolicy (); - void addTableBinSummary (); - void addTableBinSummaryHeader (); - void addTableBinSummaryData (); - void addTableUsers (); - void addTableRawSummary (); - void addTableRawSummaryData (); void pp_mysql_convert_sql_failure(char*f,int l, const char*str, const char *error); MYSQL_RES *dbtool_mysql_query(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result); --- 48,54 ---- // debug ! // #define DEBUG void checkTables (); void pp_mysql_convert_sql_failure(char*f,int l, const char*str, const char *error); MYSQL_RES *dbtool_mysql_query(const char *sql, MYSQL *p_tmp_db_mysql, MYSQL_RES *p_tmp_query_result); *************** *** 112,116 **** dbtool_freeResult(query_result_new); // save result in cache ! g_hash_table_insert(policiesCache,(gpointer) policy_name,&Pid); #ifdef DEBUG printw("\nPolicyId Cache Miss: %s -> %d\n",policy_name,Pid);refresh(); --- 99,105 ---- dbtool_freeResult(query_result_new); // save result in cache ! pPid=malloc(sizeof(int)); ! *pPid=Pid; ! g_hash_table_insert(policiesCache,(gpointer) policy_name,pPid); #ifdef DEBUG printw("\nPolicyId Cache Miss: %s -> %d\n",policy_name,Pid);refresh(); *************** *** 146,150 **** dbtool_freeResult(query_result_new); // save result in cache ! g_hash_table_insert(groupsCache,(gpointer) group_name,&Gid); #ifdef DEBUG printw("\nGroupId Cache Miss: %s -> %d\n",group_name,Gid);refresh(); --- 135,141 ---- dbtool_freeResult(query_result_new); // save result in cache ! pGid=malloc(sizeof(int)); ! *pGid=Gid; ! g_hash_table_insert(groupsCache,(gpointer) group_name,pGid); #ifdef DEBUG printw("\nGroupId Cache Miss: %s -> %d\n",group_name,Gid);refresh(); *************** *** 180,184 **** dbtool_freeResult(query_result_new); // save result in cache ! g_hash_table_insert(hostsCache,(gpointer) host_name,&Hid); #ifdef DEBUG printw("\nHostId Cache Miss: %s -> %d\n",host_name,Hid);refresh(); --- 171,177 ---- dbtool_freeResult(query_result_new); // save result in cache ! pHid=malloc(sizeof(int)); ! *pHid=Hid; ! g_hash_table_insert(hostsCache,(gpointer) host_name,pHid); #ifdef DEBUG printw("\nHostId Cache Miss: %s -> %d\n",host_name,Hid);refresh(); *************** *** 625,755 **** - /* - int i_steps=20; - int i=0; - char *s_cont_step=getRegistry("dummy","pp/database/conversion_step",NULL); - int i_cont_step=0; - if(s_cont_step != NULL) { - i_cont_step=atoi(s_cont_step); - printf(_("Previous database conversion not complete. Continuing with step %d.\n"), - i_cont_step); - } - - if(i_cont_step < i_steps) { - printf (_("Warning, this stage may take some time:\n")); - } - - if(i_cont_step < i++) { - - printf (_("[Step %d/%d] Creating new group table:\n"),i,i_steps); - query ("create table perfdata_groups \ - (group_id INT AUTO_INCREMENT PRIMARY KEY, \ - group_name VARCHAR(75) UNIQUE) type=InnoDB \ - select group_name from perfdata_host_group"); - setConversionStep(i); - } - - if(i_cont_step < i++) { - printf (_("[Step %d/%d] Dropping foreign key from perfdata_host to perfdata_host_group table.\n"),i,i_steps); - if(!DropForeignKey ("perfdata_host", "perfdata_host_group")) { - printf("Foreign Key not found!\nExiting.\n"); - exit(1); - } - setConversionStep(i); - } - - if(i_cont_step < i++) { - printf (_("[Step %d/%d] Dropping table perfdata_host_group\n"),i,i_steps); - query ("drop table perfdata_host_group"); - setConversionStep(i); - } - - if(i_cont_step < i++) { - printf(_("[Step %d/%d] Creating group mapping table perfdata_host_groups\n"),i,i_steps); - query ("CREATE TABLE IF NOT EXISTS perfdata_host_groups ( \ - group_id INT, \ - FOREIGN KEY perfdata_host_groups_ibfk_1 (group_id) \ - REFERENCES perfdata_groups(group_id) ON DELETE CASCADE, \ - host_id INT, \ - FOREIGN KEY perfdata_host_groups_ibfk_2 (host_id) \ - REFERENCES perfdata_host(host_id) ON DELETE CASCADE \ - ) type=InnoDB;"); - setConversionStep(i); - } - - if(i_cont_step < i++) { - printf(_("[Step %d/%d] Filling table perfdata_host_groups\n"),i,i_steps); - query ("insert into perfdata_host_groups(group_id,host_id) \ - select g.group_id, h.host_id from perfdata_groups g,\ - perfdata_host h where g.group_name=h.group_name"); - setConversionStep(i); - } - - */ - /* - if(i_cont_step < i++) { - printf(_("[Step %d/%d] Fixing keys of perfdata_host table pt. 1\n"),i,i_steps); - if(!DropForeignKey ("perfdata_service_raw", "perfdata_host")) { - printf("Foreign Key not found!\nExiting.\n"); - exit(1); - } - setConversionStep(i); - } - - - if(i_cont_step < i++) { - printf(_("[Step %d/%d] Fixing keys of perfdata_host table pt. 2\n"),i,i_steps); - if(!DropForeignKey ("perfdata_service_metric", "perfdata_host")) { - printf("Foreign Key not found!\nExiting.\n"); - exit(1); - } - setConversionStep(i); - } - */ - /* - if(i_cont_step < i++) { - printf(_("[Step %d/%d] Fixing keys of perfdata_host table pt. 3\n"),i,i_steps); - if(!DropForeignKey ("perfdata_service", "perfdata_host")) { - printf("Foreign Key not found!\nExiting.\n"); - exit(1); - } - setConversionStep(i); - } - - if(i_cont_step < i++) { - printf(_("[Step %d/%d] Fixing keys of perfdata_host table pt. 4\n"),i,i_steps); - if(!DropKey ("perfdata_host", "host_id")) { - printf("Key not found!\nExiting.\n"); - exit(1); - } - setConversionStep(i); - } - - if(i_cont_step < i++) { - printf(_("[Step %d/%d] Fixing keys of perfdata_host table pt. 5\n"),i,i_steps); - query("alter table perfdata_host drop primary key"); - setConversionStep(i); - } - - if(i_cont_step < i++) { - printf(_("[Step %d/%d] Fixing keys of perfdata_host table pt. 6\n"),i,i_steps); - query("alter table perfdata_host add constraint unique key perfdata_host_ix0 (host_name)"); - setConversionStep(i); - } - - if(i_cont_step < i++) { - printf(_("[Step %d/%d] Fixing keys of perfdata_host table pt. 7\n"),i,i_steps); - query("alter table perfdata_host modify column host_id INT AUTO_INCREMENT PRIMARY KEY"); - setConversionStep(i); - } - - if(i_cont_step < i++) { - printf(_("[Step %d/%d] Dropping group_name from perfdata_host table\n"),i,i_steps); - query("alter table perfdata_host drop column group_name"); - setConversionStep(i); - } - - */ - //TODO: End comment versioncheck //} --- 618,621 ---- *************** *** 799,803 **** } fmtstr=malloc(10); ! sprintf(fmtstr,"%%s%d",length); echo(); getyx(stdscr,y,x); --- 665,669 ---- } fmtstr=malloc(10); ! sprintf(fmtstr,"%%s%d",(int) length); echo(); getyx(stdscr,y,x); *************** *** 900,1146 **** } - int DropKey(char *sTableName, char *sColumnName) { - GString *querystr = g_string_new (""); - GString *resultstr = g_string_new (""); - char *tmpstr; - regex_t preg_struct; - regex_t *preg = &preg_struct; - GString *regex = g_string_new (""); - size_t nmatch = 10; - regmatch_t pmatch[10]; - int i; - - - g_string_printf (querystr, "show create table %s", sTableName); - query (querystr->str); - if ((result_row = mysql_fetch_row (query_result))) - { - g_string_assign (resultstr, result_row[1]); - g_string_printf (regex, - ".*KEY `(\\S+)` \\(`%s`\\).*", // todo: exclude foreign keys - sColumnName); - i = regcomp (preg, regex->str, REG_EXTENDED | REG_ICASE); - i = regexec (preg, resultstr->str, nmatch, pmatch, - REG_NOTEOL); - if (i == REG_NOMATCH) - { - return (FALSE); - } - else - { - for (i = 1; i < nmatch; i++) // pmatch[0] contains the whole search - { - if (pmatch[i].rm_so != -1 - && pmatch[i].rm_eo != -1) - { - tmpstr = resultstr->str + pmatch[i].rm_eo; - *tmpstr = '\0'; - printf ("Match %d so: %d, eo:%d String %s\n", i, - pmatch[i].rm_so, pmatch[i].rm_eo,resultstr->str+pmatch[i].rm_so); - g_string_printf (querystr, - "ALTER TABLE %s DROP KEY %s", - sTableName, resultstr->str + pmatch[i].rm_so); - query (querystr->str); - } - } - } - } - return(TRUE); - } - - - int - DropForeignKey (char *TableName, char *ForeignTableName) - { - GString *querystr = g_string_new (""); - GString *resultstr = g_string_new (""); - char *tmpstr; - regex_t preg_struct; - regex_t *preg = &preg_struct; - GString *regex = g_string_new (""); - size_t nmatch = 10; - regmatch_t pmatch[10]; - int i; - - - g_string_printf (querystr, "show create table %s", TableName); - query (querystr->str); - if ((result_row = mysql_fetch_row (query_result))) - { - g_string_assign (resultstr, result_row[1]); - g_string_printf (regex, - ".*CONSTRAINT `(\\S+)` FOREIGN KEY \\S+ REFERENCES `%s`.*", - ForeignTableName); - i = regcomp (preg, regex->str, REG_EXTENDED | REG_ICASE); - i = regexec (preg, resultstr->str, nmatch, pmatch, - REG_NOTEOL); - if (i == REG_NOMATCH) - { - return (FALSE); - } - else - { - for (i = 1; i < nmatch; i++) // pmatch[0] contains the whole search - { - if (pmatch[i].rm_so != -1 - && pmatch[i].rm_eo != -1) - { - tmpstr = resultstr->str + pmatch[i].rm_eo; - *tmpstr = '\0'; - /*printf ("Match %d so: %d, eo:%d String %s\n", i, - * pmatch[i].rm_so, pmatch[i].rm_eo,resultstr->str+pmatch[i].rm_so); */ - g_string_printf (querystr, - "ALTER TABLE %s DROP FOREIGN KEY %s", - TableName, resultstr->str + pmatch[i].rm_so); - query (querystr->str); - } - } - } - } - return(TRUE); - } - - void - addIdFields () - /* - * Adds the host_id, service_id and metric_id - * and populates to the correct values. - * - * Magor conversion Christmas 2004, Ben. - * - */ - { - int iNext; - #ifdef USE_DB_POSTGRESQL - int numberOfRows; - #endif - - /* - * 1. Hosts - */ - - if (addField ("perfdata_host", "host_id", "INT")) - { - query_no_return - ("ALTER TABLE perfdata_host ADD UNIQUE(host_id)"); - } - - iNext = query_int ("SELECT MAX(host_id) FROM perfdata_host"); - iNext++; - - query ("SELECT host_name, host_id FROM perfdata_host"); - - #ifdef USE_DB_MYSQL - while ((result_row = mysql_fetch_row (query_result))) - { - #elif defined USE_DB_POSTGRESQL - numberOfRows = rows (); - for (currentRow = 0; currentRow < numberOfRows; currentRow++) - { - #endif - - if (iData (1) == 0) - { - g_string_printf (s_SQL, - "UPDATE perfdata_host SET host_id = %d WHERE host_name = '%s'", - iNext, sql_escape (sData (0), - PERCENT_ESCAPE_CHAR)); - query_no_return (s_SQL->str); - iNext++; - } - - } - - - /* - * 2. Services - */ - - if (addField ("perfdata_service", "service_id", "INT")) - { - query_no_return - ("ALTER TABLE perfdata_service ADD UNIQUE(service_id)"); - } - - iNext = query_int ("SELECT MAX(service_id) FROM perfdata_service"); - iNext++; - - query ("SELECT host_name, service_description, service_id FROM perfdata_service"); - - #ifdef USE_DB_MYSQL - while ((result_row = mysql_fetch_row (query_result))) - { - #elif defined USE_DB_POSTGRESQL - numberOfRows = rows (); - for (currentRow = 0; currentRow < numberOfRows; currentRow++) - { - #endif - - if (iData (2) == 0) - { - g_string_printf (s_SQL, - "UPDATE perfdata_service SET service_id = %d WHERE service_description = '%s'", - iNext, sql_escape (sData (1), - PERCENT_ESCAPE_CHAR)); - g_string_append_printf (s_SQL, - " AND host_name = '%s'", - sql_escape (sData (0), - PERCENT_ESCAPE_CHAR)); - query_no_return (s_SQL->str); - iNext++; - } - - } - - - /* - * 3. Metrics - */ - - if (addField ("perfdata_service_metric", "metric_id", "INT")) - { - query_no_return - ("ALTER TABLE perfdata_service_metric ADD UNIQUE(metric_id)"); - } - - iNext = query_int - ("SELECT MAX(metric_id) FROM perfdata_service_metric"); - iNext++; - - query ("SELECT host_name, service_description, metric, metric_id FROM perfdata_service_metric"); - - #ifdef USE_DB_MYSQL - while ((result_row = mysql_fetch_row (query_result))) - { - #elif defined USE_DB_POSTGRESQL - numberOfRows = rows (); - for (currentRow = 0; currentRow < numberOfRows; currentRow++) - { - #endif - - if (iData (3) == 0) - { - g_string_printf (s_SQL, - "UPDATE perfdata_service_metric SET metric_id = %d WHERE metric = '%s'", - iNext, sql_escape (sData (2), - PERCENT_ESCAPE_CHAR)); - g_string_append_printf (s_SQL, - " AND service_description = '%s'", - sql_escape (sData (1), - PERCENT_ESCAPE_CHAR)); - g_string_append_printf (s_SQL, - " AND host_name = '%s'", - sql_escape (sData (0), - PERCENT_ESCAPE_CHAR)); - query_no_return (s_SQL->str); - iNext++; - } - - } - - - } - - void checkTables (void) --- 766,769 ---- *************** *** 1148,1151 **** --- 771,775 ---- /* * [TODO] Make this work with PostgreSQL + * TODO: Adopt to new DB structure */ *************** *** 1205,1208 **** --- 829,833 ---- } + /* if (!bHostGroup) addTableHostGroup (); *************** *** 1230,1233 **** --- 855,859 ---- if (!bRawSummaryData) addTableRawSummaryData (); + */ #endif *************** *** 1235,1535 **** } - void - addTableBinSummaryDelPolicy () - { - - g_string_assign (s_SQL, - "CREATE TABLE IF NOT EXISTS perfdata_bin_summary_del_policy (" - " policy_name VARCHAR(20) NOT NULL PRIMARY KEY," - " delete_policy INT DEFAULT NULL" - " ) type=InnoDB"); - query_no_return (s_SQL->str); - } - - - void - addTableBinSummary () - { - - g_string_assign (s_SQL, - "CREATE TABLE IF NOT EXISTS perfdata_bin_summary (" - " frequency INT NOT NULL," - " PRIMARY KEY (frequency)," - " notes TEXT NOT NULL DEFAULT ''," - " is_deleted TINYINT NOT NULL DEFAULT 0," - " default_delete INT NOT NULL DEFAULT 1000" - " ) type=InnoDB"); - query_no_return (s_SQL->str); - - } - - - void - addTableBinSummaryHeader () - { - - g_string_assign (s_SQL, - "CREATE TABLE IF NOT EXISTS perfdata_bin_summary_header (" - " metric_id INT NOT NULL," - " frequency INT NOT NULL," - " PRIMARY KEY (metric_id, frequency)," - " FOREIGN KEY (metric_id)" - " REFERENCES perfdata_service_metric (metric_id)" - " ON DELETE RESTRICT," - " INDEX frequency_idx (frequency)," - " FOREIGN KEY (frequency)" - " REFERENCES perfdata_bin_summary (frequency)" - " ON DELETE RESTRICT," - " last_data INTEGER," - " bin_delete_policy INTEGER DEFAULT NULL," - " bin_delete_policy_name VARCHAR(20) DEFAULT NULL," - " bin_delete_policy_type ENUM('template','user') NOT NULL," - " is_deleted TINYINT DEFAULT 0" - " ) type=InnoDB"); - query_no_return (s_SQL->str); - - } - - - void - addTableBinSummaryData () - { - g_string_assign (s_SQL, - "CREATE TABLE IF NOT EXISTS perfdata_bin_summary_data (" - " metric_id INT NOT NULL," - " frequency INT NOT NULL," - " ctime DATETIME NOT NULL," - " PRIMARY KEY (metric_id, frequency, ctime)," - " FOREIGN KEY (metric_id, frequency)" - " REFERENCES perfdata_bin_summary_header (metric_id, frequency)" - " ON DELETE RESTRICT," - " val_count INTEGER NOT NULL DEFAULT 0," - " sum_val DOUBLE NOT NULL," - " sum_square_val DOUBLE NOT NULL," - " max_val DOUBLE NOT NULL," - " min_val DOUBLE NOT NULL," - " max_warn DOUBLE NOT NULL," - " min_warn DOUBLE NOT NULL," - " max_critical DOUBLE NOT NULL," - " min_critical DOUBLE NOT NULL" - " ) type=InnoDB"); - query_no_return (s_SQL->str); - - } - - - - void - addTablePrefs (void) - { - g_string_assign (s_SQL, "CREATE TABLE IF NOT EXISTS perfdata_prefs (" - " user VARCHAR(20) NOT NULL PRIMARY KEY," - " group_name VARCHAR(75)," - " INDEX host_ix0 (group_name)," - " FOREIGN KEY (group_name) REFERENCES perfdata_host_group (group_name) ON DELETE SET NULL" - " ) type=InnoDB"); - query_no_return (s_SQL->str); - } - - void - addTableGraphs (void) - { - g_string_assign (s_SQL, "CREATE TABLE IF NOT EXISTS perfdata_graphs (" - " id INT PRIMARY KEY NOT NULL AUTO_INCREMENT," - " group_name VARCHAR(75)," - " INDEX host_ix0 (group_name)," - " FOREIGN KEY (group_name) REFERENCES perfdata_host_group (group_name) ON DELETE SET NULL," - " title VARCHAR(80)," - " descript TEXT," - " url TEXT" - " ) type=InnoDB"); - query_no_return (s_SQL->str); - } - - void - addTableRegistry (void) - { - g_string_assign (s_SQL, - "CREATE TABLE IF NOT EXISTS perfdata_registry (" - " host VARCHAR(75) DEFAULT NULL," - " rkey VARCHAR(80) NOT NULL," - " PRIMARY KEY (host, rkey)," - " rvalue TEXT," - " ctime DATETIME NOT NULL " - " ) type=InnoDB"); - query_no_return (s_SQL->str); - } - - void - addTableUsers (void) - { - g_string_assign (s_SQL, "CREATE TABLE IF NOT EXISTS perfdata_users (" - " user_name VARCHAR(20) NOT NULL," - " PRIMARY KEY (user_name)," - " password VARCHAR(20)," - " group_name VARCHAR(75)" - " REFERENCES perfdata_host_group (group_name)" - " ON DELETE SET NULL," - " raw_show_normal TINYINT NOT NULL DEFAULT 1," - " raw_show_warning TINYINT NOT NULL DEFAULT 1," - " raw_show_critical TINYINT NOT NULL DEFAULT 1," - " raw_show_unknown TINYINT NOT NULL DEFAULT 1," - " raw_refresh_time INT NOT NULL DEFAULT 0" - " ) type=InnoDB"); - query_no_return (s_SQL->str); - } - - - void - addTableHostGroup (void) - { - - - /* - * Add new host group table and link - */ - query_no_return - ("CREATE TABLE IF NOT EXISTS perfdata_host_group ( group_name VARCHAR(75) PRIMARY KEY) type=InnoDB"); - addField ("perfdata_host", "group_name", "VARCHAR(75)"); - query_no_return - ("ALTER TABLE perfdata_host ADD INDEX host_ix0 (group_name)"); - query_no_return - ("ALTER TABLE perfdata_host ADD FOREIGN KEY (group_name) REFERENCES perfdata_host_group(group_name) ON DELETE SET NULL"); - - - - } - - void - addTableDeletePolicy (void) - { - /* - * Field added in 0.06 and removed in 0.08 - */ - dropField ("perfdata_service_raw", "delete_policy"); - - /* - * Fields added in 0.11 - */ - query_no_return - ("CREATE TABLE IF NOT EXISTS perfdata_delete_policy ( " - "policy_name VARCHAR(20) NOT NULL PRIMARY KEY, " - "delete_policy INT DEFAULT NULL " ") TYPE=InnoDB"); - - /* - * table perfdata_host - */ - addField ("perfdata_host", "raw_delete_policy", - "INTEGER DEFAULT NULL"); - addField ("perfdata_host", "raw_delete_policy_name", - "VARCHAR(20) DEFAULT NULL"); - addField ("perfdata_host", "raw_delete_policy_type", - "ENUM('user','template') NOT NULL"); - query_no_return - ("ALTER TABLE perfdata_host ADD INDEX host_ix1 (raw_delete_policy_name)"); - query_no_return ("ALTER TABLE perfdata_host ADD " - "FOREIGN KEY (raw_delete_policy_name) " - "REFERENCES perfdata_delete_policy(policy_name) " - "ON DELETE SET NULL"); - - addField ("perfdata_host", "bin_delete_policy", - "INTEGER DEFAULT NULL"); - addField ("perfdata_host", "bin_delete_policy_name", - "VARCHAR(20) DEFAULT NULL"); - addField ("perfdata_host", "bin_delete_policy_type", - "ENUM('user','template') NOT NULL"); - query_no_return - ("ALTER TABLE perfdata_host ADD INDEX host_ix2 (bin_delete_policy_name)"); - query_no_return ("ALTER TABLE perfdata_host ADD " - "FOREIGN KEY (bin_delete_policy_name) " - "REFERENCES perfdata_delete_policy(policy_name) " - "ON DELETE SET NULL"); - query_no_return - ("UPDATE perfdata_host SET raw_delete_policy_type='template'"); - query_no_return - ("UPDATE perfdata_host SET bin_delete_policy_type='template'"); - - addField ("perfdata_host", "is_deleted", "TINYINT DEFAULT 0"); - - /* - * table perfdata_service - */ - addField ("perfdata_service", "raw_delete_policy", - "INTEGER DEFAULT NULL"); - addField ("perfdata_service", "raw_delete_policy_name", - "VARCHAR(20) DEFAULT NULL"); - addField ("perfdata_service", "raw_delete_policy_type", - "ENUM('template','user','host') NOT NULL"); - query_no_return - ("ALTER TABLE perfdata_service ADD INDEX service_ix2 (raw_delete_policy_name)"); - query_no_return ("ALTER TABLE perfdata_service ADD " - "FOREIGN KEY (raw_delete_policy_name) " - "REFERENCES perfdata_delete_policy(policy_name) " - "ON DELETE SET NULL"); - query_no_return - ("UPDATE perfdata_service SET raw_delete_policy=delete_policy, raw_delete_policy_type='user'"); - dropField ("perfdata_service", "delete_policy"); - - addField ("perfdata_service", "is_deleted", "TINYINT DEFAULT 0"); - - /* - * table perfdata_service_metric - */ - addField ("perfdata_service_metric", "bin_delete_policy", - "INTEGER DEFAULT NULL"); - addField ("perfdata_service_metric", "bin_delete_policy_name", - "VARCHAR(20) DEFAULT NULL"); - addField ("perfdata_service_metric", "bin_delete_policy_type", - "ENUM('template','user','host') NOT NULL"); - query_no_return - ("ALTER TABLE perfdata_service_metric ADD INDEX metric_ix2 (bin_delete_policy_name)"); - query_no_return ("ALTER TABLE perfdata_service_metric ADD " - "FOREIGN KEY (bin_delete_policy_name) " - "REFERENCES perfdata_delete_policy(policy_name) " - "ON DELETE SET NULL"); - query_no_return - ("UPDATE perfdata_service_metric SET bin_delete_policy=delete_policy, bin_delete_policy_type='user'"); - dropField ("perfdata_service_metric", "delete_policy"); - - addField ("perfdata_service_metric", "is_deleted", - "TINYINT DEFAULT 0"); - - } - - void - addTableRawSummary () - { - - g_string_assign (s_SQL, - "CREATE TABLE IF NOT EXISTS perfdata_raw_summary (" - "service_id INT NOT NULL," "epoch INT NOT NULL," - "last_ctime INT default NULL," - "last_nagios_status INT default NULL," - "PRIMARY KEY (service_id, epoch)," - "FOREIGN KEY (service_id)" - " REFERENCES perfdata_service (service_id)" - ") TYPE=InnoDB"); - query_no_return (s_SQL->str); - - } - - void - addTableRawSummaryData () - { - - g_string_assign (s_SQL, - "CREATE TABLE IF NOT EXISTS perfdata_raw_summary_data (" - "service_id INT NOT NULL ," "epoch INT NOT NULL ," - "epoch_start INT NOT NULL ," - "last_ctime INT NOT NULL ," - "last_nagios_status INT default NULL," - "count INT NOT NULL ," "sum_uptime INT NOT NULL ," - "sum_warntime INT NOT NULL ," - "sum_criticaltime INT NOT NULL ," - "sum_undeftime INT NOT NULL ," - "PRIMARY KEY (service_id,epoch,epoch_start)," - "FOREIGN KEY (service_id, epoch) REFERENCES perfdata_raw_summary (service_id, epoch)" - ") TYPE=InnoDB"); - - query_no_return (s_SQL->str); - } --- 861,862 ---- |
From: Florian G. <re...@us...> - 2007-04-11 08:24:30
|
Update of /cvsroot/perfparse/_perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27357 Modified Files: configure.ac Log Message: check for official supported gd function Index: configure.ac =================================================================== RCS file: /cvsroot/perfparse/_perfparse/configure.ac,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** configure.ac 28 Mar 2007 22:54:27 -0000 1.22 --- configure.ac 11 Apr 2007 08:24:29 -0000 1.23 *************** *** 267,271 **** LDFLAGS="${LDFLAGS} ${GD_LIBS}" CFLAGS="${CFLAGS} ${GD_CFLAGS}" ! AC_CHECK_LIB(gd,gdMalloc,,AC_MSG_ERROR(required library libgd unusable. Install required and dependent files and rerun configure. See config.log or FAQs for details.)) --- 267,271 ---- LDFLAGS="${LDFLAGS} ${GD_LIBS}" CFLAGS="${CFLAGS} ${GD_CFLAGS}" ! AC_CHECK_LIB(gd,gdImageCreate,,AC_MSG_ERROR(required library libgd unusable. Install required and dependent files and rerun configure. See config.log or FAQs for details.)) |
From: Florian G. <re...@us...> - 2007-04-10 23:24:08
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17070/db_tools Modified Files: convert.c Log Message: debug code Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** convert.c 10 Apr 2007 15:03:27 -0000 1.27 --- convert.c 10 Apr 2007 23:24:00 -0000 1.28 *************** *** 47,50 **** --- 47,53 ---- #define SERVICE "service" + // debug + #define DEBUG + void addIdFields (); void checkTables (); *************** *** 89,92 **** --- 92,98 ---- if((pPid=g_hash_table_lookup(policiesCache,policy_name))) { Pid=*pPid; + #ifdef DEBUG + printw("\nPolicyId Cache Hit: %s -> %d\n",policy_name,Pid);refresh(); + #endif return(Pid); } else { *************** *** 107,111 **** // save result in cache g_hash_table_insert(policiesCache,(gpointer) policy_name,&Pid); ! return(Pid); } --- 113,119 ---- // save result in cache g_hash_table_insert(policiesCache,(gpointer) policy_name,&Pid); ! #ifdef DEBUG ! printw("\nPolicyId Cache Miss: %s -> %d\n",policy_name,Pid);refresh(); ! #endif return(Pid); } *************** *** 118,121 **** --- 126,132 ---- if((pGid=g_hash_table_lookup(groupsCache,group_name))) { Gid=*pGid; + #ifdef DEBUG + printw("\nGroupId Cache Hit: %s -> %d\n",group_name,Gid);refresh(); + #endif return(Gid); } else { *************** *** 136,140 **** // save result in cache g_hash_table_insert(groupsCache,(gpointer) group_name,&Gid); ! return(Gid); } --- 147,153 ---- // save result in cache g_hash_table_insert(groupsCache,(gpointer) group_name,&Gid); ! #ifdef DEBUG ! printw("\nGroupId Cache Miss: %s -> %d\n",group_name,Gid);refresh(); ! #endif return(Gid); } *************** *** 147,150 **** --- 160,166 ---- if((pHid=g_hash_table_lookup(hostsCache,host_name))) { Hid=*pHid; + #ifdef DEBUG + printw("\nHostId Cache Hit: %s -> %d\n",host_name,Hid);refresh(); + #endif return(Hid); } else { *************** *** 165,169 **** // save result in cache g_hash_table_insert(hostsCache,(gpointer) host_name,&Hid); ! return(Hid); } --- 181,187 ---- // save result in cache g_hash_table_insert(hostsCache,(gpointer) host_name,&Hid); ! #ifdef DEBUG ! printw("\nHostId Cache Miss: %s -> %d\n",host_name,Hid);refresh(); ! #endif return(Hid); } *************** *** 762,765 **** --- 780,785 ---- void exit_curses(int exitval) { + printw(_("Exiting in 10 Sec.")); refresh(); + sleep(10); end_curses(); exit(exitval); |
From: Florian G. <re...@us...> - 2007-04-10 15:03:28
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18251 Modified Files: convert.c Log Message: fix double free and disabled version check Index: convert.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/convert.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** convert.c 9 Apr 2007 22:39:09 -0000 1.26 --- convert.c 10 Apr 2007 15:03:27 -0000 1.27 *************** *** 97,101 **** g_string_printf(gsNDBSql, "select policy_id from perfdata_delete_policy where policy_name='%s'",policy_name); query_result_new=dbtool_mysql_query(gsNDBSql->str, p_db_mysql_new, query_result_new); - g_string_free(gsNDBSql,TRUE); if((result_row_new=mysql_fetch_row(query_result_new))) { Pid=atoi(result_row_new[0]); --- 97,100 ---- *************** *** 127,131 **** g_string_printf(gsNDBSql, "select group_id from perfdata_groups where group_name='%s'",group_name); query_result_new=dbtool_mysql_query(gsNDBSql->str, p_db_mysql_new, query_result_new); - g_string_free(gsNDBSql,TRUE); if((result_row_new=mysql_fetch_row(query_result_new))) { Gid=atoi(result_row_new[0]); --- 126,129 ---- *************** *** 215,218 **** --- 213,219 ---- * Get the version from the database */ + + // TODO: Do version check after mysql login data are provided + /* version = getVersion (); *************** *** 223,229 **** exit(1); } ! if (version < 0.20) ! { char yesno; --- 224,231 ---- exit(1); } + */ ! //if (version < 0.20) ! //{ char yesno; *************** *** 731,735 **** */ ! } /* --- 733,739 ---- */ ! ! //TODO: End comment versioncheck ! //} /* |
From: Florian G. <re...@us...> - 2007-04-10 14:36:50
|
Update of /cvsroot/perfparse/_perfparse/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7656 Modified Files: Makefile.in mysql_create.sql Log Message: typo Index: Makefile.in =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/Makefile.in,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Makefile.in 28 Mar 2007 22:54:29 -0000 1.19 --- Makefile.in 10 Apr 2007 14:36:49 -0000 1.20 *************** *** 47,60 **** $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ ! $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lcmessage.m4 \ ! $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ ! $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/longdouble.m4 \ ! $(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/nls.m4 \ ! $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/printf-posix.m4 \ ! $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/signed.m4 \ ! $(top_srcdir)/m4/size_max.m4 $(top_srcdir)/m4/stdint_h.m4 \ ! $(top_srcdir)/m4/uintmax_t.m4 $(top_srcdir)/m4/ulonglong.m4 \ ! $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wint_t.m4 \ ! $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) --- 47,60 ---- $(top_srcdir)/m4/intmax.m4 $(top_srcdir)/m4/inttypes-pri.m4 \ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/inttypes_h.m4 \ ! $(top_srcdir)/m4/lcmessage.m4 $(top_srcdir)/m4/lib-ld.m4 \ ! $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ ! $(top_srcdir)/m4/longdouble.m4 $(top_srcdir)/m4/longlong.m4 \ ! $(top_srcdir)/m4/nls.m4 $(top_srcdir)/m4/po.m4 \ ! $(top_srcdir)/m4/printf-posix.m4 $(top_srcdir)/m4/progtest.m4 \ ! $(top_srcdir)/m4/signed.m4 $(top_srcdir)/m4/size_max.m4 \ ! $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/uintmax_t.m4 \ ! $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/wchar_t.m4 \ ! $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xsize.m4 \ ! $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) *************** *** 121,125 **** GMSGFMT = @GMSGFMT@ GOBJECT_QUERY = @GOBJECT_QUERY@ - GREP = @GREP@ HAVE_ASPRINTF = @HAVE_ASPRINTF@ HAVE_POSIX_PRINTF = @HAVE_POSIX_PRINTF@ --- 121,124 ---- *************** *** 185,191 **** --- 184,193 ---- 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@ *************** *** 206,212 **** cgidir = @cgidir@ datadir = @datadir@ - datarootdir = @datarootdir@ - docdir = @docdir@ - dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ --- 208,211 ---- *************** *** 215,219 **** host_os = @host_os@ host_vendor = @host_vendor@ - htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ --- 214,217 ---- *************** *** 221,234 **** 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@ --- 219,229 ---- Index: mysql_create.sql =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/mysql_create.sql,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mysql_create.sql 3 Apr 2007 22:21:07 -0000 1.13 --- mysql_create.sql 10 Apr 2007 14:36:49 -0000 1.14 *************** *** 75,79 **** CREATE TABLE IF NOT EXISTS perfdata_service ( ! service_id INT AUTO_IMCREMENT PRIMARY KEY, host_id INT NOT NULL, service_description VARCHAR(75) NOT NULL, --- 75,79 ---- CREATE TABLE IF NOT EXISTS perfdata_service ( ! service_id INT AUTO_INCREMENT PRIMARY KEY, host_id INT NOT NULL, service_description VARCHAR(75) NOT NULL, |
From: Florian G. <re...@us...> - 2007-04-09 22:39:10
|
Update of /cvsroot/perfparse/_perfparse/libpp_mysql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22056/libpp_mysql Modified Files: dbms.c Log Message: fixed some mem leaks Index: dbms.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/libpp_mysql/dbms.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dbms.c 22 Aug 2006 15:23:27 -0000 1.4 --- dbms.c 9 Apr 2007 22:39:09 -0000 1.5 *************** *** 3,7 **** * dbms.c - Common functions required by PerfParse suit. * ! * Copyright (c) 2004 Ben Clewett (per...@cl...) * * $Id$ --- 3,8 ---- * dbms.c - Common functions required by PerfParse suit. * ! * Copyright (c) 2004-2007 Ben Clewett (per...@cl...) and ! * Florian Gleixner * * $Id$ *************** *** 395,397 **** } - --- 396,397 ---- |
From: Florian G. <re...@us...> - 2007-04-09 22:39:10
|
Update of /cvsroot/perfparse/_perfparse/libpp_common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22056/libpp_common Modified Files: config_file.c Log Message: fixed some mem leaks Index: config_file.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/libpp_common/config_file.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** config_file.c 17 Aug 2006 13:57:17 -0000 1.3 --- config_file.c 9 Apr 2007 22:39:09 -0000 1.4 *************** *** 3,8 **** * config_file.c - API to the config file used by PerfParse suit. * ! * Copyright (c) 2004 Yves Mettier <yme...@li...> ! * Last Modified: 2004-06-11 * Copyright change with Ben Clewett agreement (2004-07-28) * --- 3,11 ---- * config_file.c - API to the config file used by PerfParse suit. * ! * Copyright (c) 2004-2007 Yves Mettier <yme...@li...> ! * and Florian Gleixner ! * ! * $Id$ ! * * Copyright change with Ben Clewett agreement (2004-07-28) * |