5,838
edits
m (→Solar: add explanation that "June" factor mislabelled "July" in 3.15.x) |
m (Minor resequencing of page) |
||
{{Template:WorkInProgressBanner}}
Since this page describes a file whose content frequently changes, this page may be out of date, unless somebody bothers to update it for every change.
=Purpose of Cumulus.ini file=
* Control what is output to those destinations, to the extent that each can be configured
= Why does this Wiki now contain multiple pages describing "Cumulus.ini"?=
[[Category:Configuration Files]]
All the pages, previously called "Cumulus.ini", can be found from the owning [[:Category:Configuration Files|category]]. The original page was preserved at [[Cumulus.ini_(preserving_history)]] so look there for its editing history. That page also expands on the above summary of why that old page was replaced by this new page.
==Need to install MX 3.12.0 ==
If you are using Cumulus 1 or a release of MX earlier than 3.12.0, be aware that the content of "Cumulus.ini" is totally different to the file for later MX releases. It might have been better had the file been given a new name in release 3.2.0.
The way the developer decided to implement it, is that when somebody installs release 3.12.0, any existing "Cumulus.ini" file is renamed, and a new "Cumulus.ini" file is created from scratch, and from then onwards all changes apply to the new file. As 3.12.0 is the only release that can create the replacement file, it is highly recommended that anybody currently using an older release, downloads 3.12.0 from [https://github.com/cumulusmx/CumulusMX/releases/download/b3141/CumulusMXDist3141.zip here] and runs that release for a while before upgrading to the latest release [https://github.com/cumulusmx/CumulusMX here].
== Simplifications ==
|}
==Debugging==
| The selections made on this Settings Page sub-section will place the appropriate content in the two parameters in the file
|}
==Optional Structured Query Language Settings==
SQL is structured in the sense that keywords have to appear in the correct order, and there are rules about which words are mandatory. SQL is not just for running queries that read database tables, it can create database tables, give and revoke permissions, and do many more maintenance type tasks. SQL is a language in that each variant of SQL has a vocabulary and set of rules that are specific to that database server, although there is a sub-set, that is set by "ANSI", of words and constructions that all SQL dialects should obey.
MX uses two types of SQL. One type is for SQLite database (see [[Cumulusmx.db]] and [[Diary.db]], that type stores data in rows that are numbered, and columns that are named. In a retrieval query you can sort ascending/descending on value in any column. You can select a row by specifyimg content, but that gets translated into a row number to actually determine what is updated.
The file section '''[MySQL]''' is about a different type of database (i.e. Maria database, or Oracle MySQL) these implement a relational database that has to satisfy the rule that all data appears in a table with rows and columns. The columns have a particular order, but there is no control over the order of rows, so you can't specify a row number, you either specify a primary key that identifies a particular row, or you specify that what is returned from query should be sorted in an ascending/descending order of the value in a specified column.
Both "CumulusMX.exe" and "ExportToMySQL.exe" make use of the following settings:
{| class="wikitable" border="1"
|-
!style="width:30px" | Executable
!style="width:100px" | Function
!style="width:300px" | Description
|-
| CumulusMX.exe
| Data Logs menu
| An option "Update MySQL on Edit" allows you to decide whether MX issues SQL when you edit a data log or "dayfile.txt", so the same edit is made to the corresponding database table, provided that the table has been created with the default name and has the column names defined by default.
|-
! rowspan="7" |CumulusMX.exe
| Settings menu → MySQL settings → General Options
| An option "Buffer commands on failure" allows you to decide whether MX tries to run SQL commands again, if they fail. IMPORTANT: This is to cope with failure due to the database server going down; the option should not be ticked if you are testing new "custom" SQL and may have made a mistake in the coding. You need to ensure the SQL is either generated by MX as a fixed query, or has been tested and is correct synta before considering this option.
|-
| Settings menu → MySQL settings → Realtime.txt Upload
| An option that can be enabled that automatically updates a "Realtime" table, each new row is effectively what is stored in the file [[realtime.txt]].
|-
| Settings menu → MySQL settings → Dayfile.txt Upload
| An option that can be enabled that at end of day ensures that a new line is added to [[dayfile.txt]] and a new row (with similar data) is inserted into a "Dayfile" table.
|-
| Settings menu → MySQL settings → Monthly log file Upload
| An option that can be enabled that automatically updates a "Monthly" table, every time a new line is added to the [[Standard_log_files|standard data log file]].
|-
| Settings menu → MySQL settings → Custom Upload - seconds interval
| An option that can be enabled that runs some predetermined SQL every time the specified number of seconds has elapsed.
|-
| Settings menu → MySQL settings → Custom Upload - minutes interval
| An option that can be enabled that runs some predetermined SQL every time the specified number of minutes has elapsed.
|-
| Settings menu → MySQL settings → Custom Upload - at rollover
| An option that can be enabled that runs some predetermined SQL just after dayfile.txt has had a new line, but before other end-of-day actions occur.
|-
| ExportToMySQL.exe
| parameters to utility
| Determine which file read (and therefore which table updated, using table names set in table name parameters explained in next table)
|}
Here is an example of what might be input as "predetermined SQL", showing how you can use conditionals and web tags:
<pre>
INSERT IGNORE INTO table_name_1 (primary_key, column_name_1, column_name_2 ....) VALUES ('<#primary_key>', '<#web tag_name_1 modifier_1>', '<#web tag_name_2 modifier_2>' ....);
DELIMITER $$
BEGIN NOT ATOMIC
IF '<#web tag>' = '---' THEN
simpler query to run if something not numeric;
ELSE
UPDATE table_name_2 SET column_name_1 = '<#web tag_name_1 modifier_1>', column_name_2 = '<#web tag_name_2 modifier_2>' .... WHERE primary_key = '<#primary_key>';
END IF;
END $$
</pre>
* Introduced in Cumulus MX 3.0.0 beta
* File Section is [MySQL]
* MX page is Settings menu → MySQL settings
{| class="wikitable" border="1"
|-
!style="width:30px" | Parameter Line Entry
!style="width:100px" | MX Section
!style="width:60px" | Label on Settings page
!style="width:20px" | Default
!style="width:600px" | Description
|-
| BufferOnFailure=0
| General Options
| Buffer commands on failure
| 0 = ignore errors
| Simple tick or not
*Tick (value shown as 1 in Cumulus.ini) if you want MX to store any commands that fail (see note above), and try them again (stored commands lost if MX is stopped)
* Don't tick (value shown as 0 in Cumulus.ini) if you want MX to ignore any errors
|-
| CustomMySqlMinutesCommandString=
| Custom Upload - minutes interval
| "SQL command" only shown if next parameter is ticked
| (empty)
| See "predetermined SQL" example above
|-
| CustomMySqlMinutesEnabled=0
| Custom Upload - minutes interval
| Custom Minutes Enabled
| 0 = don't display other options
| Simple tick or not
*Tick (value shown as 1 in Cumulus.ini) if you want the previous and next options to be displayed, and actioned
* Don't tick (value shown as 0 in Cumulus.ini) if MX is not to action the previous and next settings
|-
| CustomMySqlMinutesIntervalIndex=6
| Custom Upload - minutes interval
| Interval:
| 6 = 10 minutes
| Drop-down list of predetermined intervals:
* 0 = 1 minute
* 1 = 2 minutes
* 2 = 3 minutes
* 3 = 4 minutes
* 4 = 5 minutes
* 5 = 6 minutes
* 6 = 10 minutes
* 7 = 12 minutes
* 8 = 20 minutes
* 9 = 30 minutes
* 10 = 1 hour (60 minutes)
|-
| CustomMySqlRolloverCommandString=
| Custom Upload - at rollover
| "SQL command" only shown if next parameter is ticked
| (empty)
| See "predetermined SQL" example above
|-
| CustomMySqlRolloverEnabled=0
| Custom Upload - at rollover
| Custom Rollover Enabled
| 0 = don't display other options
| Simple tick or not
*Tick (value shown as 1 in Cumulus.ini) if you want the previous and next options to be displayed, and actioned
* Don't tick (value shown as 0 in Cumulus.ini) if MX is not to action the previous and next settings
|-
| CustomMySqlSecondsCommandString=
| Custom Upload - seconds interval
| "SQL command" only shown if next parameter is ticked
| (empty)
| See "predetermined SQL" example above
|-
| CustomMySqlSecondsEnabled=0
| Custom Upload - seconds interval
| Custom Seconds Enabled
| 0 = don't display other options
| Simple tick or not
*Tick (value shown as 1 in Cumulus.ini) if you want the previous and next options to be displayed, and actioned
* Don't tick (value shown as 0 in Cumulus.ini) if MX is not to action the previous and next settings
|-
| CustomMySqlSecondsInterval=10
| Custom Upload - seconds interval
| Interval (seconds):
| 10
| A number field, takes 1 to 59
|-
| Database=
| Server details
| Database name:
| (empty)
| A text field where you enter the name of the database your tables are to be created/updated in
|-
| DayfileMySqlEnabled=0
| Dayfile.txt upload
| Dayfile Enabled
| 0
| Simple tick or not
*Tick (value shown as 1 in Cumulus.ini) if you want MX to at end of day ensure that a new line is added to [[dayfile.txt]] and a new row (with similar data) is inserted into a "Dayfile" table
* Don't tick (value shown as 0 in Cumulus.ini) if MX is only to ensure that a new line is added to dayfile.txt
|-
| DayfileTable=
| Dayfile.txt upload
| Table name
| Dayfile
| Having defined this table, and saved the settings, click the "Create Dayfile" button to create the database table with the standard column names. If you change the name here, normal updates and "ExportToMySQl.exe" will use the table name you define, but the option to update table when you edit "dayfile.txt" will fail (and if set to do so, keep failing as it repeats).
|-
| Host=Localhost
| Server details
| Host name
| (empty)
| Set to whatever host name your database server has specified, if you host [[Your_Own_Server]], then you may be able to use "Localhost".
|-
| MonthlyMySqlEnabled=0
| Monthly logfile upload
| Monthly Log Enabled
| 0
| Simple tick or not
*Tick (value shown as 1 in Cumulus.ini) if you want MX to at your standard logging interval ensure that a new line is added to [[Standard_log_files|standard data log file]] and a new row (with similar data) is inserted into a "Monthly" table.
* Don't tick (value shown as 0 in Cumulus.ini) if MX is only to ensure that a new line is added to standard data log file
|-
| MonthlyTable=
| Monthly logfile upload
| Table name
| Monthly
| Having defined this table, and saved the settings, click the "Create Monthly" button to create the database table with the standard column names. You might wish to change the name here once a year, to stop the database table getting enormous, if so you might name the table something like "standard2020". If you change the name here, normal updates and "ExportToMySQl.exe" will use the table name you define, but the option to update table when you edit "MMMyyyyLog.txt" will fail (and if set to do so, keep failing as it repeats).
|-
| Pass=
| Server details
| Password
| (empty)
| Set to whatever password is used for update access with the database user name (see below)
|-
| Port=3306
| Server details
| Port number
| 3306
| The port related to the host name (defined above) for update access to your database server
|-
| RealtimeMySql1MinLimit=0
| Realtime.txt upload
| Limit Inserts:
| 0 = false
| Simple tick or not
*Tick (value shown as 1 in Cumulus.ini)
* Don't tick (value shown as 0 in Cumulus.ini)
See explanation beside and below setting
|-
| RealtimeMySqlEnabled=0
| Realtime.txt upload
| Real time Enabled
| 0 = don't display other options
| Simple tick or not
*Tick (value shown as 1 in Cumulus.ini) if you want MX to at your real time interval ensure that a new realtime.txt file is created and a new row (with similar data) is inserted into a "Realtime" table.
* Don't tick (value shown as 0 in Cumulus.ini) if MX is only to ensure that a new line is added to standard data log file
|-
| RealtimeRetention=
| Realtime.txt upload
| '''Data Retention value''' and '''Data Retention unit'''
| "7" and "Days"
| The value field will take any number, the unit field is a dropdown:
* Seconds
* Minutes
* Hours
* Days
* Weeks
* Months
Taken together, these determine the period for which rows are kept in the table named in "RealtimeTable", any row older than this specification will be deleted as part of the automatic SQL
|-
| RealtimeTable=Realtime
| Realtime.txt upload
| Table name
| Realtime
| Having defined this table, and saved the settings, click the "Create Realtime" button to create the database table with the standard column names. Remember that you can tailor the contents of "realtime.txt", if you want non-standard columns in this table, you have to create the table yourself.
|-
| UpdateOnEdit=1
| General Options
| Update MySQL on Edit
| 1 = update the table when edit the file
| Simple tick or not
*Tick (value shown as 1 in Cumulus.ini)
* Don't tick (value shown as 0 in Cumulus.ini)
Please see begining of previous table for explanation and warning about how all defaults must be set for this to work
|-
| User=
| Server details
| User name
| (empty)
| Database access user name, that matches with password described earlier
|}
==Optional Report Settings==
|
edits