From e8932a5db15ba0d92c44e5b8ca72a14b80166ee0 Mon Sep 17 00:00:00 2001 From: Ken Sanislo Date: Wed, 26 Dec 2018 16:31:11 -0800 Subject: [PATCH] better default config.yml --- persistent/config.yml | 42 +++++++++++++++++++++++++++++++++--------- tcc-exporter | 8 ++++---- 2 files changed, 37 insertions(+), 13 deletions(-) diff --git a/persistent/config.yml b/persistent/config.yml index b666058..703db87 100644 --- a/persistent/config.yml +++ b/persistent/config.yml @@ -1,11 +1,35 @@ -log.level: INFO +--- +# This controls the logging verbosity, avaliable choices are: +# CRITICAL, ERROR, WARNING, INFO, or DEBUG +# Log entries for all previous levels are also included. +#log.level: INFO + +# These are the username and password used to login to your +# mytotalconnectcomfort.com account to collect your stats. tcc.username: your-login@email-address.com tcc.password: your-password -tcc.timeout: 10 -exporter.host: 0.0.0.0 -exporter.port: 9101 -exporter.cookiejar: persistent/cookies.txt -exporter.sync_interval: 300 - -# This makes legacy TCC_* env variables override values from this config file. -legacy.override: True + +# This controls adjusts the timeouts used by the exporter. +# Length is specified in seconds. It's generally best to keep +# this set shorter than your prometheus collection interval. +#tcc.timeout: 10 + +# The local interface to which tcc-exporter will bind for it's service +#exporter.host: 0.0.0.0 + +# The TCP port number to listen on. +#exporter.port: 9101 + +# This controls the path where login cookies are stored. If you're using +# the standard docker container, this should be somewhere mounted via +# persistent storage. While not critical, if you don't maintain cookies +# through restarts, it's easy to trigger the too-many-logins message. +#exporter.cookiejar: persistent/cookies.txt + +# This controls the minimum age of the exporter.cookiejar file before it +# is overwritten during normal operations. A successful login() doesn't +# check this, so fresh cookies will always be saved immediately. +#exporter.sync_interval: 300 + +# This allows TCC_* env variables override values from this config file. +#config.override: True diff --git a/tcc-exporter b/tcc-exporter index 70f8b7f..d4f47e2 100755 --- a/tcc-exporter +++ b/tcc-exporter @@ -17,7 +17,7 @@ from http.cookiejar import LWPCookieJar from http.server import HTTPServer, BaseHTTPRequestHandler from urllib.error import HTTPError -VERSION = '0.9.7' +VERSION = '0.9.8' CONFIG_FILE = os.environ.get('TCC_CONFIG_FILE', 'persistent/config.yml') PREFIX = 'https://mytotalconnectcomfort.com/' @@ -258,10 +258,10 @@ def load_config(): config['exporter.cookiejar'] = 'persistent/cookies.txt' if not 'exporter.sync_interval' in config: config['exporter.sync_interval'] = 300 - if not 'legacy.override' in config: - config['legacy.override'] = True + if not 'config.override' in config: + config['config.override'] = True # Override if allowed. - if 'legacy.override' in config and config['legacy.override']: + if 'config.override' in config and config['config.override']: # Load environment settings if os.environ.get('TCC_USERNAME'): config['tcc.username'] = os.environ.get('TCC_USERNAME')