Inconsistant Status calls using get_monitor_status #52
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: DGNum/uptime-kuma-api#52
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I drafted a quick and dirty python blob to test the ability to retrieve a monitor status but am getting very inconsistent results.
`import time
from uptime_kuma_api import UptimeKumaApi
from uptime_kuma_api.exceptions import UptimeKumaException
import argparse
UPTIME_KUMA_URL = 'http://192.168.22.2'
UPTIME_KUMA_USER = 'MYUSER'
UPTIME_KUMA_PASSWORD = 'MYPASSSWORD'
def poll_monitor_status(monitor_id):
api = UptimeKumaApi(UPTIME_KUMA_URL)
api.login(UPTIME_KUMA_USER, UPTIME_KUMA_PASSWORD)
if name == "main":
parser = argparse.ArgumentParser(description="Poll monitor status from Uptime Kuma API")
parser.add_argument("monitor_id", type=int, help="ID of the monitor to check")
args = parser.parse_args()
`
Below is me running the command a few times to show the inconsistency.
printer1@floorplan % python3 test.py 59 An error occurred for monitor ID 59: monitor does not exist printer1@floorplan % python3 test.py 59 An error occurred for monitor ID 59: monitor does not exist printer1@floorplan % python3 test.py 59 Monitor ID 59 Status: UP printer1@floorplan % python3 test.py 59 An error occurred for monitor ID 59: monitor does not exist
These commands were run within 5 seconds of each other, with no changes in network status , no changes of anything inside the script etc..
Any help troubleshooting would be greatly appreciated.
I am running into this as well.
Besides
monitor does not exist
I also getlist indices must be integers or slices, not str
.Although, as a python novice, I am not 100% certain if this stems from my code or the underyling code