Custom Logs: Difference between revisions

m
 
(14 intermediate revisions by the same user not shown)
Line 4: Line 4:
   |}
   |}
In CMX version 3.22.0 - b3211 the Custom Logs were introduced, providing the possibility for the user to create their own logfiles for any value - also strings - which CMX produces in a [[Webtags|webtag]]. This called for a procedure in CumulusUtils to handle those logs. In version 6.21.0 this was realised. This [[Custom Logs]] procedure is based on the External Sensors.
In CMX version 3.22.0 - b3211 the Custom Logs were introduced, providing the possibility for the user to create their own logfiles for any value - also strings - which CMX produces in a [[Webtags|webtag]]. This called for a procedure in CumulusUtils to handle those logs. In version 6.21.0 this was realised. This [[Custom Logs]] procedure is based on the External Sensors.
=== Goal ===
The CustomLogs module's goal is to chart webtags and display its current realtime value in a table left of the chart.


=== '''IMPORTANT''' ===
=== '''IMPORTANT''' ===
'''NOTE: The formatting of the datafiles is important as the Custom Logs are basically free format: you can put into the file any text and numbers with any separator you wish. CUtils will NOT handle that Free Format in general. The user has to take care the information in the resulting datafiles is as follows:'''
'''1) NOTE: Be aware that for every webtag an entry in the JSON datafile will be created for the period of number of hours you have defined for the charts. This may lead to large datafiles being transferred every interval, data duplication (data already present in the standard datafiles of CMX or CUtils) and high memory use and performance of your server while displaying the charts may be the result. So the user is warned to think about what he really wants to log and view.
'''1) There MUST be at least one space of your local separator between the webtags; '''
'''
'''2) There cannot be any plain text in the logfile'''
'''The date/time will be untouched i.e. the format is the local date format e.g. dd-mm-yy;hh:mm;'''


If there is free  text in the definition of the log, the CustomLogs module should ignore that and parse only the webtags which result in a number.
'''2) NOTE: Webtag values are the actual momentane values when asked at CMX. Be aware that a webtag value is NEVER an average of the period before it. That is also not the case for the DAILY values where it would maybe be kind of natural to expect such value. A better name for Daily in this case would be the ''Midnight value''.'''
Strange effects may occur if this is not obeyed.


'''NOTE: Be aware that for every webtag an entry in the datafile will be created for the period of number of hours you have defined for the charts. This may lead to large datafiles being transferred every interval, data duplication (data already present in the standard datafiles of CMX or CUtils) and high memory use and performance of your server while displaying the charts may be the result. So the user is warned to think about what he really wants to log and view.
'''3) NOTE: When you define or modify a CustomLog in CMX, you have to run CUtils with CustomLogs (or Website) as argument because there is no connection between CMX and CUtils: running CUtils will fetch the info from CMX and update the website accordingly. It will reset the JSON and a full dataset will be transferred to the webserver. However: if a new CustomLog did not yet contain any data, you will have to run CUtils again when it has. If you do not, the JSON will not adhere to the new definition and the PHP upload will not be able to do incremental uploads which will produce errors in the logfile. This should not be an issue for FTP uploads which are not incremental.<br/>'''
'''
'''Also note that ''the frequency'' for the CustomLogs has no connection with the ''Internet Interval'' with which the data on the webserver (the JSONs) are updated, this may give unexpected effects for you.'''


'''If you use PHP upload: If you change your CustomLogs definition such that you get a 500 error in while uploading the datafile, please delete the datafile on the server and let the system try again.'''
'''4) NOTE: The definition of a CustomLog can only contain one separator between the webtags. That separator is either the separator defined by the locale or a space. Two or more separators will lead to errors.'''


=== Dependency ===
=== Dependency ===
Line 24: Line 24:
If the user has already run [[Extra Sensors]] module, the file CutilsCharts.def will contain the line
If the user has already run [[Extra Sensors]] module, the file CutilsCharts.def will contain the line
   ; ExtraSensorCharts
   ; ExtraSensorCharts
And everything below these lines will be replaced by generated ExtraSensors charts.
And everything below these lines will be replaced by generated ExtraSensors charts (up to but not including the following CustomLogs demarcation line).


The user may not remove the above line but by setting the parameter
A similar section will be created for the Custom Logs charts with the CustomLogs demarcation line:
UserModificationExtraSensorCharts=true
the charts will no longer be overwritten and the user may modify the generated charts to his own tasting.
 
A similar section will be created for the Custom Logs charts with the line  
   ; CustomLogsCharts
   ; CustomLogsCharts
And the parameter  
and the parameter  
   UserModificationCustomLogsCharts=true  
   UserModificationCustomLogsCharts=true  
will provide the possibility to modify the charts.  
will provide the possibility to modify the charts (default is false).  


Again: be aware that making the modification of the charts manual will no longer overwrite. If you lose track and want to start over again with automatic chart generation set this parameter to false.
Again: be aware that making the modification of the charts manual will no longer overwrite. If you lose track and want to start over again with automatic chart generation set this parameter to false.
Line 75: Line 71:
#customlogsdata.json        => contains all data for the extra sensors specified (by the command ''utils/cumulusutils.exe [[UserAskedData]]'').
#customlogsdata.json        => contains all data for the extra sensors specified (by the command ''utils/cumulusutils.exe [[UserAskedData]]'').


The user can optionally create the charts himself by setting the parameter ''UserModificationCustomLogsCharts'' to true and subsequently ecit CutilsCharts.def. <br>
The user can optionally create or modify the charts himself by setting the parameter ''UserModificationCustomLogsCharts'' to true and subsequently edit ''CutilsCharts.def''. <br>
The outputfile for the charts MUST always be ''extrasensorscharts.txt''.
The outputfile for the charts MUST always be ''customlogscharts.txt'' so the first chart in the CustomLogs section ends with: <code>EndChart Output customlogscharts.txt</code> but the user may change this with manual modification.


== Inifile Parameters ==
== Inifile Parameters ==
Line 82: Line 78:


   [ExtraSensors]
   [ExtraSensors]
   CustomLogs=false                        => If false the module is skipped, no menu entry will be made
   CustomLogs=false                        => If false (default) the module is skipped, no menu entry will be made
   UserModificationCustomLogsCharts=false  => If true the ''CustomLogs'' charts will not be overwritten in ''CutilsCharts.def'' and give the user the possibility to create his own charts
   UserModificationCustomLogsCharts=false  => If true the ''CustomLogs'' charts will not be overwritten in ''CutilsCharts.def'' and give the user the possibility to create his own charts
 
  DoneToday=2023-10-16T12:41:00          => Exists and has a value when the JSON datafile(s) have been uploaded at least once. In case of PHP upload, removing this parameter makes sure next
                                            upload will non-incremental.
  ExcludedCustomLogs=                    => Is empty or contains a comma separated list of CustomLog names. Named logs are excluded from processing by CUtils.
                                            As CustomLogs is a CMX feature, it must be possible to have CustomLogs being used for purposes outside CUtils. If that is the case, exclude them here.


[[Category:CumulusUtils]]
[[Category:CumulusUtils]]