Cacti BUG (graph cannot be modified)

Source: Internet
Author: User
Article Title: cacti BUG (graph cannot be modified ). Linux is a technology channel of the IT lab in China. Some basic categories, such as desktop applications, Linux system management, kernel research, embedded systems, and open-source systems, found a small bug when cacti (version 0.8.7b) was used, you cannot modify the existing graph because Data Source is always empty when you modify the graph. You can view the log and find a line like this:
11/20/2008 10:24:32 PM-Internal PHP: Poller [0] ERROR: SQL Assoc Failed !, Error: '200', SQL: "select CONCAT_WS ('', case when host.de
Token is null then 'No Host-'when host. description is not null then'' 'end, data_template_data.name_cache, '(', data_templa
Te_rrd.data_source_name, ') as name, data_template_rrd.id from (data_template_data, data_template_rrd, data_local) left join ho
St on (data_local.host_id = host. id) where data_template_rrd.local_data_id = data_local.id and data_template_data.local_data_id = data
_ Local. id and data_local.host_id = 7 order by name"
This is because the SQL statement: select CONCAT_WS ('', case when host.de
Token is null then 'No Host-'when host. description is not null then'' 'end, data_template_data.name_cache, '(', data_templa
Te_rrd.data_source_name, ') as name, data_template_rrd.id from (data_template_data, data_template_rrd, data_local) left join ho
St on (data_local.host_id = host. id) where data_template_rrd.local_data_id = data_local.id and data_template_data.local_data_id = data
_ Local. id and data_local.host_id = 7 order by name
An error occurred. I put this statement in mysql for manual execution. It is indeed wrong, but I have been studying it for a long time and do not know how to change it, finally, we had to find the PHP file in this row in line 119th of html_form_template.php and find the following:
$ Struct_graph_item ["task_item_id"] ["SQL"] = "select
CONCAT_WS ('',
Case
When host. description is null then 'No Host -'
When host. description is not null then''
End, data_template_data.name_cache, '(', data_template_rrd.data_source_name, ') as name,
Data_template_rrd.id
From (data_template_data, data_template_rrd, data_local)
Left join host on (data_local.host_id = host. id)
Where data_template_rrd.local_data_id = data_local.id
And data_template_data.local_data_id = data_local.id
". (Empty ($ host_id )? "": "And data_local.host_id = $ host_id ")."
Order by name ";
Delete case statement
Change it:
$ Struct_graph_item ["task_item_id"] ["SQL"] = "select
CONCAT_WS ('',
Data_template_data.name_cache, '(', data_template_rrd.data_source_name, ') as name,
Data_template_rrd.id
From (data_template_data, data_template_rrd, data_local)
Left join host on (data_local.host_id = host. id)
Where data_template_rrd.local_data_id = data_local.id
And data_template_data.local_data_id = data_local.id
". (Empty ($ host_id )? "": "And data_local.host_id = $ host_id ")."
Order by name ";
After that, everything will be okay, but I don't know why the original sentence failed. If you know something, please advise me.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.