Closed GGServersDevelopment closed 2 years ago
Sorry mate, turns out I was one version too low and that caused issues, updated uptime-kuma to the very latest one and it works now.
Same here
Works fine for me with uptime-kuma-api 0.10.0 and Uptime Kuma 1.20.2.
from uptime_kuma_api import UptimeKumaApi, MonitorType
api = UptimeKumaApi('http://127.0.0.1:3001/')
api.login('admin', 'secret123')
result = api.add_monitor(type=MonitorType.HTTP, name="Google", url="https://google.com")
print(result)
api.disconnect()
Response:
{'msg': 'Added Successfully.', 'monitorID': 1}
Hey, here's my exact code:
from uptime_kuma_api import UptimeKumaApi, MonitorType api = UptimeKumaApi('https://uptime.myDomain.io') api.login('myUsername', 'myPassword') result = api.add_monitor(type=MonitorType.HTTP, name="Google", url="https://google.com") print(result) api.disconnect()
I have verified that the username and password work, however when trying to add a monitor it fails with the following:
uptime_kuma_api.exceptions.UptimeKumaException: insert into
monitor(
accepted_statuscodes_json,
auth_method,
body,
database_connection_string,
dns_resolve_server,
dns_resolve_type,
expiry_notification,
headers,
hostname,
ignore_tls,
interval,
maxredirects,
maxretries,
method,
mqtt_password,
mqtt_success_message,
mqtt_topic,
mqtt_username,
name,
port,
proxy_id,
retry_interval,
type,
upside_down,
url,
user_id) values ('["200-299"]', '', NULL, 'Server=<hostname>,<port>;Database=<your database>;User Id=<your user id>;Password=<your password>;Encrypt=<true/false>;TrustServerCertificate=<Yes/No>;Connection Timeout=<int>', '1.1.1.1', 'A', false, NULL, NULL, false, 60, 10, 0, 'GET', NULL, NULL, NULL, NULL, 'Google', 53, NULL, 60, 'http', false, 'https://google.com', 1) - SQLITE_ERROR: table monitor has no column named auth_method
I also tried using the IP directly, but nothing helped. Also turned off logins but that still did not help