From 41bd4e1465ab85e9acac3c463de06b13cd41769d Mon Sep 17 00:00:00 2001 From: yohan <783b8c87@scimetis.net> Date: Sat, 8 Jun 2024 21:52:36 +0200 Subject: [PATCH] Disable recording while testing. --- sensors-polling.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sensors-polling.py b/sensors-polling.py index 0427a9e..b94f7f8 100755 --- a/sensors-polling.py +++ b/sensors-polling.py @@ -132,14 +132,14 @@ def sensors_polling(poller_conf): try: for metric in poller_conf['metrics']: logger.debug('Posting data for '+metric['name']) - r = s.post(post_url[metric['type']], - headers={'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0', - 'X-API-KEY': recording_api_key}, - json={'metric': metric['name'], - 'value': last_data[metric['name']]['value'], - 'time': utc_now.isoformat()}) - if r.status_code != 201: - logger.error(str(r.status_code)+" "+r.reason) + #r = s.post(post_url[metric['type']], + # headers={'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0', + # 'X-API-KEY': recording_api_key}, + # json={'metric': metric['name'], + # 'value': last_data[metric['name']]['value'], + # 'time': utc_now.isoformat()}) + #if r.status_code != 201: + # logger.error(str(r.status_code)+" "+r.reason) # It has to be current_time variable so the interval check works correctly last_recording_time=current_time logger.debug('last_recording_time: '+str(last_recording_time))