Mass Add Sites via Command Line Interface (CLI) #2981

Open
opened 2026-02-28 03:13:46 -05:00 by deekerman · 9 comments
Owner

Originally created by @Xliff on GitHub (Jan 2, 2024).

⚠️ Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find similar feature request

🏷️ Feature Request Type

API, Other

🔖 Feature description

Is there a way that one can add sites from the command line? The UI is well done and useful, but I have dozens of sites I'd like to add (I'm a new Kuma user, and this is a new install), but I'd rather not have to maintain them, en-mass, by hand.

✔️ Solution

I'll probably end up attempting to reverse engineer this, as I have an Immediate need for it. Are there technical documentations that I can use to assist in this?

Alternatives

No response

📝 Additional Context

No response

Originally created by @Xliff on GitHub (Jan 2, 2024). ### ⚠️ Please verify that this feature request has NOT been suggested before. - [X] I checked and didn't find similar feature request ### 🏷️ Feature Request Type API, Other ### 🔖 Feature description Is there a way that one can add sites from the command line? The UI is well done and useful, but I have dozens of sites I'd like to add (I'm a new Kuma user, and this is a new install), but I'd rather not have to maintain them, en-mass, by hand. ### ✔️ Solution I'll probably end up attempting to reverse engineer this, as I have an _Immediate_ need for it. Are there technical documentations that I can use to assist in this? ### ❓ Alternatives _No response_ ### 📝 Additional Context _No response_
Author
Owner

@CommanderStorm commented on GitHub (Jan 2, 2024):

Currently, there is no CLI and adding one is blocked by #118 imo.
See PR #3854 for further details on planned progress.

@CommanderStorm commented on GitHub (Jan 2, 2024): Currently, there is no CLI and adding one is blocked by #118 imo. See PR #3854 for further details on planned progress.
Author
Owner

@CommanderStorm commented on GitHub (Jan 2, 2024):

I'll probably end up attempting to reverse engineer this, as I have an Immediate need for it. Are there technical documentations that I can use to assist in this?

Note that third partys have created an api wrapper around our websockets:
https://uptime-kuma-api.readthedocs.io/en/latest/

@CommanderStorm commented on GitHub (Jan 2, 2024): > I'll probably end up attempting to reverse engineer this, as I have an _Immediate_ need for it. Are there technical documentations that I can use to assist in this? Note that third partys have created an api wrapper around our websockets: https://uptime-kuma-api.readthedocs.io/en/latest/
Author
Owner

@Xliff commented on GitHub (Jan 2, 2024):

Where can I find details on the WebSocket messaging? Has this been documented?

UPDATE: Given that using the WebSockets appears to not be the preferred method, and that I do not know Python (yet), is there a way to add monitors via accessing the kuma.db file and adding information to the tables therein?

Please note, I am not looking for something permanent. I just need to get our sites into some form of monitoring now and am willing to look, code, document methods for formally adding them later.

Thanks for your hard work in developing this tool! Works nicely!

@Xliff commented on GitHub (Jan 2, 2024): Where can I find details on the WebSocket messaging? Has this been documented? *UPDATE*: Given that using the WebSockets appears to _not_ be the preferred method, and that I do not know Python (yet), is there a way to add monitors via accessing the kuma.db file and adding information to the tables therein? Please note, I am not looking for something permanent. I just need to get our sites into some form of monitoring _now_ and am willing to look, code, document methods for formally adding them later. Thanks for your hard work in developing this tool! Works nicely!
Author
Owner

@CommanderStorm commented on GitHub (Jan 18, 2024):

is there a way to add monitors via accessing the kuma.db file and adding information to the tables therein?

You can do that, but I would recomend using the third party python api instead.

see https://uptime-kuma-api.readthedocs.io/en/latest/api.html

from uptime_kuma_api import UptimeKumaApi
api = UptimeKumaApi('INSERT_URL')
api.login('INSERT_USERNAME', 'INSERT_PASSWORD')
api.add_monitor(
    type=MonitorType.HTTP,
    name="Google",
    url="https://google.com"
)
api.disconnect()
@CommanderStorm commented on GitHub (Jan 18, 2024): > is there a way to add monitors via accessing the kuma.db file and adding information to the tables therein? You can do that, but I would recomend using the third party python api instead. see https://uptime-kuma-api.readthedocs.io/en/latest/api.html ```py from uptime_kuma_api import UptimeKumaApi api = UptimeKumaApi('INSERT_URL') api.login('INSERT_USERNAME', 'INSERT_PASSWORD') api.add_monitor( type=MonitorType.HTTP, name="Google", url="https://google.com" ) api.disconnect() ```
Author
Owner

@Xliff commented on GitHub (Jan 18, 2024):

I did manage to write something in Raku that worked out. Would you like me to share that code?

@Xliff commented on GitHub (Jan 18, 2024): I did manage to write something in Raku that worked out. Would you like me to share that code?
Author
Owner

@CommanderStorm commented on GitHub (Jan 18, 2024):

Given the scarily complex syntax of said language, I am a bit doubtful that we could use that code, but sure share it ^^

(Why I am doubtful https://www.youtube.com/watch?v=9J0vCQ36020)

@CommanderStorm commented on GitHub (Jan 18, 2024): Given the scarily complex syntax of said language, I am a bit doubtful that we could use that code, but sure share it ^^ (Why I am doubtful https://www.youtube.com/watch?v=9J0vCQ36020)
Author
Owner

@Xliff commented on GitHub (Jan 27, 2024):

ROFLMAO!!!

Don't believe the hype.

I was able to do the addition script in less than a day. If said syntax was so scarily complex, I wouldn't have been able to do half of the things I've been able to accomplish in it.

(And I have over 1 million lines in over 65 separate projects in less than 6 years to prove it...)

@Xliff commented on GitHub (Jan 27, 2024): ROFLMAO!!! Don't believe the hype. I was able to do the addition script in less than a day. If said syntax was so scarily complex, I wouldn't have been able to do half of the things I've been able to accomplish in it. (And I have over 1 million lines in over 65 separate projects in less than 6 years to prove it...)
Author
Owner

@danielgoepp commented on GitHub (Feb 14, 2025):

I'll probably end up attempting to reverse engineer this, as I have an Immediate need for it. Are there technical documentations that I can use to assist in this?

Note that third partys have created an api wrapper around our websockets: https://uptime-kuma-api.readthedocs.io/en/latest/

Unfortunately this option doesn't look like a great plan either:

https://github.com/lucasheld/ansible-uptime-kuma/issues/54
https://github.com/lucasheld/uptime-kuma-api/issues/75

:(

Fingers crossed a good programmatic way to interface with this platform will happen some day.

@danielgoepp commented on GitHub (Feb 14, 2025): > > I'll probably end up attempting to reverse engineer this, as I have an _Immediate_ need for it. Are there technical documentations that I can use to assist in this? > > Note that third partys have created an api wrapper around our websockets: https://uptime-kuma-api.readthedocs.io/en/latest/ Unfortunately this option doesn't look like a great plan either: https://github.com/lucasheld/ansible-uptime-kuma/issues/54 https://github.com/lucasheld/uptime-kuma-api/issues/75 :( Fingers crossed a good programmatic way to interface with this platform will happen some day.
Author
Owner

@paul-uz commented on GitHub (Feb 19, 2025):

Any updates?

@paul-uz commented on GitHub (Feb 19, 2025): Any updates?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/uptime-kuma#2981
No description provided.