Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
We just upgraded Cacti from 0.8.7g to 0.8.7i. After that upgrade, and all was working fine, we upgraded some of our plugins. We've upgraded Settings to 0.71 and thold from 0.4.2 to 0.4.9. Since the plugin upgrade, thold isn't working properly. We don't see anything in the cacti logs about it. It appears to have stopped collecting data. When we update/change a thold template, it doesn't propagate those changes down to the individually configure thold's.
I did a list from the thold_data table and noticed that "lasttime" for every entry is 0000-00-00 00:00:00. The last read and oldvalue columns aren't updating as well. What can I check next?
CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1054', SQL:"SELECT thold_data.id, thold_data.name AS thold_name, thold_data.graph_id, thold_data.percent_ds, thold_data.expression, thold_data.data_type, thold_data.cdef, thold_data.rra_id, thold_data.data_id, thold_data.lastread, UNIX_TIMESTAMP(thold_data.lasttime) AS lasttime, thold_data.oldvalue, data_template_rrd.data_source_name as name, data_template_rrd.data_source_type_id, data_template_data.rrd_step, data_template_rrd.rrd_maximum FROM thold_data LEFT JOIN data_template_rrd ON (data_template_rrd.id = thold_data.data_id) LEFT JOIN data_template_data ON ( data_template_data.local_data_id = thold_data.rra_id ) WHERE data_template_rrd.data_source_name!='' AND thold_data.rra_id IN(2121)"
I checked the thold_data table and compared it with the "database.php" file in the thold/includes directory. I noticed that the 'expression' column was missing. I altered the table to add that column and now thold data is collecting once again. I am going to monitor for a few more hours to make sure it's working correctly.
Now the next question.... Did I have that 'expression' column before the upgrade? Or did it not get added in the upgrade script?
Welp, thought i had thold running, but it isn't 100% there yet. It is working as far as templates and creating tholds, but now none of them are triggered for warning or alerts. They don't change colors or do anything. I am even testing with one that uses exact value from the SNMP read. Its current value is around 242 (VPN Connections) and we have the trigger alert set to 180. It's pulling the correct value, just not triggering or noticing that it's higher than our alert we've set.
This is actually after a fresh install of the thold plugin. We removed all tholds and thold templates. Re-installed the thold plugin and started some templates and tholds from scratch.
So when I upgraded from THOLD 0.4.3 ---> 0.4.9 I noticed after the upgrade the following missing fields in my thold data table:
==============================================
thold_warning_hi:
==============================================
thold_warning_low:
==============================================
thold_warning_fail_trigger:
==============================================
thold_warning_fail_count:
==============================================
time_warning_hi:
==============================================
time_warning_low:
==============================================
time_warning_fail_trigger:
==============================================
time_warning_fail_length:
==============================================
lasttime:
==============================================
notify_warning_extra:
==============================================
notify_warning:
==============================================
notify_alert:
==============================================
==============================================
expression:
==============================================
I ended up writing a script to dump my existing data from the THOLD 0.4.3. I then add the missing fields then inserted the data into the upgraded 0.4.9 table. I was back in business after that. You will also notice that the thold_template table has missing fileds after the upgrade.
Lalbee99 wrote:So when I upgraded from THOLD 0.4.3 ---> 0.4.9 I noticed after the upgrade the following missing fields in my thold data table:
==============================================
thold_warning_hi:
==============================================
thold_warning_low:
==============================================
thold_warning_fail_trigger:
==============================================
thold_warning_fail_count:
==============================================
time_warning_hi:
==============================================
time_warning_low:
==============================================
time_warning_fail_trigger:
==============================================
time_warning_fail_length:
==============================================
lasttime:
==============================================
notify_warning_extra:
==============================================
notify_warning:
==============================================
notify_alert:
==============================================
==============================================
expression:
==============================================
I ended up writing a script to dump my existing data from the THOLD 0.4.3. I then add the missing fields then inserted the data into the upgraded 0.4.9 table. I was back in business after that. You will also notice that the thold_template table has missing fileds after the upgrade.
So you say you created a script for this? Is it possible to upload the script or at least explain how you added those fields to the proper table? I am also having the same problem. Although, I noticed it when I was trying to update a threshold template and it was failing with the following error:
CMDPHP: Poller[0] ERROR: SQL Save Command Failed for Table 'thold_template'. Error was 'Unknown column 'expression' in 'field list''
I was able to solve it by just adding the expression column to my thold_template and thold_data tables. It would be nice if there were a sql script included in the plugin so that we can at least see what the structure is supposed to look like. The structure in the database.php script is confusing. Thing appear to be working fine thus far.
1) I used the following perl script to output my 0.4.3 data # delimited.
#!/usr/bin/perl
sub GET_THOLD {
use DBI;
$output_file="${TMP_DIR}thold_043_data";
open OUT2, ">>$output_file";
my $dsn = "DBI:mysql:${MYSQL_CACTI_DB}:localhost";
my $db_user_name = "${MYSQL_CACTI_USER}";
my $db_password = "${MYSQL_CACTI_PASSWORD}";
my $dbh = DBI->connect($dsn, $db_user_name, $db_password);
my $sql = qq{ SELECT id,'#',name,'#',rra_id,'#',data_id,'#',graph_id,'#',graph_template,'#',data_template,'#',thold_hi,'#',thold_low,'#',thold_fail_trigger,'#',time_hi,'#',time_low,'#',time_fail_trigger,'#',time_fail_length,'#',thold_fail_count,'#',thold_alert,'#',thold_enabled,'#',thold_type,'#',bl_enabled,'#',bl_ref_time,'#',bl_ref_time_range,'#',bl_pct_down,'#',bl_pct_up,'#',bl_fail_trigger,'#',bl_fail_count,'#',bl_alert,'#',lastread,'#',oldvalue,'#',repeat_alert,'#',notify_extra,'#',host_id,'#',syslog_priority,'#',data_type,'#',cdef,'#',percent_ds,'#',template,'#',template_enabled,'#',tcheck,'#',exempt,'#',restored_alert from thold_data;};
my $sth = $dbh->prepare( $sql );
$sth->execute();
I had a problem with thold 0.4.9 after upgrading to cacti 0.8.7i too. I fixed it myself by adding the column "expression" to the thold_data table in mysql
I was attempting to update thold from 0.4.1 to 0.4.9 and ran into this same issue. I tried running the update.php script, however, that did not fully update mysql. I needed to manually run these commands to get 0.4.9 fully-functioning:
ALTER TABLE thold_data DROP COLUMN bl_enabled;
ALTER TABLE thold_template DROP COLUMN bl_enabled;
ALTER TABLE thold_data ADD COLUMN expression varchar(70) NOT NULL DEFAULT '';
ALTER TABLE thold_template ADD COLUMN expression varchar(70) NOT NULL DEFAULT '';