You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Client Version: influxdb 5.3.1 installed on Pycharm IDE
InfluxDB Version: I think it is 1.7.9 running on top of Linux
Platform: Python program runs on MacOS Ventura 13.5.1
Dear sirs:
I am running my Python script on PyCharm 2022.3.3 (Community Edition). My call to InfluxDB works OK, but I would like to add some checks to my program in case the connection fails.
I found that I should use the following sentences:
health = client.health()
if health.status == "pass":
print("Connection OK")
else:
print(f"Connection error: {health.message}!")
But my interpreter fails with the following error message:
health = client.health()
AttributeError: 'InfluxDBClient' object has no attribute 'health'
¿ Do I need to upgrade my client? ¿Or is there any other available way to check the health of my connection?
Your help will be greatly appreciated
Best regards
Rogelio
health = client.health()
if health.status == "pass":
print("Conexión exitosa a InfluxDB.")
else:
print(f"Error de conexión a InfluxDB: {health.message}!")
Expected behavior
I expect client.health() to return a pass or the error code
Actual behavior
My program fails with the following error message:
health = client.health()
AttributeError: 'InfluxDBClient' object has no attribute 'health'
Additional info
No response
The text was updated successfully, but these errors were encountered:
Specifications
Dear sirs:
I am running my Python script on PyCharm 2022.3.3 (Community Edition). My call to InfluxDB works OK, but I would like to add some checks to my program in case the connection fails.
I found that I should use the following sentences:
health = client.health()
if health.status == "pass":
print("Connection OK")
else:
print(f"Connection error: {health.message}!")
But my interpreter fails with the following error message:
health = client.health()
AttributeError: 'InfluxDBClient' object has no attribute 'health'
¿ Do I need to upgrade my client? ¿Or is there any other available way to check the health of my connection?
Your help will be greatly appreciated
Best regards
Rogelio
Code sample to reproduce problem
client = InfluxDBClient(host='10.235.2.19', port=8086, username='admin', password='nimda')
client.switch_database('telegraf')
health = client.health()
if health.status == "pass":
print("Conexión exitosa a InfluxDB.")
else:
print(f"Error de conexión a InfluxDB: {health.message}!")
Expected behavior
I expect client.health() to return a pass or the error code
Actual behavior
My program fails with the following error message:
health = client.health()
AttributeError: 'InfluxDBClient' object has no attribute 'health'
Additional info
No response
The text was updated successfully, but these errors were encountered: