Closed frontierliu closed 6 years ago
I will take a look and create an fix using you suggestion
Actually looking at the first code you pasted, it appears to be missing a closing square bracket, so that may be the answer rather than just removing it. I’ll tske a look at the file history tomorrow.
please take a look at the code "lib/template.php" that build $template_input_field array, it is the original reason. actually , the structure $template_input_field shoud be remove totally, I thought.
Question, where did this template come from? Was it a 0.8.8 installation?
There was a commit b04367203bc42d7464e944d3d3a2c09093fad824 - Fixed issue with custom data source information being lost when saved… which introduced the templated field value. This would suggest that your template is older than this and hence is having the problem. This was dated 22 Jul 2013 and 1.0.0 was first released 29 Jan 2017 so it kinda confirms my suspicions that maybe it's an older template and needs updating.
Please submit a screen shot of the data template, and the data query for the broken graphs.
thanks for your repid reply,I have checked the" rony's commit" which netniv suggested,it had already been in my cacti source code, but it is not relative to this problem. I was upgraded from cacti 0.8.8h to 1.1.28 about a month ago, and when I changed the data template "Interface traffic" any properties, I found that problem - all interface traffice graphs collected no data anymore.
here is the screenshot of the data query "snmp - Interface Statistics":
the data query:
herer is the screenshot of data template "Interface -traffic":
Your issue is that the checkboxes on the three most important components of the template went unchecked. So you lost the association. You will have to recheck, and then save. Maybe you will get lucky and the associations will be preserved, but I doubt it. See the image below:
Closing due to no response.
Problem: When I save a snmp query data template (interface traffic) which has been used in live hosts,the graphs associated that data template collect no data anymore.
analyze: In the table poller_item , check the poller item of Interface traffic records, the column "rrd_num" changed from 2 to 4. That led to collect data fault. It is because the rebuild poller_item procedure has a bug on update the data_input_data table when saving the interface traffic data template.
solved: check the "lib/template.php",line 106 and line 109: $did_vals .= ($did_cnt == 0 ? '':',') . '(' . $input_field['id'] . ', ' . $data_source['id'] . ', ' . db_qstr($template_input_fields[$input_field['id']['value']) . ')'; change to: $did_vals .= ($did_cnt == 0 ? '':',') . '(' . $input_field['id'] . ', ' . $data_source['id'] . ', ' . db_qstr($input_field['value']) . ')';
I has checked the Cacti old version, this problem started at 0.8.7h. In the code before 0.8.7h, It was "($input_field['value'])", which work fine.