thold_data and thold_template not created - thold

Support questions about the Threshold plugin

Moderators: Developers, Moderators

Post Reply
ncfrak
Posts: 10
Joined: Tue Sep 06, 2011 5:40 am

thold_data and thold_template not created - thold

Post by ncfrak »

Hello,

I have a strange problem. When I install thold the thold_data and thold_template tables are not created within the cacti DB.
Cacti 0.8.7g
Settings 0.71
Threshold (Thold) 0.4.9
PHP Version 5.3.6
Plugin Architecture 2.8

But everything seems okay when i install it and enable it. When I want to create a new threshold it says :
Error: A template with that Data Source already exists!


Thus these error messages :

Code: Select all

01/19/2012 06:20:22 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"DELETE FROM plugin_thold_log WHERE time<1324315222'
01/19/2012 06:20:22 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"INSERT INTO plugin_thold_host_failed (host_id) VALUES (166), (308), (463), (468), (545), (546), (587), (664), (670), (665), (647), (648), (649), (650), (651), (704), (705), (706), (707), (708), (709), (710), (711), (712), (713), (714), (715), (716), (717), (718), (719), (720), (721), (722), (723), (724), (725), (732), (734), (737), (738), (739), (740), (743), (744), (746), (787), (788), (789), (790), (793), (807), (810), (851), (883), (884), (889)'
01/19/2012 06:20:22 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"TRUNCATE TABLE plugin_thold_host_failed'
01/19/2012 06:20:22 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"SELECT * FROM plugin_thold_host_failed"
01/19/2012 06:20:22 PM - CMDPHP: Poller[0] ERROR: A DB Exec Failed!, Error:'1146', SQL:"UPDATE thold_data SET tcheck=0'
01/19/2012 06:20:22 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed!, Error:'1146', SQL:"SELECT * FROM thold_data WHERE thold_enabled='on' AND tcheck=1"

I looked around the internet and checked my mysql mode which is not strict

Code: Select all

mysql> SELECT @@sql_mode;
+------------+
| @@sql_mode |
+------------+
|            |
+------------+
1 row in set (0.00 sec)
I don't know why the tables are not created, can someone help me on this matter?
cigamit
Developer
Posts: 3368
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: thold_data and thold_template not created - thold

Post by cigamit »

Can you import the thold.sql file manually?
ncfrak
Posts: 10
Joined: Tue Sep 06, 2011 5:40 am

Re: thold_data and thold_template not created - thold

Post by ncfrak »

Hi,

Thanks for the reply.
Yes after posting on the forum, I imported manually the thold tables (at least the ones with the name thold in it) from another cacti server :
thold_data.sql
thold_template.sql
plugin_thold_contacts.sql
plugin_thold_log.sql
plugin_thold_template_contact.sql
plugin_thold_threshold_contact.sql

Stil the same error "Error: A template with that Data Source already exists!"

Where can I find the thold.sql dump ? I did not find one except from the other cacti server but I'd like to find an "official" one
ncfrak
Posts: 10
Joined: Tue Sep 06, 2011 5:40 am

Re: thold_data and thold_template not created - thold

Post by ncfrak »

I did not find the thold.sql in the latest thold version 0.4.9-3 but I found it in 0.4.8 package.
=> I installed it and still no thold tables in the cacti DB.

So I installed manually using

Code: Select all

mysql -u cacti -p cacti < cacti/plugins/thold/thold.sql
Still the same error : "Error: A template with that Data Source already exists!"
No rows are created in the thold tables.

I'm using the plugin architecture 2.8 and I've noticed that 0.4.9-3 (not sure about 0.4.8) needs 2.9+
I tried to installed it and failed, is it mandatory?

Thanks
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: thold_data and thold_template not created - thold

Post by noname »

>> "Error: A template with that Data Source already exists!"

This error will occur when Cacti failed to save threshold template for some reason (not only about datasource, maybe).

Try this query:
% mysql -u cacti -p cacti -t -e 'describe thold_template;'

Here is my sample from thold-v0.4.9-3 (fresh installed):

Code: Select all

+----------------------------+------------------+------+-----+---------+----------------+
| Field                      | Type             | Null | Key | Default | Extra          |
+----------------------------+------------------+------+-----+---------+----------------+
| id                         | int(11)          | NO   | PRI | NULL    | auto_increment |
| hash                       | varchar(32)      | NO   |     | NULL    |                |
| name                       | varchar(100)     | NO   |     |         |                |
| data_template_id           | int(10)          | NO   | MUL | 0       |                |
| data_template_name         | varchar(100)     | NO   |     |         |                |
| data_source_id             | int(10)          | NO   | MUL | 0       |                |
| data_source_name           | varchar(100)     | NO   |     |         |                |
| data_source_friendly       | varchar(100)     | NO   |     |         |                |
| thold_hi                   | varchar(100)     | YES  |     | NULL    |                |
| thold_low                  | varchar(100)     | YES  |     | NULL    |                |
| thold_fail_trigger         | int(10) unsigned | YES  |     | NULL    |                |
| time_hi                    | varchar(100)     | YES  |     | NULL    |                |
| time_low                   | varchar(100)     | YES  |     | NULL    |                |
| time_fail_trigger          | int(12)          | NO   |     | 1       |                |
| time_fail_length           | int(12)          | NO   |     | 1       |                |
| thold_warning_hi           | varchar(100)     | YES  |     | NULL    |                |
| thold_warning_low          | varchar(100)     | YES  |     | NULL    |                |
| thold_warning_fail_trigger | int(10) unsigned | YES  |     | NULL    |                |
| thold_warning_fail_count   | int(11)          | NO   |     | 0       |                |
| time_warning_hi            | varchar(100)     | YES  |     | NULL    |                |
| time_warning_low           | varchar(100)     | YES  |     | NULL    |                |
| time_warning_fail_trigger  | int(12)          | NO   |     | 1       |                |
| time_warning_fail_length   | int(12)          | NO   |     | 1       |                |
| thold_enabled              | enum('on','off') | NO   |     | on      |                |
| thold_type                 | int(3)           | NO   |     | 0       |                |
| bl_ref_time_range          | int(10) unsigned | YES  |     | NULL    |                |
| bl_pct_down                | varchar(100)     | YES  |     | NULL    |                |
| bl_pct_up                  | varchar(100)     | YES  |     | NULL    |                |
| bl_fail_trigger            | int(10) unsigned | YES  |     | NULL    |                |
| bl_fail_count              | int(11) unsigned | YES  |     | NULL    |                |
| bl_alert                   | int(2)           | NO   |     | 0       |                |
| repeat_alert               | int(10) unsigned | YES  |     | NULL    |                |
| notify_default             | enum('on','off') | YES  |     | NULL    |                |
| notify_extra               | varchar(512)     | YES  |     | NULL    |                |
| notify_warning_extra       | varchar(512)     | YES  |     | NULL    |                |
| notify_warning             | int(10) unsigned | YES  |     | NULL    |                |
| notify_alert               | int(10) unsigned | YES  |     | NULL    |                |
| data_type                  | int(12)          | NO   |     | 0       |                |
| cdef                       | int(11)          | NO   |     | 0       |                |
| percent_ds                 | varchar(64)      | NO   |     |         |                |
| expression                 | varchar(70)      | NO   |     |         |                |
| exempt                     | char(3)          | NO   |     | off     |                |
| restored_alert             | char(3)          | NO   |     | off     |                |
+----------------------------+------------------+------+-----+---------+----------------+
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest