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-12-08 21:25:29
|
Update of /cvsroot/perfparse/_perfparse/perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13206/perfparse Modified Files: log_reader.c storage.c Log Message: Rework periodic cleanup within storage module (perfparsed) Index: log_reader.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/perfparse/log_reader.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** log_reader.c 6 Jun 2007 09:53:14 -0000 1.6 --- log_reader.c 8 Dec 2007 21:25:30 -0000 1.7 *************** *** 569,581 **** void sig_handler(int n) { - char *sigstr[] = {"SIGINT","SIGTERM", N_("Unexpected signal")}; - int sigstrid; - switch(n) { - case SIGINT: sigstrid = 0; break; - case SIGTERM: sigstrid = 1; break; - default: sigstrid = 2; - } close_all_log_sources(); ! pp_log(__FILE__,__LINE__,LOG_WARNING, _("Caught signal (%s)"),gettext(sigstr[sigstrid])); exit(EXIT_FAILURE); } --- 569,578 ---- void sig_handler(int n) { close_all_log_sources(); ! #ifdef _GNU_SOURCE ! pp_log(__FILE__,__LINE__,LOG_WARNING, _("Caught signal %d: %s"),n,gettext(strsignal(n))); ! #else ! pp_log(__FILE__,__LINE__,LOG_WARNING, _("Caught signal %d"),n); ! #endif exit(EXIT_FAILURE); } Index: storage.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/perfparse/storage.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** storage.c 30 Jul 2007 22:32:06 -0000 1.6 --- storage.c 8 Dec 2007 21:25:30 -0000 1.7 *************** *** 281,298 **** if(config_get_value_as_boolean(CONFIG_ITEM_ID_DROP_FILE_ROTATE)) { /* Drop file */ ! pp_log(__FILE__,__LINE__,LOG_INFO, _("Perfparsed : periodic cleanup of dropfile\n")); check_dir_for_files_to_remove_or_compress(config_get_value_as_integer(CONFIG_ITEM_ID_DROP_FILE_KEEP_N_DAYS),config_get_value_as_string(CONFIG_ITEM_ID_DROP_FILE),NULL); } /* Module periodic_cleanup procedures */ for(this=storage_modules; this; this = this->next) { ! pp_log(__FILE__,__LINE__,LOG_INFO, _("Perfparsed : periodic cleanup of storage modules\n")); if(this->module->enabled && this->module->periodic_cleanup) { ! pp_log(__FILE__,__LINE__,LOG_INFO, _("Perfparsed : periodic cleanup of storage module %s\n")); ! this->module->periodic_cleanup(this->module);} ! else { ! pp_log(__FILE__,__LINE__,LOG_INFO, _("Perfparsed : periodic cleanup of storage module %s not supported or module disabled\n"),this->module->id); ! } } ! pp_log(__FILE__,__LINE__,LOG_INFO, _("Perfparsed : periodic cleanup finished\n"),this->module->id); if(config_get_value_as_boolean(CONFIG_ITEM_ID_DAEMONIZE)) { exit(EXIT_SUCCESS); --- 281,298 ---- if(config_get_value_as_boolean(CONFIG_ITEM_ID_DROP_FILE_ROTATE)) { /* Drop file */ ! pp_log(__FILE__,__LINE__,LOG_INFO, _("Perfparsed : periodic cleanup of dropfile\n")); check_dir_for_files_to_remove_or_compress(config_get_value_as_integer(CONFIG_ITEM_ID_DROP_FILE_KEEP_N_DAYS),config_get_value_as_string(CONFIG_ITEM_ID_DROP_FILE),NULL); } /* Module periodic_cleanup procedures */ for(this=storage_modules; this; this = this->next) { ! pp_log(__FILE__,__LINE__,LOG_INFO, _("Perfparsed : periodic cleanup of storage modules\n")); if(this->module->enabled && this->module->periodic_cleanup) { ! pp_log(__FILE__,__LINE__,LOG_INFO, _("Perfparsed : periodic cleanup of storage module %s\n")); ! this->module->periodic_cleanup(this->module);} ! else { ! pp_log(__FILE__,__LINE__,LOG_INFO, _("Perfparsed : periodic cleanup of storage module %s not supported or module disabled\n"),this->module->id); ! } } ! pp_log(__FILE__,__LINE__,LOG_INFO, _("Perfparsed : periodic cleanup finished\n"),this->module->id); if(config_get_value_as_boolean(CONFIG_ITEM_ID_DAEMONIZE)) { exit(EXIT_SUCCESS); |
From: Florian G. <re...@us...> - 2007-12-08 21:25:29
|
Update of /cvsroot/perfparse/_perfparse/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13206/modules Modified Files: libstorage.c storage_mysql.c Log Message: Rework periodic cleanup within storage module (perfparsed) Index: libstorage.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/modules/libstorage.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** libstorage.c 24 Aug 2006 11:31:59 -0000 1.2 --- libstorage.c 8 Dec 2007 21:25:30 -0000 1.3 *************** *** 3,8 **** * libstorage.c - Parse Nagios data and store in relational database. * ! * Copyright (c) 2004 Yves Mettier (yme...@li...) ! * * $Id$ * --- 3,9 ---- * libstorage.c - Parse Nagios data and store in relational database. * ! * Copyright (c) 2004-2007 Yves Mettier (yme...@li...) ! * Florian Gleixner ! * * $Id$ * *************** *** 36,40 **** * \brief Register a storage module * ! * The function storage_new hast to be called if a storage module * shall be initialized. * --- 37,41 ---- * \brief Register a storage module * ! * The function storage_new has to be called if a storage module * shall be initialized. * Index: storage_mysql.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/modules/storage_mysql.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** storage_mysql.c 6 Jun 2007 13:08:31 -0000 1.14 --- storage_mysql.c 8 Dec 2007 21:25:30 -0000 1.15 *************** *** 66,69 **** --- 66,73 ---- void storage_mysql_print_statistics(storage_module_t *, FILE*); void storage_mysql_print_usage(storage_module_t *this, FILE*fd, const char*id); + void storage_mysql_periodic_cleanup(storage_module_t *); + + void purge_all_metricid_data(int); + void purge_all_serviceid_data(int); static int validate_host(storage_module_t*this, const char *); *************** *** 105,108 **** --- 109,113 ---- sm->print_statistics = storage_mysql_print_statistics; sm->print_usage = storage_mysql_print_usage; + sm->periodic_cleanup = storage_mysql_periodic_cleanup; sm->enabled = 1; sm->params = malloc(sizeof(mysql_user_params_t)); *************** *** 126,132 **** /* Open MySQL */ now_connect(TRUE); ! #ifdef DEBUG ! printf("MySQL: %s\n", query_char("SELECT VERSION()")); ! #endif /* Setup binary trees */ --- 131,135 ---- /* Open MySQL */ now_connect(TRUE); ! pp_log(__FILE__,__LINE__,LOG_DEBUG,"MySQL version: %s\n", query_char("SELECT VERSION()")); /* Setup binary trees */ *************** *** 276,283 **** int storage_mysql_set_registry(storage_module_t *this, const char*hostname, const char*key, const char*value, time_t tm) { ! #ifdef DEBUG_REGISTRY ! printf("MY(set_registry) %ld '%s/%s' = '%s'\n", tm,hostname,key,value); ! #endif ! setRegistry(hostname, key, value, tm); --- 279,283 ---- int storage_mysql_set_registry(storage_module_t *this, const char*hostname, const char*key, const char*value, time_t tm) { ! pp_log(__FILE__,__LINE__,LOG_DEBUG,"setRegistry: %ld '%s/%s' = '%s'\n", tm,hostname,key,value); setRegistry(hostname, key, value, tm); *************** *** 356,359 **** --- 356,425 ---- } + void storage_mysql_periodic_cleanup(storage_module_t*this) { + /* delete all data of objects that are marked as deleted */ + GSList *tmplist2,*tmplist=NULL; + int *p=NULL; + + // connect again to mysql since this is a forked process + now_connect(TRUE); + pp_log(__FILE__,__LINE__,LOG_DEBUG,"MySQL version: %s\n", query_char("SELECT VERSION()")); + + // find metric ids to delete completely + g_string_printf(s_SQL, "SELECT metric_id from perfdata_service_metric where is_deleted=1"); + query(s_SQL->str); + + while ((result_row = mysql_fetch_row(query_result))) { + p = (int *)malloc(sizeof(int)); + *p = iData(0); + pp_log(__FILE__,__LINE__,LOG_DEBUG,"metric_id %d is marked for deletion\n",iData(0)); + tmplist=g_slist_append(tmplist,p); + } + + tmplist2=tmplist; + while(tmplist2) { + purge_all_metricid_data(*(int *)tmplist2->data); + tmplist2=g_slist_next(tmplist2); + } + + g_slist_free(tmplist); + tmplist2=tmplist=NULL; + + // find service ids to delete completely + g_string_printf(s_SQL, "SELECT service_id from perfdata_service where is_deleted=1"); + query(s_SQL->str); + + while ((result_row = mysql_fetch_row(query_result))) { + p = (int *)malloc(sizeof(int)); + *p = iData(0); + pp_log(__FILE__,__LINE__,LOG_DEBUG,"service_id %d is marked for deletion\n",iData(0)); + tmplist=g_slist_append(tmplist,p); + } + + tmplist2=tmplist; + while(tmplist2) { + purge_all_serviceid_data(*(int *)tmplist2->data); + tmplist2=g_slist_next(tmplist2); + } + + g_slist_free(tmplist); + tmplist2=tmplist=NULL; + + + /* walk through all services and metrics and purge old data */ + + // raw data + typedef struct struct_sid_policyinfo { + int iServiceId; + int iHostId; + char sPolicyName[21]; + int iPolicySeconds; + int iRawDelPolicy} sid_policyinfo; + + g_string_printf(s_SQL,"SELECT service_id,host_id,policy_name,delete_policy_seconds,raw_delete_policy_individual FROM perfdata_service s LEFT JOIN perfdata_delete_policy d ON s.raw_delete_policy_id=d.policy_id"); + + pp_log(__FILE__,__LINE__,LOG_DEBUG,"Closing mysql connection\n"); + mysql_close(&db_mysql); + } + /******************************************************** * *************** *** 362,365 **** --- 428,443 ---- *******************************************************/ + void purge_all_metricid_data(int iMid) { + pp_log(__FILE__,__LINE__,LOG_INFO,"Deleting all data from metric id %d\n",iMid); + g_string_printf(s_SQL,"DELETE from perfdata_service_bin WHERE metric_id=%d",iMid); + query_no_return(s_SQL->str); + } + + void purge_all_serviceid_data(int iSid) { + pp_log(__FILE__,__LINE__,LOG_INFO,"Deleting all data from service id %d\n",iSid); + g_string_printf(s_SQL,"DELETE from perfdata_service_raw WHERE service_id=%d",iSid); + query_no_return(s_SQL->str); + } + /******************************************************** |
From: Florian G. <re...@us...> - 2007-12-08 21:25:29
|
Update of /cvsroot/perfparse/_perfparse/libpp_mysql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13206/libpp_mysql Modified Files: dbms.c Log Message: Rework periodic cleanup within storage module (perfparsed) Index: dbms.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/libpp_mysql/dbms.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** dbms.c 12 Aug 2007 00:11:45 -0000 1.7 --- dbms.c 8 Dec 2007 21:25:30 -0000 1.8 *************** *** 94,98 **** void pp_mysql_default_sql_failure(char*f,int l, const char*str, const char *error) { ! pp_log(f,l,LOG_ERROR,"%s (%s)",str,error); exit(EXIT_FAILURE); } --- 94,98 ---- void pp_mysql_default_sql_failure(char*f,int l, const char*str, const char *error) { ! pp_log(f,l,LOG_ERROR,"SQL Error in query: '%s' Error message: '%s'",str,error); exit(EXIT_FAILURE); } *************** *** 104,111 **** void libpp_mysql_query(char*file, int line, const char *sql) { ! #ifdef SHOW_SQL ! printf("SQL: \"%s\"\n", sql); ! fflush(stdout); ! #endif freeResult(); --- 104,109 ---- void libpp_mysql_query(char*file, int line, const char *sql) { ! ! pp_log(__FILE__,__LINE__,LOG_DEBUG,"SQL execution: \"%s\"\n", sql); freeResult(); *************** *** 117,125 **** query_result = mysql_store_result(&db_mysql); ! #ifdef SHOW_SQL ! printf("Rows: %d\n", rows()); ! fflush(stdout); ! #endif ! iSQLCount++; } --- 115,121 ---- query_result = mysql_store_result(&db_mysql); ! ! pp_log(__FILE__,__LINE__,LOG_DEBUG,"Rows: %d\n", rows()); ! iSQLCount++; } *************** *** 160,168 **** MYSQL_ROW row; ! #ifdef SHOW_SQL ! printf("SQL: \"%s\"\n", sql); ! fflush(stdout); ! #endif ! if (sRet) free(sRet); --- 156,161 ---- MYSQL_ROW row; ! pp_log(__FILE__,__LINE__,LOG_DEBUG,"SQL: \"%s\"\n", sql); ! if (sRet) free(sRet); |
From: Florian G. <re...@us...> - 2007-12-03 20:39:02
|
Update of /cvsroot/perfparse/_perfparse-phpgui/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18809/templates Modified Files: saved_graphs.tpl.html Log Message: delete saved graphs is possible now Index: saved_graphs.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/saved_graphs.tpl.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** saved_graphs.tpl.html 12 Aug 2007 00:11:45 -0000 1.5 --- saved_graphs.tpl.html 3 Dec 2007 20:39:04 -0000 1.6 *************** *** 59,63 **** <td bgcolor="#FFFFFF"><font face="Arial, Helvetica" size=2> <{$item.id}> </font></td> <td bgcolor="#FFFFFF"><font face="Arial, Helvetica" size=2> <{$item.title}> </font></td> ! <td bgcolor="#FFFFFF" align=center><font face="Arial, Helvetica" size=2> <a href="perfparse.php?page=saved_graphs&view=<{$item.id}>"><{tr}>View<{/tr}></a> </font></td> </tr> <{/foreach}> --- 59,63 ---- <td bgcolor="#FFFFFF"><font face="Arial, Helvetica" size=2> <{$item.id}> </font></td> <td bgcolor="#FFFFFF"><font face="Arial, Helvetica" size=2> <{$item.title}> </font></td> ! <td bgcolor="#FFFFFF" align=center><font face="Arial, Helvetica" size=2> <a href="perfparse.php?page=saved_graphs&view=<{$item.id}>"><{tr}>View<{/tr}></a> <a href="perfparse.php?page=saved_graphs&delete=<{$item.id}>"><{tr}>Delete<{/tr}></a> </font></td> </tr> <{/foreach}> |
From: Florian G. <re...@us...> - 2007-12-03 20:39:02
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18809 Modified Files: perfparse.php utils.php Log Message: delete saved graphs is possible now Index: utils.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** utils.php 3 Dec 2007 20:07:19 -0000 1.46 --- utils.php 3 Dec 2007 20:39:03 -0000 1.47 *************** *** 853,856 **** --- 853,865 ---- } + function delete_saved_graph(&$db,$graphid) { + $query='delete from perfdata_graphs where id=?'; + if(!$db->Execute($query,array($graphid))) { + $errormsg="Error saving graph: ".$db->ErrorMsg(); + } + if(isset($errormsg)) return($errormsg); + + } + function sync_nagios_hostgroups(&$db,&$nagiosconfig) { // insert nagios config Index: perfparse.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/perfparse.php,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** perfparse.php 26 Nov 2007 00:01:16 -0000 1.59 --- perfparse.php 3 Dec 2007 20:39:03 -0000 1.60 *************** *** 509,512 **** --- 509,517 ---- $smarty->assign('sort',$sort); + + if(get_request_var('delete','int')) { + delete_saved_graph($db,$delete); + } + // get graph tiles for table display $graphs=get_graphs($db,$sort); // third parameter selects graphs of selected groups only *************** *** 525,528 **** --- 530,535 ---- } + + $smarty->display($config['PHP_Style'].$_REQUEST['page'].'.tpl.html'); break; |
From: Florian G. <re...@us...> - 2007-12-03 20:08:25
|
Update of /cvsroot/perfparse/_perfparse/cgi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7422 Modified Files: perfchart.c Log Message: fixed display of saved graphs with wrong maxin/minin Index: perfchart.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/cgi/perfchart.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** perfchart.c 25 Aug 2007 00:09:14 -0000 1.15 --- perfchart.c 3 Dec 2007 20:08:23 -0000 1.16 *************** *** 1587,1591 **** } // minin ! if(strlen(sData(2))>0) { dMin=dData(2); bMin=TRUE; --- 1587,1591 ---- } // minin ! if(strlen(sData(2))>0 && iScale!=SCALE_AUTO) { dMin=dData(2); bMin=TRUE; *************** *** 1594,1598 **** } // maxin ! if(strlen(sData(3))>0) { dMax=dData(3); bMax=TRUE; --- 1594,1598 ---- } // maxin ! if(strlen(sData(3))>0 && iScale!=SCALE_AUTO) { dMax=dData(3); bMax=TRUE; |
From: Florian G. <re...@us...> - 2007-12-03 20:07:16
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7069 Modified Files: utils.php Log Message: fixed save of maxin/minin when scale is auto Index: utils.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** utils.php 10 Nov 2007 21:03:32 -0000 1.45 --- utils.php 3 Dec 2007 20:07:19 -0000 1.46 *************** *** 790,793 **** --- 790,799 ---- } } + + if($grapharray['scale']==6) { + $grapharray['minin']=NULL; + $grapharray['maxin']=NULL; + } + $query='insert into perfdata_graphs (title,descript,refresh_time,metric_id,scale,minin,maxin,timerange,'; |
From: Florian G. <re...@us...> - 2007-11-26 00:54:07
|
Update of /cvsroot/perfparse/_perfparse/libpp_mysql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16645/libpp_mysql Modified Files: del_policy.c del_policy.h Log Message: cleanup code from old unused stuff Index: del_policy.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/libpp_mysql/del_policy.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** del_policy.c 6 Jun 2007 09:53:14 -0000 1.3 --- del_policy.c 26 Nov 2007 00:54:09 -0000 1.4 *************** *** 52,86 **** - void editPolicy(char *sPolicyName, int iPolicy) - { - - if (isPolicyDefined(sPolicyName)) { - - g_string_printf(s_SQL, "UPDATE perfdata_delete_policy SET policy_name = '%s'", - sql_escape(sPolicyName,PERCENT_ESCAPE_CHAR)); - g_string_append_printf(s_SQL, ", delete_policy = %s WHERE policy_name = '%s'", - pval2sql(iPolicy), sql_escape(sPolicyName,PERCENT_ESCAPE_CHAR)); - - } else { - - g_string_printf(s_SQL, "INSERT perfdata_delete_policy (policy_name, delete_policy) VALUES ('%s',%s)", - sql_escape(sPolicyName,PERCENT_ESCAPE_CHAR), pval2sql(iPolicy)); - } - - query_no_return(s_SQL->str); - - } - - - - void deletePolicyName(char *sPolicy) - { - - g_string_printf(s_SQL, "DELETE FROM perfdata_delete_policy WHERE policy_name = '%s'", sql_escape(sPolicy,PERCENT_ESCAPE_CHAR)); - - query_no_return(s_SQL->str); - - - } int isPolicyDefined(char *sPolicyName) --- 52,55 ---- *************** *** 108,209 **** - /*************************************************** - * - * Working with delete_policy record on tables. - * - ***************************************************/ - - - void setRawPolicy(char *sHostIn, char *sServiceIn, int iPolicy, int iPolicyType, char *sTemplate) - { - char sName[31]; - - if (sTemplate && sTemplate[0]) sprintf(sName, "'%s'", sql_escape(sTemplate,PERCENT_ESCAPE_CHAR)); - else strcpy(sName, "NULL"); - - g_string_printf(s_SQL, "UPDATE perfdata_service SET raw_delete_policy = %s, raw_delete_policy_type = %s", - pval2sql(iPolicy), ptype2sql(iPolicyType)); - g_string_append_printf(s_SQL, ", raw_delete_policy_name = %s", sName); - g_string_append_printf(s_SQL, " WHERE host_name = '%s'", - sql_escape(sHostIn,PERCENT_ESCAPE_CHAR)); - g_string_append_printf(s_SQL, " AND service_description = '%s'", - sql_escape(sServiceIn,PERCENT_ESCAPE_CHAR)); - query_no_return(s_SQL->str); - - } - - - void setBinPolicy(char *sHostIn, char *sServiceIn, char *sMetricIn, int iPolicy, int iPolicyType, char *sTemplate) - { - - char sName[31]; - - if (sTemplate && sTemplate[0]) sprintf(sName, "'%s'", sql_escape(sTemplate,PERCENT_ESCAPE_CHAR)); - else strcpy(sName, "NULL"); - - g_string_printf(s_SQL, "UPDATE perfdata_service_metric SET bin_delete_policy = %s, bin_delete_policy_type = %s", - pval2sql(iPolicy), ptype2sql(iPolicyType)); - g_string_append_printf(s_SQL, ", bin_delete_policy_name = %s", sName); - g_string_append_printf(s_SQL, " WHERE host_name = '%s'", - sql_escape(sHostIn,PERCENT_ESCAPE_CHAR)); - g_string_append_printf(s_SQL, " AND service_description = '%s'", - sql_escape(sServiceIn,PERCENT_ESCAPE_CHAR)); - g_string_append_printf(s_SQL, " AND metric = '%s'", - sql_escape(sMetricIn,PERCENT_ESCAPE_CHAR)); - query_no_return(s_SQL->str); - - } - - void setBinHostPolicyUser(char *sHostIn, int iPolicy) - { - - g_string_printf(s_SQL, "UPDATE perfdata_host SET bin_delete_policy = %s, bin_delete_policy_type = 'user' WHERE host_name = '%s'", - pval2sql(iPolicy), sql_escape(sHostIn,PERCENT_ESCAPE_CHAR)); - - query_no_return(s_SQL->str); - - } - - - void setBinHostPolicyTemplate(char *sHostIn, char *sTemplate) - { - - g_string_printf(s_SQL, "UPDATE perfdata_host SET bin_delete_policy = %s, bin_delete_policy_type = 'template'", - pval2sql(getPolicy(sTemplate))); - g_string_append_printf(s_SQL, ", bin_delete_policy_name = '%s'", - sql_escape(sTemplate,PERCENT_ESCAPE_CHAR)); - g_string_append_printf(s_SQL, " WHERE host_name = '%s'", - sql_escape(sHostIn,PERCENT_ESCAPE_CHAR)); - query_no_return(s_SQL->str); - - } - - - void setRawHostPolicyUser(char *sHostIn, int iPolicy) - { - - g_string_printf(s_SQL, "UPDATE perfdata_host SET raw_delete_policy = %s, raw_delete_policy_type = 'user' WHERE host_name = '%s'", - pval2sql(iPolicy), sql_escape(sHostIn,PERCENT_ESCAPE_CHAR)); - query_no_return(s_SQL->str); - - } - - - void setRawHostPolicyTemplate(char *sHostIn, char *sTemplate) - { - - g_string_printf(s_SQL, "UPDATE perfdata_host SET raw_delete_policy_type = 'template', raw_delete_policy = %s", - pval2sql(getPolicy(sTemplate))); - g_string_append_printf(s_SQL, ", raw_delete_policy_name = '%s'", - sql_escape(sTemplate,PERCENT_ESCAPE_CHAR)); - g_string_append_printf(s_SQL, " WHERE host_name = '%s'", - sql_escape(sHostIn,PERCENT_ESCAPE_CHAR)); - - query_no_return(s_SQL->str); - - } - - - /*************************************************** --- 77,80 ---- Index: del_policy.h =================================================================== RCS file: /cvsroot/perfparse/_perfparse/libpp_mysql/del_policy.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** del_policy.h 26 Sep 2005 14:36:33 -0000 1.1.1.1 --- del_policy.h 26 Nov 2007 00:54:09 -0000 1.2 *************** *** 17,33 **** /* Working with perfdata_delete_policy records */ - void editPolicy(char *sPolicyName, int iPolicy); - void deletePolicyName(char *sPolicy); int isPolicyDefined(char *sPolicyName); int getPolicy(char *sPolicyName); - /* Definition of policies against other tables. */ - void setBinPolicy(char *sHostIn, char *sServiceIn, char *sMetricIn, int iPolicy, int iPolicyType, char *sTemplate); - void setRawPolicy(char *sHostIn, char *sServiceIn, int iPolicy, int iPolicyType, char *sTemplate); - void setBinHostPolicyUser(char *sHostIn, int iPolicy); - void setBinHostPolicyTemplate(char *sHostIn, char *sTemplate); - void setRawHostPolicyUser(char *sHostIn, int iPolicy); - void setRawHostPolicyTemplate(char *sHostIn, char *sTemplate); - /* general helpers */ char *pval2sql(int iPolicy); --- 17,23 ---- *************** *** 59,62 **** ! #endif ! --- 49,51 ---- ! #endif |
From: Florian G. <re...@us...> - 2007-11-26 00:54:07
|
Update of /cvsroot/perfparse/_perfparse/db_tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16645/db_tools Modified Files: perfparse-db-purge.c Log Message: cleanup code from old unused stuff Index: perfparse-db-purge.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/db_tools/perfparse-db-purge.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** perfparse-db-purge.c 30 Jul 2007 22:32:06 -0000 1.7 --- perfparse-db-purge.c 26 Nov 2007 00:54:09 -0000 1.8 *************** *** 3,8 **** * perfparse.c - Parse Nagios data and store in relational database. * ! * Copyright (c) 2004 Ben Clewett (per...@cl...) ! * Florian Gleixner * $Id$ * --- 3,8 ---- * perfparse.c - Parse Nagios data and store in relational database. * ! * Copyright (c) 2004-2007 Ben Clewett (per...@cl...) ! * Florian Gleixner * $Id$ * |
From: Florian G. <re...@us...> - 2007-11-26 00:01:13
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29256 Modified Files: perfparse.php Log Message: fixed multipe metric selection Index: perfparse.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/perfparse.php,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** perfparse.php 10 Nov 2007 21:03:32 -0000 1.58 --- perfparse.php 26 Nov 2007 00:01:16 -0000 1.59 *************** *** 190,200 **** foreach($servicearray as $serviceid => $metricarray) { $service_description=$metricarray['service_description']; ! //$diffmetrics[$service_description]['service_id']=$serviceid; ! foreach($metricarray as $metricid=>$metric ) { ! if($metricid != 'service_description'){ ! // $diffmetrics[$service_description][$metric]["hosts"][$hostId]=$hidnames[$hostId]; ! $diffmetrics[$service_description][$metric]["metric_ids"][]=$metricid; ! $diffmetrics[$service_description][$metric]["count"]=count($diffmetrics[$service_description][$metric]["metric_ids"]); ! } } } --- 190,196 ---- foreach($servicearray as $serviceid => $metricarray) { $service_description=$metricarray['service_description']; ! foreach($metricarray['metrics'] as $metricid=>$metric ) { ! $diffmetrics[$service_description][$metric]["metric_ids"][]=$metricid; ! $diffmetrics[$service_description][$metric]["count"]=count($diffmetrics[$service_description][$metric]["metric_ids"]); } } |
Update of /cvsroot/perfparse/_perfparse/cgi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22973 Removed Files: cgi_bin_report.c cgi_bin_report.h cgi_bin_summary_policy.c cgi_bin_summary_policy.h cgi_del_policy.c cgi_del_policy.h cgi_host_groups.c cgi_host_groups.h cgi_intro.c cgi_intro.h cgi_raw_report.c cgi_raw_report.h cgi_select_object.c cgi_select_object.h object_users.c object_users.h perfgraph.c perfgraph.h Log Message: drop old cgi stuff --- cgi_bin_summary_policy.h DELETED --- --- object_users.h DELETED --- --- perfgraph.c DELETED --- --- cgi_select_object.c DELETED --- --- cgi_host_groups.c DELETED --- --- cgi_bin_summary_policy.c DELETED --- --- cgi_host_groups.h DELETED --- --- cgi_select_object.h DELETED --- --- perfgraph.h DELETED --- --- object_users.c DELETED --- --- cgi_del_policy.h DELETED --- --- cgi_raw_report.h DELETED --- --- cgi_intro.c DELETED --- --- cgi_bin_report.c DELETED --- --- cgi_raw_report.c DELETED --- --- cgi_bin_report.h DELETED --- --- cgi_del_policy.c DELETED --- --- cgi_intro.h DELETED --- |
From: Florian G. <re...@us...> - 2007-11-10 21:03:31
|
Update of /cvsroot/perfparse/_perfparse-phpgui/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937/templates Modified Files: mainmenu.tpl.html read_nag_config.tpl.html Log Message: make sync to nagios config working again after db schema change Index: mainmenu.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/mainmenu.tpl.html,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mainmenu.tpl.html 30 Sep 2007 22:43:45 -0000 1.10 --- mainmenu.tpl.html 10 Nov 2007 21:03:32 -0000 1.11 *************** *** 45,48 **** --- 45,51 ---- <a href="perfparse.php?page=edit_host_list"><{tr}>View / Edit Host Groups List<{/tr}>.</a> </td></tr> + <tr><td></td><td colspan=2><font face="Arial, Helvetica" size=2> + <a href="perfparse.php?page=read_nag_config"><{tr}>Synchronize Host Groups with Nagios Configuration<{/tr}>.</a> + </td></tr> <tr><td colspan=2> </td></tr> <tr><td></td><td colspan=2><font face="Arial, Helvetica" size=2> *************** *** 67,73 **** <a href="perfparse.php?page=show_effective_del_policies"><{tr}>Display effective delete policies of objects<{/tr}>.</a> </td></tr> - <tr><td></td><td colspan=2><font face="Arial, Helvetica" size=2> - <a href="perfparse.php?page=read_nag_config"><{tr}>Read Nagios Configuration<{/tr}>.</a> - </td></tr> </table> </td></tr></table></p> --- 70,73 ---- Index: read_nag_config.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/read_nag_config.tpl.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** read_nag_config.tpl.html 5 Mar 2007 10:59:46 -0000 1.3 --- read_nag_config.tpl.html 10 Nov 2007 21:03:32 -0000 1.4 *************** *** 17,24 **** <p align="center"> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="600"><tbody><tr><td> - <form method="get"> - <input name="page" value="add_amend_host_group" type="hidden"> <p align="center"> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="600"><tbody><tr><td> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr> --- 17,34 ---- <p align="center"> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="600"><tbody><tr><td> <p align="center"> <table bgcolor="#cccccc" border="1" cellpadding="5" cellspacing="0" width="600"><tbody><tr><td> + <{if $msgs}> + <table border="0" cellpadding="0" cellspacing="0" width="100%"> + <tbody><tr> + <td align="center"><font face="Arial, Helvetica" size="2"> + <b><{tr}>Messages<{/tr}></b><br> + </font></td> + </tr> + <tr><td> + <{$msgs}> + </td></tr> + </tbody></table> + <{/if}> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody><tr> |
From: Florian G. <re...@us...> - 2007-11-10 21:03:31
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9937 Modified Files: perfparse.php utils.php Log Message: make sync to nagios config working again after db schema change Index: utils.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** utils.php 28 Sep 2007 21:53:16 -0000 1.44 --- utils.php 10 Nov 2007 21:03:32 -0000 1.45 *************** *** 134,137 **** --- 134,143 ---- } + function get_id_from_hostname(&$db,$host) { + $query='SELECT host_id FROM perfdata_host WHERE host_name=?'; + $ret=$db->GetOne($query,array($host)); + return($ret); + } + function have_host(&$db,$host) { *************** *** 489,492 **** --- 495,505 ---- } + function get_id_from_groupname(&$db,$group_name) { + $query='SELECT group_id from perfdata_groups WHERE group_name=?'; + $ret=$db->GetOne($query,array($group_name)); + return($ret); + } + + function add_group(&$db,$group_name) { $query='insert into perfdata_groups (group_name) values (?)'; *************** *** 510,513 **** --- 523,531 ---- } + function add_host_to_group(&$db,$group,$host) { + $hid=get_id_from_hostname($db,$host); + $gid=get_id_from_groupname($db,$group); + return(add_hostid_to_groupid($db,$gid,$hid)); + } function remove_hostid_from_groupid(&$db,$group_id,$host_id) { *************** *** 830,851 **** function sync_nagios_hostgroups(&$db,&$nagiosconfig) { - // delete all hostgroups - $query='update perfdata_host set group_name=NULL'; - if(!$db->Execute($query)) { - echo "Error: ".$db->ErrorMsg(); - } - $query='delete from perfdata_host_group'; - if(!$db->Execute($query)) { - echo "Error: ".$db->ErrorMsg(); - } // insert nagios config ! $query_gr='insert into perfdata_host_group(group_name) values (?)'; ! $query_ho='update perfdata_host set group_name=? where host_name=?'; foreach($nagiosconfig->hostgroups as $key=>$group) { ! $db->Execute($query_gr,array($group['hostgroup_name'])); foreach($group['members'] as $member) { ! $db->Execute($query_ho,array($group['hostgroup_name'],$member)); } } } --- 848,864 ---- function sync_nagios_hostgroups(&$db,&$nagiosconfig) { // insert nagios config ! $ret=''; foreach($nagiosconfig->hostgroups as $key=>$group) { ! if(add_group($db,$group['hostgroup_name'])) { ! $ret.="Group ".$group['hostgroup_name']." added.<br />"; ! } foreach($group['members'] as $member) { ! if(add_host_to_group($db,$group['hostgroup_name'],$member)) { ! $ret.="Host ".$member." added to group ".$group['hostgroup_name'].".<br />"; ! } } } + return($ret); } Index: perfparse.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/perfparse.php,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** perfparse.php 28 Sep 2007 21:53:16 -0000 1.57 --- perfparse.php 10 Nov 2007 21:03:32 -0000 1.58 *************** *** 687,695 **** $nagiosconfig=new Nagios(); // read configuration ! $nagiosconfig->ParseConfigFile('../etc/nagios.cfg'); ! //echo "<pre>"; print_r($nagiosconfig); echo "</pre>"; // echo "<pre>"; print_r($nagiosconfig->hostgroups); echo "</pre>"; ! sync_nagios_hostgroups($db,$nagiosconfig); $hgcount=get_groups_hostcount($db); $smarty->assign_by_ref('hgcount',$hgcount); --- 687,697 ---- $nagiosconfig=new Nagios(); // read configuration ! // todo: make path configurable ! $nagiosconfig->ParseConfigFile('../../etc/nagios.cfg'); ! // echo "<pre>"; print_r($nagiosconfig); echo "</pre>"; // echo "<pre>"; print_r($nagiosconfig->hostgroups); echo "</pre>"; ! $msgs=sync_nagios_hostgroups($db,$nagiosconfig); ! $smarty->assign_by_ref('msgs',$msgs); $hgcount=get_groups_hostcount($db); $smarty->assign_by_ref('hgcount',$hgcount); |
From: Florian G. <re...@us...> - 2007-09-30 22:48:13
|
Update of /cvsroot/perfparse/_perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3765 Modified Files: TODO Log Message: idea unix sockets Index: TODO =================================================================== RCS file: /cvsroot/perfparse/_perfparse/TODO,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** TODO 28 Sep 2007 21:53:16 -0000 1.9 --- TODO 30 Sep 2007 22:48:15 -0000 1.10 *************** *** 14,15 **** --- 14,16 ---- - add option to deliver data via NEB module - autodetect log source type - fix bug when ppd is spinning if defined as file but source is a pipe + - use UNIX sockets rather than fifos for more reliable setups |
From: Florian G. <re...@us...> - 2007-09-30 22:43:44
|
Update of /cvsroot/perfparse/_perfparse-phpgui/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1955/phpgui/templates Modified Files: mainmenu.tpl.html Log Message: use serviceperf.log in all locations Index: mainmenu.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/mainmenu.tpl.html,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mainmenu.tpl.html 3 Sep 2007 22:56:25 -0000 1.9 --- mainmenu.tpl.html 30 Sep 2007 22:43:45 -0000 1.10 *************** *** 15,19 **** <td align=center><font face="Arial, Helvetica" size=2> <b><a href="http://perfparse.sourceforge.net">PerfParse</a></b><br> ! <{tr}>Copyright<{/tr}> © 2004-2006. <{$version}></b></font> </td> <td width="10%" align=right><font face="Arial, Helvetica" size=1> </td> --- 15,19 ---- <td align=center><font face="Arial, Helvetica" size=2> <b><a href="http://perfparse.sourceforge.net">PerfParse</a></b><br> ! <{tr}>Copyright<{/tr}> © 2004-2007. <{$version}></b></font> </td> <td width="10%" align=right><font face="Arial, Helvetica" size=1> </td> |
From: Florian G. <re...@us...> - 2007-09-30 22:43:44
|
Update of /cvsroot/perfparse/_perfparse/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1955/scripts Modified Files: perfparsed.sh Log Message: use serviceperf.log in all locations Index: perfparsed.sh =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/perfparsed.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** perfparsed.sh 28 Sep 2007 21:53:16 -0000 1.3 --- perfparsed.sh 30 Sep 2007 22:43:46 -0000 1.4 *************** *** 15,19 **** ! PPPIPE=/usr/local/nagios/var/perfdata-service.log NAGIOS_USER=nagios NAGIOS_GROUP=nagios --- 15,19 ---- ! PPPIPE=/usr/local/nagios/var/serviceperf.log NAGIOS_USER=nagios NAGIOS_GROUP=nagios |
From: Florian G. <re...@us...> - 2007-09-28 21:53:21
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11373/phpgui Modified Files: perfparse.php utils.php Log Message: some cosmetic changes and a little work on the php interface Index: utils.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** utils.php 6 Sep 2007 22:59:50 -0000 1.43 --- utils.php 28 Sep 2007 21:53:16 -0000 1.44 *************** *** 224,228 **** if($res) { while($t=$res->FetchRow()) { ! $ret[$t['service_id']][$t['metric_id']]=$t['metric']; $ret[$t['service_id']]['service_description']=$t['service_description']; } --- 224,228 ---- if($res) { while($t=$res->FetchRow()) { ! $ret[$t['service_id']]['metrics'][$t['metric_id']]=$t['metric']; $ret[$t['service_id']]['service_description']=$t['service_description']; } *************** *** 230,233 **** --- 230,237 ---- echo "Error in query $query. Message: ".$db->ErrorMsg(); } + // array enrichment + foreach($ret as $serviceid => $servicearray) { + $ret[$serviceid]['count_metrics']=count($servicearray['metrics']); + } return($ret); } *************** *** 278,286 **** // get hostids and hostnames from a given groupid function get_groupId_hostinfos(&$db,$groupId) { ! $query ='SELECT h.host_name, h.host_id from perfdata_host h, perfdata_host_groups hg where hg.group_id=? and h.host_id=hg.host_id'; ! $res=$db->Execute($query,array($groupId)); $ret=array(); if($res) { --- 282,297 ---- // get hostids and hostnames from a given groupid + // if groupId is -1 then get infos of all hosts without group function get_groupId_hostinfos(&$db,$groupId) { ! if($groupId == -1) { ! $query = 'SELECT h.host_name, h.host_id from perfdata_host h left join perfdata_host_groups hg ! on h.host_id=hg.host_id where hg.group_id is NULL'; ! $res=$db->Execute($query); ! } else { ! $query ='SELECT h.host_name, h.host_id from perfdata_host h, perfdata_host_groups hg where hg.group_id=? and h.host_id=hg.host_id'; ! $res=$db->Execute($query,array($groupId)); ! } $ret=array(); if($res) { Index: perfparse.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/perfparse.php,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** perfparse.php 6 Sep 2007 22:59:50 -0000 1.56 --- perfparse.php 28 Sep 2007 21:53:16 -0000 1.57 *************** *** 657,661 **** } ! /* debug echo "<pre>group_id: $group_id\n</pre>"; echo "<pre>groupinfos:\n"; print_r($groupinfos); echo "\n</pre>"; --- 657,661 ---- } ! ///* debug echo "<pre>group_id: $group_id\n</pre>"; echo "<pre>groupinfos:\n"; print_r($groupinfos); echo "\n</pre>"; *************** *** 664,668 **** echo "<pre>bin_group_policy:\n"; print_r($bin_group_policy); echo "\n</pre>"; echo "<pre>bin_host_policy:\n"; print_r($bin_host_policy); echo "\n</pre>"; ! */ /* debug --- 664,668 ---- echo "<pre>bin_group_policy:\n"; print_r($bin_group_policy); echo "\n</pre>"; echo "<pre>bin_host_policy:\n"; print_r($bin_host_policy); echo "\n</pre>"; ! //*/ /* debug |
From: Florian G. <re...@us...> - 2007-09-28 21:53:16
|
Update of /cvsroot/perfparse/_perfparse-phpgui/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11373/phpgui/templates Modified Files: select_metric.tpl.html show_effective_del_policies.tpl.html Log Message: some cosmetic changes and a little work on the php interface Index: show_effective_del_policies.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/show_effective_del_policies.tpl.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** show_effective_del_policies.tpl.html 6 Sep 2007 22:59:51 -0000 1.2 --- show_effective_del_policies.tpl.html 28 Sep 2007 21:53:16 -0000 1.3 *************** *** 110,113 **** --- 110,114 ---- <tr><td> <select name="group_id"> + <option value="-1"><{tr}>Unassigned<{/tr}></option> <{foreach from=$groupinfos key=gid item=gname}> <option value="<{$gid}>"><{$gname}></option> *************** *** 195,201 **** <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> <table width="100%" border=0 cellpadding=0 cellspacing=0> ! ! ! </table></td></tr></table></p> <{/if}> --- 196,216 ---- <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> <table width="100%" border=0 cellpadding=0 cellspacing=0> ! <tr><td><b><{tr}>Service<{/tr}></b></td><td><b><{tr}>Raw deletion policy<{/tr}></b></td> ! <td><b><{tr}>Effective raw deletion policy<{/tr}></b></td> ! <td><b><{tr}>Metric<{/tr}></b></td><td><b><{tr}>Bin deletion policy<{/tr}></b></td> ! <td><b><{tr}>Effective bin deletion policy<{/tr}></b></td> ! </tr> ! <{foreach from=$metricsinfos key=serviceid item=servicearray}> ! <tr> ! <td rowspan="<{$servicearray.count_metrics}>"><{$servicearray.service_description}></td> ! <td rowspan="<{$servicearray.count_metrics}>">todo</td> ! <td rowspan="<{$servicearray.count_metrics}>">todo</td> ! <{foreach from=$servicearray.metrics key=metricid item=metric}> ! <td><{$metric}></td> ! <td>todo</td> ! <td>todo</td> ! </tr> ! <{/foreach}> ! <{/foreach}> </table></td></tr></table></p> <{/if}> Index: select_metric.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/select_metric.tpl.html,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** select_metric.tpl.html 14 Sep 2006 09:15:29 -0000 1.9 --- select_metric.tpl.html 28 Sep 2007 21:53:16 -0000 1.10 *************** *** 69,78 **** <table width="100%" border=1 cellpadding=5 cellspacing=0 bgcolor="#FFFFFF"> <tr> ! <{foreach from=$metric key=metricid item=metricname}> ! <{if $metricid != "service_description"}> <td><font face="Arial, Helvetica" size=2> <input type="checkbox" name="graphs[<{$metricid}>][display]" value="true" id="<{$metric.service_description}>_<{$metricname}>" onclick="javascript:UncheckMetricSwitch(this,'all_<{$metric.service_description}>_<{$metricname}>')"/><{$metricname}> </td> - <{/if}> <{/foreach}> </tr></table> --- 69,76 ---- <table width="100%" border=1 cellpadding=5 cellspacing=0 bgcolor="#FFFFFF"> <tr> ! <{foreach from=$metric.metrics key=metricid item=metricname}> <td><font face="Arial, Helvetica" size=2> <input type="checkbox" name="graphs[<{$metricid}>][display]" value="true" id="<{$metric.service_description}>_<{$metricname}>" onclick="javascript:UncheckMetricSwitch(this,'all_<{$metric.service_description}>_<{$metricname}>')"/><{$metricname}> </td> <{/foreach}> </tr></table> |
From: Florian G. <re...@us...> - 2007-09-28 21:53:16
|
Update of /cvsroot/perfparse/_perfparse/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11373/scripts Modified Files: mysql_create.sql perfparsed.sh Log Message: some cosmetic changes and a little work on the php interface Index: mysql_create.sql =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/mysql_create.sql,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** mysql_create.sql 3 Sep 2007 22:56:25 -0000 1.26 --- mysql_create.sql 28 Sep 2007 21:53:16 -0000 1.27 *************** *** 45,48 **** --- 45,52 ---- insert into perfdata_delete_policy (policy_id,policy_name,delete_policy_seconds,policy_comment,instance_id) values (0,'__Default_Bin',-1,'Internal default bin policy.',0); + + # mysql seems to ignore setting the autoindexes column + update perfdata_delete_policy set policy_id=0 where policy_name='__Default_Bin'; + insert into perfdata_delete_policy (policy_id,policy_name,delete_policy_seconds,policy_comment,instance_id) values (1,'__Default_Raw',-1,'Internal default raw policy.',0); *************** *** 61,67 **** raw_delete_policy_individual INTEGER, bin_delete_policy_id INTEGER, ! bin__delete_policy_individual INTEGER FOREIGN KEY perfdata_groups_ibfk_2 (bin_delete_policy_id) ! REFERENCES perfdata_delete_policy (policy_id) ON DELETE SET NULL, FOREIGN KEY perfdata_groups_ibfk_3 (raw_delete_policy_id) --- 65,71 ---- raw_delete_policy_individual INTEGER, bin_delete_policy_id INTEGER, ! bin_delete_policy_individual INTEGER, FOREIGN KEY perfdata_groups_ibfk_2 (bin_delete_policy_id) ! REFERENCES perfdata_delete_policy(policy_id) ON DELETE SET NULL, FOREIGN KEY perfdata_groups_ibfk_3 (raw_delete_policy_id) Index: perfparsed.sh =================================================================== RCS file: /cvsroot/perfparse/_perfparse/scripts/perfparsed.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** perfparsed.sh 22 Dec 2006 20:07:47 -0000 1.2 --- perfparsed.sh 28 Sep 2007 21:53:16 -0000 1.3 *************** *** 15,19 **** ! PPPIPE=/usr/local/nagios/var/serviceperf.log NAGIOS_USER=nagios NAGIOS_GROUP=nagios --- 15,19 ---- ! PPPIPE=/usr/local/nagios/var/perfdata-service.log NAGIOS_USER=nagios NAGIOS_GROUP=nagios *************** *** 29,32 **** --- 29,37 ---- APPLY_OLD_DATA=1 fi + if [ -n $PPPIPE ] ; then + echo "creating pipe" + mkfifo $PPPIPE + chown ${NAGIOS_USER}:${NAGIOS_GROUP} $PPPIPE + fi echo "Starting perfparsed" su $NAGIOS_USER -c "$PERFPARSED -d" |
From: Florian G. <re...@us...> - 2007-09-28 21:53:16
|
Update of /cvsroot/perfparse/_perfparse/perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11373/perfparse Modified Files: perfparse-common.c perfparse-log2any.c perfparsed.c Log Message: some cosmetic changes and a little work on the php interface Index: perfparse-log2any.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/perfparse/perfparse-log2any.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** perfparse-log2any.c 6 Jun 2007 09:53:14 -0000 1.4 --- perfparse-log2any.c 28 Sep 2007 21:53:16 -0000 1.5 *************** *** 162,166 **** if(0 == storage_init(argv[0])) { ! pp_log(__FILE__,__LINE__,LOG_WARNING,_("No module was loaded. Check the Storage_Module_Load config option.")); exit(EXIT_FAILURE); } --- 162,166 ---- if(0 == storage_init(argv[0])) { ! pp_log(__FILE__,__LINE__,LOG_WARNING,_("No module was loaded. Check the Storage_Modules_Load config option.")); exit(EXIT_FAILURE); } Index: perfparse-common.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/perfparse/perfparse-common.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** perfparse-common.c 6 Jun 2007 09:53:14 -0000 1.3 --- perfparse-common.c 28 Sep 2007 21:53:16 -0000 1.4 *************** *** 67,72 **** void log_dropped_line(char*line) { FILE*fd; fd = log_file_fopen(config_get_value_as_string(CONFIG_ITEM_ID_DROP_FILE), time(0), config_get_value_as_boolean(CONFIG_ITEM_ID_DROP_FILE_ROTATE)); ! if(!fd) fd = stderr; fprintf(fd,"%s\n",line); if(fd != stderr) fclose(fd); --- 67,76 ---- void log_dropped_line(char*line) { FILE*fd; + pp_log(__FILE__,__LINE__,LOG_INFO,_("Logging dropped line to %s."),config_get_value_as_string(CONFIG_ITEM_ID_DROP_FILE)); fd = log_file_fopen(config_get_value_as_string(CONFIG_ITEM_ID_DROP_FILE), time(0), config_get_value_as_boolean(CONFIG_ITEM_ID_DROP_FILE_ROTATE)); ! if(!fd) { ! fd = stderr; ! pp_log(__FILE__,__LINE__,LOG_WARNING,_("Could not open dropfile for writing. Sending output to stderr.")); ! } fprintf(fd,"%s\n",line); if(fd != stderr) fclose(fd); Index: perfparsed.c =================================================================== RCS file: /cvsroot/perfparse/_perfparse/perfparse/perfparsed.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** perfparsed.c 3 Sep 2007 22:56:25 -0000 1.6 --- perfparsed.c 28 Sep 2007 21:53:16 -0000 1.7 *************** *** 183,187 **** // load staorage modules if(0 == storage_init(NULL)) { ! pp_log(__FILE__,__LINE__,LOG_WARNING,_("No module was loaded. Check the Storage_Module_Load config option.")); exit(EXIT_FAILURE); } --- 183,187 ---- // load staorage modules if(0 == storage_init(NULL)) { ! pp_log(__FILE__,__LINE__,LOG_WARNING,_("No module was loaded. Check the Storage_Modules_Load config option.")); exit(EXIT_FAILURE); } |
From: Florian G. <re...@us...> - 2007-09-28 21:53:16
|
Update of /cvsroot/perfparse/_perfparse/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11373/config Modified Files: perfparse.cfg.example Log Message: some cosmetic changes and a little work on the php interface Index: perfparse.cfg.example =================================================================== RCS file: /cvsroot/perfparse/_perfparse/config/perfparse.cfg.example,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** perfparse.cfg.example 2 Dec 2006 21:31:09 -0000 1.2 --- perfparse.cfg.example 28 Sep 2007 21:53:16 -0000 1.3 *************** *** 31,35 **** # Performance Data Log Files ("-" for stdin) : ! Service_Log = "/usr/local/nagios/var/serviceperf.log" Service_Log_Position_Mark_Path = "" --- 31,35 ---- # Performance Data Log Files ("-" for stdin) : ! Service_Log = "/usr/local/nagios/var/perfdata-service.log" Service_Log_Position_Mark_Path = "" *************** *** 88,92 **** # Database managment : # ==================== ! Use_Storage_Mysql = "yes" No_Raw_Data = "no" --- 88,92 ---- # Database managment : # ==================== ! Storage_Modules_Load = "mysql" No_Raw_Data = "no" |
From: Florian G. <re...@us...> - 2007-09-28 21:53:16
|
Update of /cvsroot/perfparse/_perfparse In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11373 Modified Files: TODO configure configure.ac Log Message: some cosmetic changes and a little work on the php interface Index: configure =================================================================== RCS file: /cvsroot/perfparse/_perfparse/configure,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** configure 2 Aug 2007 22:20:20 -0000 1.29 --- configure 28 Sep 2007 21:53:16 -0000 1.30 *************** *** 1564,1568 **** --with-gdlib_config_dir=PATH gdlib-config full path (default=) --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) --- 1564,1568 ---- --with-gdlib_config_dir=PATH gdlib-config full path (default=) --with-cgidir=DIR cgi dir (default=sbindir) ! --with-phpuidir=DIR PHP webinterface dir (default=PREFIX/share/phpui) --with-apacheuser=username Apache user for installation (default=nobody) --with-imagedir=DIR images dir (default=datadir/perfparse/images) Index: configure.ac =================================================================== RCS file: /cvsroot/perfparse/_perfparse/configure.ac,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** configure.ac 2 Aug 2007 22:20:20 -0000 1.27 --- configure.ac 28 Sep 2007 21:53:16 -0000 1.28 *************** *** 358,362 **** INST_PHPUI_PATH=${prefix}/share/phpui AC_ARG_WITH(phpuidir, ! [ --with-phpuidir=DIR PHP webinterface dir (default=sbindir)],[ if test "$withval" != "no" -a "$withval" != "yes"; then INST_PHPUI_PATH=$withval --- 358,362 ---- INST_PHPUI_PATH=${prefix}/share/phpui AC_ARG_WITH(phpuidir, ! [ --with-phpuidir=DIR PHP webinterface dir (default=PREFIX/share/phpui)],[ if test "$withval" != "no" -a "$withval" != "yes"; then INST_PHPUI_PATH=$withval Index: TODO =================================================================== RCS file: /cvsroot/perfparse/_perfparse/TODO,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TODO 15 Apr 2007 23:39:52 -0000 1.8 --- TODO 28 Sep 2007 21:53:16 -0000 1.9 *************** *** 13,14 **** --- 13,15 ---- - update documentation - remove install options that are outdated - add option to deliver data via NEB module + - autodetect log source type - fix bug when ppd is spinning if defined as file but source is a pipe |
From: Florian G. <re...@us...> - 2007-09-06 22:59:50
|
Update of /cvsroot/perfparse/_perfparse-phpgui/smarty_extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28828/phpgui/smarty_extensions Modified Files: modifier.difftime.php Log Message: more on policy ui Index: modifier.difftime.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/smarty_extensions/modifier.difftime.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** modifier.difftime.php 29 Dec 2006 00:27:07 -0000 1.1 --- modifier.difftime.php 6 Sep 2007 22:59:50 -0000 1.2 *************** *** 4,14 **** --- 4,21 ---- * Smarty Plugin * $Id$ + * Usage: $smarty_var_in_seconds|difftime */ function smarty_modifier_difftime($seconds) { + if($seconds=="" || $seconds==NULL) { + return ""; + } $seconds=(int) $seconds; if($seconds == 0) { return "deleted immediately"; } + if($seconds < 0) { + return "never deleted"; + } $o_sec=$seconds % 60; $seconds=floor($seconds/60); *************** *** 20,24 **** $seconds=floor($seconds/24); // $seconds are now days ! if($seconds > 365) { $o_y=floor($seconds / 365); $seconds=$seconds-($o_y*365); --- 27,31 ---- $seconds=floor($seconds/24); // $seconds are now days ! if($seconds >= 365) { $o_y=floor($seconds / 365); $seconds=$seconds-($o_y*365); *************** *** 43,50 **** // debug // $output="o_y=$o_y o_mon=$o_mon o_week=$o_week o_days=$o_days o_h=$o_h o_min=$o_min o_sec=$o_sec result: "; ! $o_y=($o_y==0)?'':"$o_y a "; $o_mon=($o_mon==0)?'':"$o_mon months "; $o_week=($o_week==0)?'':"$o_week weeks "; ! $o_days=($o_days==0)?'':"$o_days d "; $output=$output.$o_y.$o_mon.$o_week.$o_days; if($o_h != 0 || $o_min != 0 || $o_sec !=0) { --- 50,57 ---- // debug // $output="o_y=$o_y o_mon=$o_mon o_week=$o_week o_days=$o_days o_h=$o_h o_min=$o_min o_sec=$o_sec result: "; ! $o_y=($o_y==0)?'':"$o_y year "; $o_mon=($o_mon==0)?'':"$o_mon months "; $o_week=($o_week==0)?'':"$o_week weeks "; ! $o_days=($o_days==0)?'':"$o_days days "; $output=$output.$o_y.$o_mon.$o_week.$o_days; if($o_h != 0 || $o_min != 0 || $o_sec !=0) { |
From: Florian G. <re...@us...> - 2007-09-06 22:59:50
|
Update of /cvsroot/perfparse/_perfparse-phpgui/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28828/phpgui/templates Modified Files: show_effective_del_policies.tpl.html Log Message: more on policy ui Index: show_effective_del_policies.tpl.html =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/templates/show_effective_del_policies.tpl.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** show_effective_del_policies.tpl.html 5 Sep 2007 22:18:30 -0000 1.1 --- show_effective_del_policies.tpl.html 6 Sep 2007 22:59:51 -0000 1.2 *************** *** 26,29 **** --- 26,31 ---- <p align=center> <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> + <{tr}>SQL-Error<{/tr}>: + </td></tr><tr><td> <{$sql_error}> </td></tr></table> *************** *** 38,64 **** <table width="100%" border=0 cellpadding=0 cellspacing=0> <!-- Group selection --> <{if $group_id}> ! <tr> ! <td align=center width="33%" colspan="2" ><font face="Arial, Helvetica" size=2> ! <{tr}>Selected Group<{/tr}>: <{$groupinfos.$group_id}> </td> </tr> ! <tr> ! <td> ! <{tr}>bin deletion policy<{/tr}>: ! </td><td> ! <{$bin_group_policy.source}> <{$bin_group_policy.policy_name}> <{$bin_group_policy.policy_seconds}> sec. </td> </tr> <{else}> ! <tr> ! <td align=center width="33%" ><font face="Arial, Helvetica" size=2> <{tr}>Select Group<{/tr}>: ! </td> ! </tr> ! <tr> ! <tr> ! <td> <select name="group_id"> <{foreach from=$groupinfos key=gid item=gname}> --- 40,112 ---- <table width="100%" border=0 cellpadding=0 cellspacing=0> + <!-- Default Policy selection --> + + <tr><td align=center width="33%" colspan="2" ><font face="Arial, Helvetica" size=2> + <b><{tr}>Default Policies<{/tr}>:</b> + </td></tr><tr><td><font face="Arial, Helvetica" size=2> + <{tr}>Bin Policy<{/tr}>:</td><td><font face="Arial, Helvetica" size=2><{$default_bin_policy.delete_policy_seconds|difftime}> + </td></tr><tr><td><font face="Arial, Helvetica" size=2> + <{tr}>Raw Policy<{/tr}>:</td><td><font face="Arial, Helvetica" size=2><{$default_raw_policy.delete_policy_seconds|difftime}> + </td></tr> + </table></td></tr></table><br /> + + + <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> + <table width="100%" border=0 cellpadding=0 cellspacing=0> <!-- Group selection --> <{if $group_id}> ! <input type=hidden name="group_id" value="<{$group_id}>"> ! <tr><td align=center width="33%" colspan="2" ><font face="Arial, Helvetica" size=2> ! <b><{tr}>Selected Group<{/tr}>: <{$groupinfos.$group_id}></b> ! </td></tr> ! <tr><td colspan="2" ><font face="Arial, Helvetica" size=2> ! <i><{tr}>bin deletion policy<{/tr}>:</i> ! </td></tr><tr> ! <td><font face="Arial, Helvetica" size=2> ! <{tr}>Source<{/tr}>: ! </td><td><font face="Arial, Helvetica" size=2> ! <{$bin_group_policy.source}> ! </td> ! </tr><tr> ! <td><font face="Arial, Helvetica" size=2> ! <{tr}>Policy Name<{/tr}>: ! </td><td><font face="Arial, Helvetica" size=2> ! <{$bin_group_policy.policy_name}> ! </td> ! </tr><tr> ! <td><font face="Arial, Helvetica" size=2> ! <{tr}>Retention Time<{/tr}>: ! </td><td><font face="Arial, Helvetica" size=2> ! <{$bin_group_policy.policy_seconds|difftime}> </td> </tr> ! <td colspan="2" ><font face="Arial, Helvetica" size=2> ! <i><{tr}>raw deletion policy<{/tr}>:</i> ! </td> ! </tr><tr> ! <td><font face="Arial, Helvetica" size=2> ! <{tr}>Source<{/tr}>: ! </td><td><font face="Arial, Helvetica" size=2> ! <{$raw_group_policy.source}> ! </td> ! </tr><tr> ! <td><font face="Arial, Helvetica" size=2> ! <{tr}>Policy Name<{/tr}>: ! </td><td><font face="Arial, Helvetica" size=2> ! <{$raw_group_policy.policy_name}> ! </td> ! </tr><tr> ! <td><font face="Arial, Helvetica" size=2> ! <{tr}>Retention Time<{/tr}>: ! </td><td><font face="Arial, Helvetica" size=2> ! <{$raw_group_policy.policy_seconds|difftime}> </td> </tr> + <{else}> ! <tr><td align=center width="33%" ><font face="Arial, Helvetica" size=2> <{tr}>Select Group<{/tr}>: ! </td></tr> ! <tr><td> <select name="group_id"> <{foreach from=$groupinfos key=gid item=gname}> *************** *** 66,80 **** <{/foreach}> </select> </td> </tr> <tr><td align=center width="33%" colspan="2" ><font face="Arial, Helvetica" size=2> ! <input type="submit" name="set_group" value="<{tr}>Set<{/tr}>"> </td></tr> <{/if}> ! </table> ! </td></tr></table></p> </form> --- 114,203 ---- <{/foreach}> </select> + </td></tr> + <tr><td align=center width="33%" colspan="2" ><font face="Arial, Helvetica" size=2> + <input type="submit" name="set_group" value="<{tr}>Set<{/tr}>"> + </td></tr> + <{/if}> + </table></td></tr></table><br /> + + <{if $group_id}> + <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> + <table width="100%" border=0 cellpadding=0 cellspacing=0> + <!-- Host selection --> + <{if $host_id}> + <input type=hidden name="host_id" value="<{$host_id}>"> + <tr><td align=center width="33%" colspan="2" ><font face="Arial, Helvetica" size=2> + <b><{tr}>Selected Host<{/tr}>: <{$selected_host}></b> + </td></tr> + <tr><td colspan="2" ><font face="Arial, Helvetica" size=2> + <i><{tr}>bin deletion policy<{/tr}>:</i> + </td></tr><tr> + <td><font face="Arial, Helvetica" size=2> + <{tr}>Source<{/tr}>: + </td><td><font face="Arial, Helvetica" size=2> + <{$bin_host_policy.source}> + </td> + </tr><tr> + <td><font face="Arial, Helvetica" size=2> + <{tr}>Policy Name<{/tr}>: + </td><td><font face="Arial, Helvetica" size=2> + <{$bin_host_policy.policy_name}> + </td> + </tr><tr> + <td><font face="Arial, Helvetica" size=2> + <{tr}>Retention Time<{/tr}>: + </td><td><font face="Arial, Helvetica" size=2> + <{$bin_host_policy.policy_seconds|difftime}> + </td> + </tr> + <td colspan="2" ><font face="Arial, Helvetica" size=2> + <i><{tr}>raw deletion policy<{/tr}>:</i> + </td> + </tr><tr> + <td><font face="Arial, Helvetica" size=2> + <{tr}>Source<{/tr}>: + </td><td><font face="Arial, Helvetica" size=2> + <{$raw_host_policy.source}> + </td> + </tr><tr> + <td><font face="Arial, Helvetica" size=2> + <{tr}>Policy Name<{/tr}>: + </td><td><font face="Arial, Helvetica" size=2> + <{$raw_host_policy.policy_name}> + </td> + </tr><tr> + <td><font face="Arial, Helvetica" size=2> + <{tr}>Retention Time<{/tr}>: + </td><td><font face="Arial, Helvetica" size=2> + <{$raw_host_policy.policy_seconds|difftime}> </td> </tr> + <{else}> + <tr><td align=center width="33%" ><font face="Arial, Helvetica" size=2> + <{tr}>Select Host<{/tr}>: + </td></tr> + <tr><td> + <select name="host_id"> + <{foreach from=$hostinfos key=hid item=hinfo}> + <option value="<{$hid}>"><{$hinfo.host_name}></option> + <{/foreach}> + </select> + </td></tr> <tr><td align=center width="33%" colspan="2" ><font face="Arial, Helvetica" size=2> ! <input type="submit" name="set_host" value="<{tr}>Set<{/tr}>"> </td></tr> <{/if}> ! </table></td></tr></table><br /> ! <{/if}> + <{if $group_id && $host_id}> + <table width=600 border=1 cellpadding=5 cellspacing=0 bgcolor="#CCCCCC"><tr><td> + <table width="100%" border=0 cellpadding=0 cellspacing=0> ! ! ! </table></td></tr></table></p> ! <{/if}> </form> |
From: Florian G. <re...@us...> - 2007-09-06 22:59:50
|
Update of /cvsroot/perfparse/_perfparse-phpgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28828/phpgui Modified Files: perfparse.php utils.php Log Message: more on policy ui Index: utils.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/utils.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** utils.php 5 Sep 2007 22:18:30 -0000 1.42 --- utils.php 6 Sep 2007 22:59:50 -0000 1.43 *************** *** 282,286 **** where hg.group_id=? and h.host_id=hg.host_id'; ! $ret=$db->GetAll($query,array($groupId)); return($ret); } --- 282,294 ---- where hg.group_id=? and h.host_id=hg.host_id'; ! $res=$db->Execute($query,array($groupId)); ! $ret=array(); ! if($res) { ! while($t=$res->FetchRow()) { ! $ret[$t['host_id']]=$t; ! } ! } else { ! echo "Error in query $query. Message: ".$db->ErrorMsg(); ! } return($ret); } *************** *** 629,633 **** perfdata_host h left join perfdata_delete_policy d on h.bin_delete_policy_id=d.policy_id where h.host_id=? '; ! if(!$res=$db->GetRow($query,array($metric_id))) { return(FALSE); } --- 637,641 ---- perfdata_host h left join perfdata_delete_policy d on h.bin_delete_policy_id=d.policy_id where h.host_id=? '; ! if(!$res=$db->GetRow($query,array($host_id))) { return(FALSE); } *************** *** 641,644 **** --- 649,669 ---- } + function get_host_raw_del_policy(&$db,$host_id) { + // if policy set in host + $query='select h.raw_delete_policy_individual,d.policy_name,d.delete_policy_seconds from + perfdata_host h left join + perfdata_delete_policy d on h.raw_delete_policy_id=d.policy_id where h.host_id=? '; + if(!$res=$db->GetRow($query,array($host_id))) { + return(FALSE); + } + if($res['raw_delete_policy_individual']!==NULL) { + return(array('source'=>'Host Individual','policy_seconds'=>$res['raw_delete_policy_individual'])); + } + if($res['policy_name']!==NULL) { + return(array('source'=>'Host Policy','policy_name'=>$res['policy_name'],'policy_seconds'=>$res['delete_policy_seconds'])); + } + return(array('source'=>'none')); + } + function get_group_bin_del_policy(&$db,$group_id) { // if policy set in group *************** *** 658,661 **** --- 683,704 ---- } + function get_group_raw_del_policy(&$db,$group_id) { + // if policy set in group + $query='select g.raw_delete_policy_individual,d.policy_name,d.delete_policy_seconds from + perfdata_groups g left join + perfdata_delete_policy d on g.raw_delete_policy_id=d.policy_id where g.group_id=? '; + if(!$res=$db->GetRow($query,array($group_id))) { + return(FALSE); + } + if($res['raw_delete_policy_individual']!==NULL) { + return(array('source'=>'Group Individual','policy_seconds'=>$res['raw_delete_policy_individual'])); + } + if($res['policy_name']!==NULL) { + return(array('source'=>'Group Policy','policy_name'=>$res['policy_name'],'policy_seconds'=>$res['delete_policy_seconds'])); + } + return(array('source'=>'none')); + } + + function get_group_bin_del_policy_from_hostid(&$db,$host_id) { // if policy is set in group. If more than one group match, then the group with the longest policy matches. Index: perfparse.php =================================================================== RCS file: /cvsroot/perfparse/_perfparse-phpgui/perfparse.php,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** perfparse.php 5 Sep 2007 22:18:30 -0000 1.55 --- perfparse.php 6 Sep 2007 22:59:50 -0000 1.56 *************** *** 612,615 **** --- 612,621 ---- // get all needed object names and ids + // default delete policies + $default_bin_policy=get_delete_policy($db,0); + $default_raw_policy=get_delete_policy($db,1); + $smarty->assign_by_ref('default_bin_policy',$default_bin_policy); + $smarty->assign_by_ref('default_raw_policy',$default_raw_policy); + // group info $groupinfos=get_groups($db); *************** *** 620,641 **** $smarty->assign_by_ref('hostinfos',$hostinfos); ! if($bin_group_policy=get_group_bin_del_policy($db,$group_id)==FALSE) { $smarty->assign('sql_error',$db->ErrorMsg()); } $smarty->assign_by_ref('bin_group_policy',$bin_group_policy); - } get_request_var('host_id','int',FALSE); if($host_id != FALSE) { $metricsinfos=get_metrics_from_hostid($db,$host_id); } echo "<pre>groupinfos:\n"; print_r($groupinfos); echo "\n</pre>"; echo "<pre>hostinfos:\n"; print_r($hostinfos); echo "\n</pre>"; echo "<pre>metricsinfos:\n"; print_r($metricsinfos); echo "\n</pre>"; echo "<pre>bin_group_policy:\n"; print_r($bin_group_policy); echo "\n</pre>"; ! if($effectivepolicy=get_effective_bin_del_policy($db,1/* testing */)==FALSE) { $smarty->assign('sql_error',$db->ErrorMsg); //debug: --- 626,671 ---- $smarty->assign_by_ref('hostinfos',$hostinfos); ! if(($bin_group_policy=get_group_bin_del_policy($db,$group_id))==FALSE) { $smarty->assign('sql_error',$db->ErrorMsg()); } $smarty->assign_by_ref('bin_group_policy',$bin_group_policy); + if(($raw_group_policy=get_group_raw_del_policy($db,$group_id))==FALSE) { + $smarty->assign('sql_error',$db->ErrorMsg()); + } + $smarty->assign_by_ref('raw_group_policy',$raw_group_policy); + } + // host info get_request_var('host_id','int',FALSE); if($host_id != FALSE) { + $selected_host=$hostinfos[$host_id]['host_name']; // todo: check if in group? + $smarty->assign_by_ref('selected_host',$selected_host); $metricsinfos=get_metrics_from_hostid($db,$host_id); + $smarty->assign_by_ref('metricsinfos',$metricsinfos); + + if(($bin_host_policy=get_host_bin_del_policy($db,$host_id))==FALSE) { + $smarty->assign('sql_error',$db->ErrorMsg()); + } + $smarty->assign_by_ref('bin_host_policy',$bin_host_policy); + + if(($raw_host_policy=get_host_raw_del_policy($db,$host_id))==FALSE) { + $smarty->assign('sql_error',$db->ErrorMsg()); + } + $smarty->assign_by_ref('raw_host_policy',$raw_host_policy); + } + /* debug + echo "<pre>group_id: $group_id\n</pre>"; echo "<pre>groupinfos:\n"; print_r($groupinfos); echo "\n</pre>"; echo "<pre>hostinfos:\n"; print_r($hostinfos); echo "\n</pre>"; echo "<pre>metricsinfos:\n"; print_r($metricsinfos); echo "\n</pre>"; echo "<pre>bin_group_policy:\n"; print_r($bin_group_policy); echo "\n</pre>"; + echo "<pre>bin_host_policy:\n"; print_r($bin_host_policy); echo "\n</pre>"; + */ ! /* debug ! if($effectivepolicy=get_effective_bin_del_policy($db,1)==FALSE) { $smarty->assign('sql_error',$db->ErrorMsg); //debug: *************** *** 644,647 **** --- 674,678 ---- echo "<pre>effectivepolicy:\n"; print_r($effectivepolicy); echo "\n</pre>"; + */ |