Update of /cvsroot/perfparse/_perfparse/modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12195/modules
Modified Files:
storage_mysql.c
Log Message:
make deletion policies less complex. No individual settings in objects allowed any more.
Index: storage_mysql.c
===================================================================
RCS file: /cvsroot/perfparse/_perfparse/modules/storage_mysql.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** storage_mysql.c 3 Jan 2008 22:04:44 -0000 1.22
--- storage_mysql.c 24 Apr 2008 22:29:09 -0000 1.23
***************
*** 572,580 ****
static int isSaveBinAllowed(char *sHost, char *sService, char *sMetric)
{
pp_log_func;
/* Check policy to find out if we are allowed to save this metric */
static int bResult;
! g_string_printf(s_SQL, "SELECT m.bin_delete_policy_individual, p.delete_policy_seconds FROM perfdata_service_metric m, perfdata_service s, perfdata_host h, perfdata_delete_policy p WHERE h.host_id=s.host_id AND s.service_id = m.service_id and m.bin_delete_policy_id=p.policy_id and h.host_name='%s'",
sql_escape(sHost, PERCENT_ESCAPE_CHAR));
g_string_append_printf(s_SQL, " AND s.service_description = '%s'",
--- 572,581 ----
static int isSaveBinAllowed(char *sHost, char *sService, char *sMetric)
{
+ // TODO: Check Policies of Service/Host/Hostgroup also.
pp_log_func;
/* Check policy to find out if we are allowed to save this metric */
static int bResult;
! g_string_printf(s_SQL, "SELECT p.delete_policy_seconds FROM perfdata_service_metric m, perfdata_service s, perfdata_host h, perfdata_delete_policy p WHERE h.host_id=s.host_id AND s.service_id = m.service_id and m.bin_delete_policy_id=p.policy_id and h.host_name='%s'",
sql_escape(sHost, PERCENT_ESCAPE_CHAR));
g_string_append_printf(s_SQL, " AND s.service_description = '%s'",
***************
*** 587,591 ****
if (rows() == 0) return TRUE;
! if (!result_row[0] || iData(0) > 0 || iData(1) > 0)
bResult = TRUE;
else
--- 588,592 ----
if (rows() == 0) return TRUE;
! if (!result_row[0] || iData(0) > 0 )
bResult = TRUE;
else
|