DBCALL ERROR: SQL Save on table 'thold_template': Column 'suggested_name' does not exist, unable to save!

Support questions about the Threshold plugin

Moderators: Moderators, Developers

Post Reply
Author
Message
chipmonk
Posts: 13
Joined: Sun Sep 17, 2017 6:35 pm

DBCALL ERROR: SQL Save on table 'thold_template': Column 'suggested_name' does not exist, unable to save!

#1 Post by chipmonk » Mon Aug 26, 2019 9:40 pm

Running Debian 10 Buster with Cacti 1.2.2 and Thold 1.3.2. Just upgraded from Thold 1.0.4 because I looking to resolve some issues with sorting by "In State". Now when I go into my Threshold templates and try to save an existing threshold I receive "DBCALL ERROR: SQL Save on table 'thold_template': Column 'suggested_name' does not exist, unable to save!"

Appreciate your support,
chipmonk

netniV
Cacti Guru User
Posts: 2779
Joined: Sun Aug 27, 2017 12:05 am

Re: DBCALL ERROR: SQL Save on table 'thold_template': Column 'suggested_name' does not exist, unable to save!

#2 Post by netniV » Tue Aug 27, 2019 7:36 am

Try making sure you've visited the plugins page so that any database upgrade work is completed. The column should have been added automatically:

Code: Select all

        if (cacti_version_compare($oldv, '1.0.4', '<')) {
		....
                if (!db_column_exists('thold_template', 'suggested_name')) {
                        db_execute("ALTER TABLE thold_template
                                ADD COLUMN `suggested_name` varchar(255) NOT NULL default '' AFTER `name`");
                }
        }

chipmonk
Posts: 13
Joined: Sun Sep 17, 2017 6:35 pm

Re: DBCALL ERROR: SQL Save on table 'thold_template': Column 'suggested_name' does not exist, unable to save!

#3 Post by chipmonk » Tue Aug 27, 2019 12:13 pm

Thanks for your reply!

I am also running Monitor so I do not uninstall thold, I disable then enable. Please see attached images.

Thanks for your help,
chip
Attachments
plugins.PNG
plugins.PNG (69.93 KiB) Viewed 35 times
template-save.PNG
template-save.PNG (66.17 KiB) Viewed 35 times


chipmonk
Posts: 13
Joined: Sun Sep 17, 2017 6:35 pm

Re: DBCALL ERROR: SQL Save on table 'thold_template': Column 'suggested_name' does not exist, unable to save!

#5 Post by chipmonk » Tue Aug 27, 2019 5:55 pm

MariaDB [cacti]> SHOW CREATE TABLE thold_template\G
*************************** 1. row ***************************
Table: thold_template
Create Table: CREATE TABLE `thold_template` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`hash` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`data_template_id` int(10) DEFAULT 0,
`data_template_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`data_source_id` int(10) NOT NULL DEFAULT 0,
`data_source_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' ,
`data_source_friendly` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAUL T '',
`thold_hi` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`thold_low` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`thold_fail_trigger` int(10) unsigned DEFAULT NULL,
`time_hi` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`time_low` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`time_fail_trigger` int(12) NOT NULL DEFAULT 1,
`time_fail_length` int(12) NOT NULL DEFAULT 1,
`thold_warning_hi` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`thold_warning_low` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`thold_warning_fail_trigger` int(10) unsigned DEFAULT NULL,
`thold_warning_fail_count` int(11) NOT NULL DEFAULT 0,
`time_warning_hi` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`time_warning_low` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`time_warning_fail_trigger` int(12) NOT NULL DEFAULT 1,
`time_warning_fail_length` int(12) NOT NULL DEFAULT 1,
`thold_enabled` enum('on','off') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ' on',
`thold_type` int(3) NOT NULL DEFAULT 0,
`bl_ref_time_range` int(10) unsigned DEFAULT NULL,
`bl_pct_down` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`bl_pct_up` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`bl_fail_trigger` int(10) unsigned DEFAULT NULL,
`bl_fail_count` int(11) unsigned DEFAULT NULL,
`bl_alert` int(2) NOT NULL DEFAULT 0,
`repeat_alert` int(10) DEFAULT NULL,
`notify_extra` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`notify_warning_extra` varchar(512) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`notify_templated` char(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'on',
`notify_warning` int(10) unsigned DEFAULT NULL,
`notify_alert` int(10) unsigned DEFAULT NULL,
`data_type` int(12) NOT NULL DEFAULT 0,
`cdef` int(11) NOT NULL DEFAULT 0,
`percent_ds` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`expression` varchar(512) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`exempt` char(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`thold_hrule_alert` int(11) unsigned DEFAULT NULL,
`thold_hrule_warning` int(11) unsigned DEFAULT NULL,
`restored_alert` char(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`reset_ack` char(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off',
`persist_ack` char(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'off',
`email_body` varchar(1024) COLLATE utf8mb4_unicode_ci DEFAULT '',
`email_body_warn` varchar(1024) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' ,
`trigger_cmd_high` varchar(512) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' ,
`trigger_cmd_low` varchar(512) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`trigger_cmd_norm` varchar(512) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' ,
`syslog_priority` int(2) DEFAULT NULL,
`syslog_facility` int(2) DEFAULT NULL,
`syslog_enabled` char(3) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
`snmp_event_category` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`snmp_event_severity` tinyint(1) NOT NULL DEFAULT 3,
`snmp_event_warning_severity` tinyint(1) NOT NULL DEFAULT 2,
`notes` varchar(1024) COLLATE utf8mb4_unicode_ci DEFAULT '',
PRIMARY KEY (`id`),
KEY `id` (`id`),
KEY `data_source_id` (`data_source_id`),
KEY `data_template_id` (`data_template_id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode _ci COMMENT='Table of thresholds defaults for graphs'
1 row in set (0.000 sec)

netniV
Cacti Guru User
Posts: 2779
Joined: Sun Aug 27, 2017 12:05 am

Re: DBCALL ERROR: SQL Save on table 'thold_template': Column 'suggested_name' does not exist, unable to save!

#6 Post by netniV » Wed Aug 28, 2019 1:17 pm

For some reason, you still have 'notify_templated' but you don't have 'suggested_name'. To correct this run the following for your specific version of thold:

Code: Select all

ALTER TABLE `thold_template` ADD COLUMN`suggested_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '';
ALTER TABLE `thold_template` DROP COLUMN `notify_templated`;
This should only be used once and only in this exact situation.

chipmonk
Posts: 13
Joined: Sun Sep 17, 2017 6:35 pm

Re: DBCALL ERROR: SQL Save on table 'thold_template': Column 'suggested_name' does not exist, unable to save!

#7 Post by chipmonk » Wed Aug 28, 2019 2:14 pm

Excellent work! Thanks for your support netniV.

Post Reply