prob data_sources sql 0.8.7-pgsql 0.8.7g

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
heiklehm
Posts: 11
Joined: Fri May 28, 2010 2:44 pm

prob data_sources sql 0.8.7-pgsql 0.8.7g

Post by heiklehm »

Hallo,

I am use cacti-0.8.7-pgsql with PG8 on sol10.

I can create a new "Data Sources" successful,
but after them not listed.


Now I tested some.

2011-03-03 08:14:00 CETLOG: statement: SELECT data_template_data.local_data_id AS id, Min(data_template_data.rrd_step*rra.steps) AS poller_interval FROM data_template INNER JOIN (data_local INNER JOIN ((data_template_data_rra INNER JOIN data_template_data ON data_template_data_rra.data_template_data_id=data_template_data.id) INNER JOIN rra ON data_template_data_rra.rra_id = rra.id) ON data_local.id = data_template_data.local_data_id) ON data_template.id = data_template_data.data_template_id AND (data_template_data.name_cache like '%%pag%%' OR data_template.name like '%%pag%%' OR data_input.name like '%%pag%%') GROUP BY data_template_data.local_data_id
2011-03-03 08:14:00 CETERROR: missing FROM-clause entry for table "data_input"


seen to be 2(+) problems:

$ vi data_sources.php
1030 $total_rows = sizeof(db_fetch_assoc("SELECT
1031 data_local.id
1032 FROM (data_local CROSS JOIN data_template_data)
1033 LEFT JOIN data_input
1034 ON (data_input.id=data_template_data.data_input_id)
1035 LEFT JOIN data_template
1036 ON (data_local.data_template_id=data_template.id)
1037 WHERE data_local.id=data_template_data.local_data_id
1038 $sql_where"));
1039
1040 $poller_intervals = array_rekey(db_fetch_assoc("SELECT data_template_data.local_data_id AS id,
1041 Min(data_template_data.rrd_step*rra.steps) AS poller_interval
1042 FROM data_template
1043 INNER JOIN (data_local
1044 INNER JOIN ((data_template_data_rra
1045 INNER JOIN data_template_data ON data_template_data_rra.data_template_data_id=data_template_data.id)
1046 INNER JOIN rra ON data_template_data_rra.rra_id = rra.id) ON data_local.id = data_template_data.local_data_id) ON dat
a_template.id = data_template_data.data_template_id
1047 $sql_where
1048 GROUP BY data_template_data.local_data_id"), "id", "poller_interval");

- 1. prob
-line 1047 missing "WHERE"
- sql_whereX begin with "AND"
seen missing complete line, like 1037
- incl. V cacti-0.8.7g


- 2. prob
- this query dont work on PG8

cacti=# SELECT data_template_data.local_data_id AS id,
cacti-# Min(data_template_data.rrd_step*rra.steps) AS poller_interval
cacti-# FROM data_template,data_input
cacti-# INNER JOIN (data_local INNER JOIN ((data_template_data_rra
cacti(# INNER JOIN data_template_data
cacti(# ON data_template_data_rra.data_template_data_id=data_template_data.id)
cacti(# INNER JOIN rra ON data_template_data_rra.rra_id = rra.id)
cacti(# ON data_local.id = data_template_data.local_data_id)
cacti-# ON data_template.id = data_template_data.data_template_id
cacti-# WHERE data_local.id=data_template_data.local_data_id
cacti-# AND (data_template_data.name_cache like '%%pag%%'
cacti(# OR data_template.name like '%%pag%%' OR data_input.name like '%%pag%%')
cacti-# GROUP BY data_template_data.local_data_id;
ERROR: invalid reference to FROM-clause entry for table "data_template"
LINE 9: ON data_template.id = data_template_data.data_template_id
^
HINT: There is an entry for table "data_template", but it cannot be referenced from this part of the query.

Sorry, i dont understand "inner join" to fix this.
Any idea?


regards Heiko
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests