Thold plugin will not save configuration/settings.

Beta testing discussion area

Moderators: Moderators, Developers

Post Reply
Author
Message
naven
Posts: 11
Joined: Tue Mar 31, 2015 4:54 pm

Thold plugin will not save configuration/settings.

#1 Post by naven » Sun Dec 30, 2018 5:57 pm

Hello,

I installed Cacti 1.20 Beta 4 today. I got Thold dev version from https://github.com/Cacti/plugin_thold (also today).

I am getting a dialog box saying:

Code: Select all

The Operation was successful. Details are below.
Record Updated
But the values are not updated. After refreshing the page the fields are empty.

cacti.log says:

Code: Select all

2018/12/30 23:48:23 - DBCALL ERROR: SQL Save Failed for Table 'thold_data'. SQL:'INSERT INTO thold_data (`id`, `name`, `name_cache`, `host_id`, `data_template_rrd_id`, `local_data_id`, `thold_enabled`, `exempt`, `repeat_alert`, `data_template_id`, `data_source_name`, `reset_ack`, `persist_ack`, `syslog_enabled`, `syslog_priority`, `syslog_facility`, `thold_hrule_warning`, `thold_hrule_alert`, `restored_alert`, `thold_type`, `template_enabled`, `thold_hi`, `thold_low`, `thold_fail_trigger`, `time_hi`, `time_low`, `time_fail_trigger`, `time_fail_length`, `thold_warning_hi`, `thold_warning_low`, `thold_warning_fail_trigger`, `time_warning_hi`, `time_warning_low`, `time_warning_fail_trigger`, `time_warning_fail_length`, `bl_thold_valid`, `bl_ref_time_range`, `bl_pct_down`, `bl_pct_up`, `bl_fail_trigger`, `notify_extra`, `notify_warning_extra`, `notify_warning`, `notify_alert`, `notes`, `data_type`, `percent_ds`, `cdef`, `expression`, `email_body`, `email_body_warn`, `trigger_cmd_high`, `trigger_cmd_low`, `trigger_cmd_norm`, `snmp_event_category`, `snmp_event_severity`, `snmp_event_warning_severity`, `local_graph_id`, `graph_template_id`) VALUES (1, 'Local Linux Machine - Logged in Users', 'Local Linux Machine - Logged in Users', 1, 57, 3, 'on', '', 0, 0, NULL, '', '', '', 3, 0, 0, 0, '', 0, '', '1', '0', 1, '', '', 1, 1, '1', '0', 1, '', '', 1, 1, 0, 86400, '', '', 2, '', '', 0, 0, '', 0, '', 0, '', 'An Alert has been issued that requires your attention. <br><br><strong>Device</strong>: <DESCRIPTION> (<HOSTNAME>)<br><strong>URL</strong>: <URL><br><strong>Message</strong>: <SUBJECT><br><br><GRAPH>', 'A Warning has been issued that requires your attention. <br><br><strong>Device</strong>: <DESCRIPTION> (<HOSTNAME>)<br><strong>URL</strong>: <URL><br><strong>Message</strong>: <SUBJECT><br><br><GRAPH>', 'bash /scripts/device_down.sh', 'bash /scripts/device_down.sh', 'bash /scripts/device_down.sh', '', 4, 3, 3, 16) ON DUPLICATE KEY UPDATE `name`=VALUES(`name`), `name_cache`=VALUES(`name_cache`), `host_id`=VALUES(`host_id`), `data_template_rrd_id`=VALUES(`data_template_rrd_id`), `local_data_id`=VALUES(`local_data_id`), `thold_enabled`=VALUES(`thold_enabled`), `exempt`=VALUES(`exempt`), `repeat_alert`=VALUES(`repeat_alert`), `data_template_id`=VALUES(`data_template_id`), `data_source_name`=VALUES(`data_source_name`), `reset_ack`=VALUES(`reset_ack`), `persist_ack`=VALUES(`persist_ack`), `syslog_enabled`=VALUES(`syslog_enabled`), `syslog_priority`=VALUES(`syslog_priority`), `syslog_facility`=VALUES(`syslog_facility`), `thold_hrule_warning`=VALUES(`thold_hrule_warning`), `thold_hrule_alert`=VALUES(`thold_hrule_alert`), `restored_alert`=VALUES(`restored_alert`), `thold_type`=VALUES(`thold_type`), `template_enabled`=VALUES(`template_enabled`), `thold_hi`=VALUES(`thold_hi`), `thold_low`=VALUES(`thold_low`), `thold_fail_trigger`=VALUES(`thold_fail_trigger`), `time_hi`=VALUES(`time_hi`), `time_low`=VALUES(`time_low`), `time_fail_trigger`=VALUES(`time_fail_trigger`), `time_fail_length`=VALUES(`time_fail_length`), `thold_warning_hi`=VALUES(`thold_warning_hi`), `thold_warning_low`=VALUES(`thold_warning_low`), `thold_warning_fail_trigger`=VALUES(`thold_warning_fail_trigger`), `time_warning_hi`=VALUES(`time_warning_hi`), `time_warning_low`=VALUES(`time_warning_low`), `time_warning_fail_trigger`=VALUES(`time_warning_fail_trigger`), `time_warning_fail_length`=VALUES(`time_warning_fail_length`), `bl_thold_valid`=VALUES(`bl_thold_valid`), `bl_ref_time_range`=VALUES(`bl_ref_time_range`), `bl_pct_down`=VALUES(`bl_pct_down`), `bl_pct_up`=VALUES(`bl_pct_up`), `bl_fail_trigger`=VALUES(`bl_fail_trigger`), `notify_extra`=VALUES(`notify_extra`), `notify_warning_extra`=VALUES(`notify_warning_extra`), `notify_warning`=VALUES(`notify_warning`), `notify_alert`=VALUES(`notify_alert`), `notes`=VALUES(`notes`), `data_type`=VALUES(`data_type`), `percent_ds`=VALUES(`percent_ds`), `cdef`=VALUES(`cdef`), `expression`=VALUES(`expression`), `email_body`=VALUES(`email_body`), `email_body_warn`=VALUES(`email_body_warn`), `trigger_cmd_high`=VALUES(`trigger_cmd_high`), `trigger_cmd_low`=VALUES(`trigger_cmd_low`), `trigger_cmd_norm`=VALUES(`trigger_cmd_norm`), `snmp_event_category`=VALUES(`snmp_event_category`), `snmp_event_severity`=VALUES(`snmp_event_severity`), `snmp_event_warning_severity`=VALUES(`snmp_event_warning_severity`), `local_graph_id`=VALUES(`local_graph_id`), `graph_template_id`=VALUES(`graph_template_id`)'
2018/12/30 23:48:23 - CMDPHP SQL Backtrace: (/plugins/thold/thold.php[63]:save_thold(), /plugins/thold/thold_functions.php[4040]:sql_save(), /lib/database.php[1245]:_db_replace(), /lib/database.php[1175]:db_execute(), /lib/database.php[188]:db_execute_prepared())
2018/12/30 23:48:23 - CMDPHP ERROR: A DB Exec Failed!, Error: Column 'data_source_name' cannot be null
2018/12/30 23:48:23 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/thold/thold.php[63]:save_thold(), /plugins/thold/thold_functions.php[3902]:CactiErrorHandler())
2018/12/30 23:48:23 - ERROR PHP NOTICE in Plugin 'thold': Undefined variable: data_source_info in file: /var/www/html/cacti/plugins/thold/thold_functions.php on line: 3902
2018/12/30 23:48:23 - CMDPHP PHP ERROR NOTICE Backtrace: (/plugins/thold/thold.php[63]:save_thold(), /plugins/thold/thold_functions.php[3901]:CactiErrorHandler())
2018/12/30 23:48:23 - ERROR PHP NOTICE in Plugin 'thold': Undefined variable: data_source_info in file: /var/www/html/cacti/plugins/thold/thold_functions.php on line: 3901
The path is
/cacti/plugins/thold/thold.php?action=edit&id=1

This is the configuration I am putting in place (high/low alerts and bash commands):
Skärmbild från 2018-12-30 23-53-15.png
Skärmbild från 2018-12-30 23-53-15.png (67.46 KiB) Viewed 316 times
I don't know if I'm supposed to report issues on Thold development versions or not, so please just tell me if I should or not ;)

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

Re: Thold plugin will not save configuration/settings.

#2 Post by netniV » Mon Dec 31, 2018 2:38 pm

I would get the previous release of thold as the dev version is work in progress and is undergoing a major update at the moment so probably isn't working 100%

naven
Posts: 11
Joined: Tue Mar 31, 2015 4:54 pm

Re: Thold plugin will not save configuration/settings.

#3 Post by naven » Mon Dec 31, 2018 5:44 pm

Oh, I was hoping to test; https://github.com/Cacti/plugin_thold/issues/82
Seems that its not ready to test yet.

Thanks.

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Thold plugin will not save configuration/settings.

#4 Post by TheWitness » Tue Jan 01, 2019 9:56 am

Let me try and trace the issue. I'm doing the update. Was this a stand alone threshold or template based?
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

User avatar
TheWitness
Developer
Posts: 14804
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: Thold plugin will not save configuration/settings.

#5 Post by TheWitness » Wed Jan 02, 2019 6:45 pm

Okay, I've solved the issue in question. Keep testing. Some things are not entirely done. For example creating a Graph from a Threshold Template.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of MacTrack, Boost, CLog, SpikeKill, Platform RTM, DSStats, maintainer of Spine, lot's of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Central Plugin Repository
Central Templates Repository


I'm still out there people. Getting excited for Cacti 1.2. I think it will be a great release.

naven
Posts: 11
Joined: Tue Mar 31, 2015 4:54 pm

Re: Thold plugin will not save configuration/settings.

#6 Post by naven » Sat Mar 16, 2019 4:03 am

Hi, it seems that I forgot to reply, thanks for fixing this.

Post Reply