* Added the variables table to the core SQL schema.
* Added Databsae->insert_or_update_variables() and ->read_variable().
Signed-off-by: Digimer <digimer@alteeve.ca>
-- This holds user-configurable variable. These values override defaults but NOT configuration files.
CREATETABLEvariables(
variable_uuiduuidnotnullprimarykey,--
variable_nametextnotnull,-- This is the 'x::y::z' style variable name.
variable_valuetext,-- It is up to the software to sanity check variable values before they are stored
variable_defaulttext,-- This acts as a reference for the user should they want to roll-back changes.
variable_descriptiontext,-- This is a string key that describes this variable's use.
variable_sectiontext,-- This is a free-form field that is used when displaying the various entries to a user. This allows for the various variables to be grouped into sections.
variable_source_uuidtext,-- Optional; Marks the variable as belonging to a specific X_uuid, where 'X' is a table name set in 'variable_source_table'
variable_source_tabletext,-- Optional; Marks the database table corresponding to the 'variable_source_uuid' value.
<keyname="log_0018">About to open the directory: [#!variable!directory!#]</key>
<keyname="log_0018">About to open the directory: [#!variable!directory!#]</key>
<keyname="log_0019">Variables:</key>
<keyname="log_0019">Variables:</key>
<keyname="log_0020"><![CDATA[[ Error ] - The method Storage->read_file() was called without a 'file' parameter, or the parameter was empty.]]></key>
<keyname="log_0020"><![CDATA[[ Error ] - The method: [#!variable!method!#] was called but the: [#!variable!parameter!#] parameter was not passed or it is empty.]]></key>
<keyname="log_0021"><![CDATA[[ Error ] - The method Storage->read_file() was asked to read the file: [#!variable!file!#], but that file does not exist.]]></key>
<keyname="log_0021"><![CDATA[[ Error ] - The method Storage->read_file() was asked to read the file: [#!variable!file!#], but that file does not exist.]]></key>
<keyname="log_0022"><![CDATA[[ Error ] - The method Storage->read_file() was asked to read the file: [#!variable!file!#] which exists but can't be read.]]></key>
<keyname="log_0022"><![CDATA[[ Error ] - The method Storage->read_file() was asked to read the file: [#!variable!file!#] which exists but can't be read.]]></key>
@ -77,21 +77,21 @@ It also has replacement variables: [#!variable!first!#] and [#!variable!second!#
<keyname="log_0033"><![CDATA[[ Warning ] - Words->read()' asked to read: [#!variable!file!#] which was not found.]]></key>
<keyname="log_0033"><![CDATA[[ Warning ] - Words->read()' asked to read: [#!variable!file!#] which was not found.]]></key>
<keyname="log_0034"><![CDATA[[ Warning ] - AN::Tools::Words->read()' asked to read: [#!variable!file!#] which was not readable by: [#!variable!user!#] (uid/euid: [#!variable!uid!#]).]]></key>
<keyname="log_0034"><![CDATA[[ Warning ] - AN::Tools::Words->read()' asked to read: [#!variable!file!#] which was not readable by: [#!variable!user!#] (uid/euid: [#!variable!uid!#]).]]></key>
<keyname="log_0035"><![CDATA[[ Warning ] - The config file: [#!variable!file!#] appears to have a malformed line: [#!variable!count!#:#!variable!line!#].]]></key>
<keyname="log_0035"><![CDATA[[ Warning ] - The config file: [#!variable!file!#] appears to have a malformed line: [#!variable!count!#:#!variable!line!#].]]></key>
<keyname="log_0036"><![CDATA[[ Error ] - The method Storage->change_mode() was called without a 'target' parameter, or the parameter was empty.]]></key>
<keyname="log_0036"><![CDATA[[ Error ] - The method Database->read_variable() was called but both the 'variable_name' and 'variable_uuid' parameters were not passed or both were empty.]]></key>
<keyname="log_0037"><![CDATA[[ Error ] - The method Storage->change_mode() was called without a 'mode' parameter, or the parameter was empty.]]></key>
<keyname="log_0037"><![CDATA[[ Error ] - The method Database->insert_or_update_variables() method was called but both the 'variable_name' and 'variable_uuid' parameters were not passed or both were empty.]]></key>
<keyname="log_0038"><![CDATA[[ Error ] - The method Storage->change_mode() was called without an invalid 'mode' parameter. It should have been three or four digits, but: [#!variable!mode!#] was passed.]]></key>
<keyname="log_0038"><![CDATA[[ Error ] - The method Storage->change_mode() was called without an invalid 'mode' parameter. It should have been three or four digits, but: [#!variable!mode!#] was passed.]]></key>
<keyname="log_0039"><![CDATA[[ Error ] - The method Storage->change_owner() was called without a 'target' parameter, or the parameter was empty.]]></key>
<keyname="log_0039">The host: [#!variable!host!#] has released its database lock.</key>
<keyname="log_0040"><![CDATA[[ Error ] - The method Storage->write_file() was asked to write the file: [#!variable!file!#] but it already exists and 'overwrite' was not set. Aborting.]]></key>
<keyname="log_0040"><![CDATA[[ Error ] - The method Storage->write_file() was asked to write the file: [#!variable!file!#] but it already exists and 'overwrite' was not set. Aborting.]]></key>
<keyname="log_0041"><![CDATA[[ Error ] - The method Storage->write_file() was asked to write the file: [#!variable!file!#] but it is not a full path. Aborting.]]></key>
<keyname="log_0041"><![CDATA[[ Error ] - The method Storage->write_file() was asked to write the file: [#!variable!file!#] but it is not a full path. Aborting.]]></key>
<keyname="log_0042"><![CDATA[[ Error ] - The method Words->string() was asked to process the string: [#!variable!string!#] which has insertion variables, but nothing was passed to the 'variables' parameter.]]></key>
<keyname="log_0042"><![CDATA[[ Error ] - The method Words->string() was asked to process the string: [#!variable!string!#] which has insertion variables, but nothing was passed to the 'variables' parameter.]]></key>
<keyname="log_0043"><![CDATA[[ Error ] - The method System->call() was called but 'shell_call' was not passed or was empty.]]></key>
<keyname="log_0043"><![CDATA[[ Error ] - The method System->call() was called but 'shell_call' was not passed or was empty.]]></key>
<keyname="log_0044"><![CDATA[[ Error ] - The method Storage->copy_file() was called but 'source' was not passed or was empty.]]></key>
<keyname="log_0044">The host: [#!variable!host!#] has renewed its database lock.</key>
<keyname="log_0045"><![CDATA[[ Error ] - The method Storage->copy_file() was called but 'target' was not passed or was empty.]]></key>
<keyname="log_0045">The host: [#!variable!host!#] is requesting a database lock.</key>
<keyname="log_0046"><![CDATA[[ Error ] - The method Storage->copy_file() was asked to copy: [#!variable!source!#] to: [#!variable!target!#], but the target already exists and 'overwrite' wasn't specified, so aborting.]]></key>
<keyname="log_0046"><![CDATA[[ Error ] - The method Storage->copy_file() was asked to copy: [#!variable!source!#] to: [#!variable!target!#], but the target already exists and 'overwrite' wasn't specified, so aborting.]]></key>
<keyname="log_0047"><![CDATA[[ Error ] - The method Log->level() was passed an invalid log level: [#!variable!set!#]. Only '0', '1', '2', '3' or '4' are valid.]]></key>
<keyname="log_0047"><![CDATA[[ Error ] - The method Log->level() was passed an invalid log level: [#!variable!set!#]. Only '0', '1', '2', '3' or '4' are valid.]]></key>
<keyname="log_0048"><![CDATA[[ Warning ] - Testing of AN::Tools is beginning. This will generate warnings and alerts and are not a concern.]]></key>
<keyname="log_0048"><![CDATA[[ Warning ] - Testing of AN::Tools is beginning. This will generate warnings and alerts and are not a concern.]]></key>
<keyname="log_0049"><![CDATA[[ Warning ] - Testing of AN::Tools is complete.]]></key>
<keyname="log_0049"><![CDATA[[ Warning ] - Testing of AN::Tools is complete.]]></key>
<keyname="log_0050"><![CDATA[[ Error ] - The method Storage->read_mode() was called without a 'target' parameter, or the parameter was empty.]]></key>
<keyname="log_0050">#!free!#</key>
<keyname="log_0051"><![CDATA[[ Error ] - The method Storage->change_owner() was asked to change the ownership of: [#!variable!target!#] which doesn't exist.]]></key>
<keyname="log_0051"><![CDATA[[ Error ] - The method Storage->change_owner() was asked to change the ownership of: [#!variable!target!#] which doesn't exist.]]></key>
<keyname="log_0052"><![CDATA[[ Error ] - The method Storage->copy_file() was called but the source file: [#!variable!source!#] doesn't exist.]]></key>
<keyname="log_0052"><![CDATA[[ Error ] - The method Storage->copy_file() was called but the source file: [#!variable!source!#] doesn't exist.]]></key>
<keyname="log_0053"><![CDATA[[ Error ] - The 'Database->connect()' method tried to connect to the same database twice: [#!variable!target!#].]]></key>
<keyname="log_0053"><![CDATA[[ Error ] - The 'Database->connect()' method tried to connect to the same database twice: [#!variable!target!#].]]></key>
@ -105,12 +105,12 @@ Connecting to Database with configuration ID: [#!variable!id!#]
- user: ............ [#!variable!user!#]
- user: ............ [#!variable!user!#]
- password: ........ [#!variable!password!#]
- password: ........ [#!variable!password!#]
</key>
</key>
<keyname="log_0055"><![CDATA[[ Error ] - The method System->remote_call() was called but 'shell_call' was not passed or was empty.]]></key>
<keyname="log_0055">#!free!#</key>
<keyname="log_0056"><![CDATA[[ Error ] - The method System->remote_call() was called but 'target' was not passed or was empty.]]></key>
<keyname="log_0056">#!free!#</key>
<keyname="log_0057"><![CDATA[[ Error ] - The method System->remote_call() was called but 'user' was not passed or was empty.]]></key>
<keyname="log_0057">#!free!#</key>
<keyname="log_0058"><![CDATA[[ Error ] - The method System->remote_call() was called but the port: [#!variable!port!#] is invalid. It must be a digit between '1' and '65535'.]]></key>
<keyname="log_0058"><![CDATA[[ Error ] - The method System->remote_call() was called but the port: [#!variable!port!#] is invalid. It must be a digit between '1' and '65535'.]]></key>
<keyname="log_0059"><![CDATA[[ Error ] - The method Convert->hostname_to_ip() was called but 'hostname' was not passed or was empty.]]></key>
<keyname="log_0059">#!free!#</key>
<keyname="log_0060"><![CDATA[[ Error ] - The method Get->users_home() was called but 'user' was not passed or was empty.]]></key>
<keyname="log_0060">#!free!#</key>
<keyname="log_0061"><![CDATA[[ Error ] - The method Get->users_home() was asked to find the home directory for the user: [#!variable!user!#], but was unable to do so.]]></key>
<keyname="log_0061"><![CDATA[[ Error ] - The method Get->users_home() was asked to find the home directory for the user: [#!variable!user!#], but was unable to do so.]]></key>
<keyname="log_0062">SSH session opened without a password to: [#!variable!target!#].</key>
<keyname="log_0062">SSH session opened without a password to: [#!variable!target!#].</key>
<keyname="log_0063">The database with the ID: [#!variable!id!#] did not respond to pings and 'database::#!variable!id!#::ping_before_connect' is not set to '0' in '#!data!path::configs::striker.conf!#', skipping it.</key>
<keyname="log_0063">The database with the ID: [#!variable!id!#] did not respond to pings and 'database::#!variable!id!#::ping_before_connect' is not set to '0' in '#!data!path::configs::striker.conf!#', skipping it.</key>
@ -155,9 +155,9 @@ The database connection error was:
<keyname="log_0091">Failed to connect to any database.</key>
<keyname="log_0091">Failed to connect to any database.</key>
<keyname="log_0092"><![CDATA[[ Error ] - Unable to connect to the database: [#!variable!server!#] (id: [#!variable!id!#]_.]]></key>
<keyname="log_0092"><![CDATA[[ Error ] - Unable to connect to the database: [#!variable!server!#] (id: [#!variable!id!#]_.]]></key>
<keyname="log_0093"><![CDATA[[ Error ] - The method Alert->check_alert_sent() was called but the 'modified_date' parameter was not passed and/or 'sys::db_timestamp' is not set. Did the program fail to connect to any databases?]]></key>
<keyname="log_0093"><![CDATA[[ Error ] - The method Alert->check_alert_sent() was called but the 'modified_date' parameter was not passed and/or 'sys::db_timestamp' is not set. Did the program fail to connect to any databases?]]></key>
<keyname="log_0094"><![CDATA[[ Error ] - The method Alert->check_alert_sent() was called but the 'name' parameter was not passed or it is empty.]]></key>
<keyname="log_0094">#!free!#</key>
<keyname="log_0095"><![CDATA[[ Error ] - The method Alert->check_alert_sent() was called but the 'record_locator' parameter was not passed or it is empty.]]></key>
<keyname="log_0095">#!free!#</key>
<keyname="log_0096"><![CDATA[[ Error ] - The method Alert->check_alert_sent() was called but the 'set_by' parameter was not passed or it is empty.]]></key>
<keyname="log_0096">#!free!#</key>
<keyname="log_0097"><![CDATA[[ Error ] - The method Alert->check_alert_sent() was called but the 'set' parameter was not passed or it is empty. It should be 'set' or 'clear'.]]></key>
<keyname="log_0097"><![CDATA[[ Error ] - The method Alert->check_alert_sent() was called but the 'set' parameter was not passed or it is empty. It should be 'set' or 'clear'.]]></key>
<keyname="log_0098">
<keyname="log_0098">
[ Warning ] - Failed to set an alert because this host is not yet in the database. This can happen if the alert was set before this host was added to the database.
[ Warning ] - Failed to set an alert because this host is not yet in the database. This can happen if the alert was set before this host was added to the database.
@ -168,16 +168,16 @@ The database connection error was:
- Name: [#!variable!alert_name!#]
- Name: [#!variable!alert_name!#]
- Timestamp: [#!variable!modified_date!#]
- Timestamp: [#!variable!modified_date!#]
</key>
</key>
<keyname="log_0099"><![CDATA[[ Error ] - The method Alert->register_alert() was called but the 'set_by' parameter was not passed or it is empty.]]></key>
<keyname="log_0099">#!free!#</key>
<keyname="log_0100"><![CDATA[[ Error ] - The method Alert->register_alert() was called but the 'message_key' parameter was not passed or it is empty.]]></key>
<keyname="log_0100">#!free!#</key>
<keyname="log_0101"><![CDATA[[ Error ] - The method Alert->register_alert() was called but the 'title_key' parameter was not passed or it is empty and 'header' is enable (default).]]></key>
<keyname="log_0101"><![CDATA[[ Error ] - The method Alert->register_alert() was called but the 'title_key' parameter was not passed or it is empty and 'header' is enable (default).]]></key>
<keyname="log_0102">I am not recording the alert with message_key: [#!variable!message_key!#] to the database because its log level was lower than any recipients.</key>
<keyname="log_0102">I am not recording the alert with message_key: [#!variable!message_key!#] to the database because its log level was lower than any recipients.</key>
<keyname="log_0103">The local machine's UUID was not read properly. It should be stored in: [#!data!sys::host_uuid!#] and contain hexadecimal characters in the format: '012345-6789-abcd-ef01-23456789abcd' and usually matches the output of 'dmidecode --string system-uuid'. If this file exists and if there is a string in the file, please verify that it is structured correctly.</key>
<keyname="log_0103">The local machine's UUID was not read properly. It should be stored in: [#!data!sys::host_uuid!#] and contain hexadecimal characters in the format: '012345-6789-abcd-ef01-23456789abcd' and usually matches the output of 'dmidecode --string system-uuid'. If this file exists and if there is a string in the file, please verify that it is structured correctly.</key>
<keyname="log_0104">The database with ID: [#!variable!id!#] for: [#!variable!file!#] is behind.</key>
<keyname="log_0104">The database with ID: [#!variable!id!#] for: [#!variable!file!#] is behind.</key>
<keyname="log_0105"><![CDATA[[ Error ] - The method Database->_find_behind_databases() was called but the 'source' parameter was not passed or it is empty.]]></key>
<keyname="log_0105">#!free!#</key>
<keyname="log_0106">The database with ID: [#!variable!id!#] for: [#!variable!file!#] and table: [#!variable!table!#] is behind.</key>
<keyname="log_0106">The database with ID: [#!variable!id!#] for: [#!variable!file!#] and table: [#!variable!table!#] is behind.</key>
<keyname="log_0107"><![CDATA[[ Error ] - The method Database->insert_or_update_states() was called but the 'state_name' parameter was not passed or it is empty.]]></key>
<keyname="log_0107">#!free!#</key>
<keyname="log_0108"><![CDATA[[ Error ] - The method Database->insert_or_update_states() was called but the 'state_host_uuid' parameter was not passed or it is empty. Normally this is .]]></key>
<keyname="log_0108"><![CDATA[[ Error ] - The method Database->insert_or_update_states() was called but the 'state_host_uuid' parameter was not passed or it is empty. Normally this is set to 'sys::data_uuid'.]]></key>
<!-- Test words. Do NOT change unless you update 't/Words.t' or tests will needlessly fail. -->
<!-- Test words. Do NOT change unless you update 't/Words.t' or tests will needlessly fail. -->