Code: Select all
INSERT INTO thold_template (data_template_id,data_template_name,data_source_id,data_source_name,data_source_friendly,thold_enabled,bl_enabled,repeat_alert,notify_default) VALUES ("51","Generic - Uptime","309","uptime","uptime","on","off","12","NULL")
The problem is that NULL value is actually a text string and 'notify_default' is a boolean field.
The query should be
Code: Select all
INSERT INTO thold_template (data_template_id,data_template_name,data_source_id,data_source_name,data_source_friendly,thold_enabled,bl_enabled,repeat_alert,notify_default) VALUES ("51","Generic - Uptime","309","uptime","uptime","on","off","12",NULL)
Code: Select all
$save["notify_default"] = "NULL";
$id = sql_save($save, "thold_template");
Code: Select all
$save["notify_default"] = NULL;
Code: Select all
while (list ($key, $value) = each ($array_items)) {
$array_items[$key] = "\"" . sql_sanitize($value) . "\"";
}
There are several other places in the Threshold plugin that try to use sql_save to set a NULL value and would need to be addressed as well.
I am surpirsed that I have seen no one else mentioning this problem. Perhaps it is just me and some setting I have wrong?
Thanks,
Etienne
Cacti Version - 0.8.6j
Plugin Architecture - 1.1
Poller Type - Cactid v0.8.6i
Server Info - Windows NT 5.1 (aka Windows XP SP2)
Web Server - Microsoft-IIS/5.1
PHP - 5.2.0
PHP Extensions - bcmath, calendar, com_dotnet, ctype, session, filter, ftp, hash, iconv, json, odbc, pcre, Reflection, date, libxml, standard, tokenizer, zlib, SimpleXML, dom, SPL, wddx, xml, xmlreader, xmlwriter, ISAPI, gd, mysql, snmp, sockets
MySQL - 5.0.27-community-nt-log
RRDTool - 1.2.15
SNMP - 5.2.2
Plugins
- Thresholds (thold - v0.3.2)
Host Info (hostinfo - v0.1)