Skip to content

Module thc_Csv

Andreas Drollinger edited this page Nov 8, 2019 · 2 revisions

Status logging in CSV format

Introduction

This module provides functions to log device states in the CSV format in a file.

CSV log module commands


Proc: thc::Csv::Open

Creates or opens an CSV data file. If the file exists already the new logging data will be will be appended to the file. This works also if devices are added or removed. If the devices to are not explicitly specified with the '-devices' option, the states of all devices are logged.

Parameters

Parameters Description
-file <CsvFile> The name of the CSV data file to open or to create
[-min_interval <MinInterval>] Minimal interval in seconds in which the data are logged into the CSV data file. The thc::Csv::Log command will be ignored if it is called in a shorter interval than the specified minimum interval.
[-devices <DeviceList>] List of devices to log. By default all devices are logged.

Returns

-

Examples

The following example opens or creates an CSV data file that logs the states of all devices in a minimum interval of 5 minutes :

 thc::Csv::Open -file /var/thc/thc.csv -min_interval 300

See also

thc::Csv::Log


Proc: thc::Csv::Log

Logs the devices states. The states of all declared devices is written to the opened CSV data file.

For devices that have a sticky state, this sticky state is written instead of the instantaneous state. The sticky states has usually to be cleared with thc::ResetStickyStates after having logged them by thc::Csv::Log.

Returns

-

Examples

 thc::Csv::Log; ResetStickyStates

See also

thc::Csv::Open, thc::ResetStickyStates