diff --git a/pyproject.toml b/pyproject.toml index 007f2aa..9908c0d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ profile = "black" include = ["src/sysmon", "sysmonagent.config"] name = "volttron-sysmon" -version = "0.1.0" +version = "1.0.0" description = "" authors = ["VOLTTRON Team "] license = "Apache License 2.0" @@ -32,7 +32,7 @@ classifiers = [ [tool.poetry.dependencies] python = ">=3.10,<4.0" -volttron = "^10.0.4rc1" +volttron-core = ">=2.0.0rc0" [tool.poetry.group.dev.dependencies] volttron-testing = "^0.4.0rc0" diff --git a/src/sysmon/agent.py b/src/sysmon/agent.py index 3b0d15d..edf6d36 100644 --- a/src/sysmon/agent.py +++ b/src/sysmon/agent.py @@ -30,10 +30,11 @@ import psutil from gevent import sleep from volttron import utils +from volttron.client.logs import setup_logging from volttron.client.vip.agent import RPC, Agent from volttron.utils.scheduling import periodic -utils.setup_logging() +setup_logging() _log = logging.getLogger(__name__) __version__ = '4.0' @@ -209,15 +210,16 @@ def on_configure(self, config_name, action, contents): sleep(1) # Wait for a second to pass to avoid divide by zero errors from tracking variables. for method in self.IMPLEMENTED_METHODS: item = monitors.pop(method, None) - if method == 'path_usage_rate' and item.get('path_name', None): - # Set initial value(s) of self.last_path_sizes for any configured path names. - self.path_usage_rate(item.get('path_name')) - if item and item.pop('poll', None) is True: - item_publish_type = item.get('publish_type', None) - item_publish_type = 'record' if method in self.RECORD_ONLY_PUBLISH_METHODS else item_publish_type - item_publish_type = item_publish_type if item_publish_type else self.default_publish_type - self._periodic_pub(getattr(self, method), item_publish_type, item['check_interval'], item['point_name'], - item['params']) + if item: + if method == 'path_usage_rate' and item.get('path_name', None): + # Set initial value(s) of self.last_path_sizes for any configured path names. + self.path_usage_rate(item.get('path_name')) + if item and item.pop('poll', None) is True: + item_publish_type = item.get('publish_type', None) + item_publish_type = 'record' if method in self.RECORD_ONLY_PUBLISH_METHODS else item_publish_type + item_publish_type = item_publish_type if item_publish_type else self.default_publish_type + self._periodic_pub(getattr(self, method), item_publish_type, item['check_interval'], item['point_name'], + item['params']) for key in contents: _log.warning('Ignoring unrecognized configuration parameter %s', key)