Expose disk usage / free space to API (preferably with a readonly token)
-
From here. So we can monitor the space with tools like Grafana to avoid running out, because the check and notification mails aren't always reliable.
-
Is there something new to report on this? I just had a server that hit 100% disk space because of the new base image and mail storage but there was no email going out. It was pure luck that I saw that (still a few MB left) to avoid bigger problems. The readonly token is available I see, thanks for that!
How does everybody else monitor their diskspace?
-
@msbt AFAIK, linux provides no event for disk usage. So, one just has to poll a lot. du based polling can churn the disk a lot.
I would also like to know how this is done outside Cloudron.
-
@girish but we do have the Cloudron notification, it just doesn't send out an email about it. Could we make that a webhook or something so we can trigger alerts? I think that was the case once (email notification), but not anymore it seems.
-
@girish things that don't churn disk are non filesystem based polling, such as /proc or other similar kernel based APIs.
This can also be done in a multi stage way, for example, monitoring a /proc node for inodes that lets you know of a calculated threshold being reached after which you can query disks or filesystem for more specificity.
-
@msbt ah ok, so you just want better notifications . Can do that.
In 7.3.4 atleast, we started collecting du information in a cron job (every 24 hours).
-
@girish yes, I just want to get notified either by Cloudron via email (because I'm not always logging in and seeing the notifications) or some other means (i.e. regularly checking an API endpoint) if disk space is running low. It's not about individual space usage of apps, just the df of the main disk