filewatchpublisher.agent module¶
-
class
filewatchpublisher.agent.
FileWatchPublisher
(config, **kwargs)[source]¶ Bases:
volttron.platform.vip.agent.Agent
Monitors files from configuration for changes and publishes added lines on corresponding topics. Ignores if a file does not exist and move to next file in configuration with an error message. Exists if all files does not exist. :param config: Configuration dict :type config: dict
Example configuration:
{ "publish_file": [ { "file": "/var/log/syslog", "topic": "platform/syslog", }, { "file": "/home/volttron/tempfile.txt", "topic": "temp/filepublisher", } ] }
-
filewatchpublisher.agent.
file_watch_publisher
(config_path, **kwargs)[source]¶ Load the FileWatchPublisher agent configuration and returns and instance of the agent created using that configuration. :param config_path: Path to a configuration file. :type config_path: str :returns: FileWatchPublisher agent instance :rtype: FileWatchPublisher agent