Guide: How to add monitoring to your Cloudron server for free (RAM/Disk/etc.), using Netdata (5mn setup)
-
Edit: Added as a Community Guide : Monitoring and Alerting
Motivations
Since I started using Cloudron, I've had the same recurring pain point:
It lacks a built-in monitoring and alerting system to help me anticipate and fix issues before they break things.Don't get me wrong, I love Cloudron and what it does. I just feel like it doesn't give us the best tools to avoid shooting ourselves in the feet regarding monitoring and best practices.
I mean, just a guide (like this one) is all I was asking for, from the perspective of a web developer who needs to efficiently monitor my infrastructure. I needed to be given some strong foundation about how to do that, without having to experiment by myself tons of solutions.
So, this guide aims to change that, and provide you with a 5mn guide to add monitoring to your Cloudron servers, with those goals in mind:
- Simple to set up
- Receive notifications when alerts occur
- Handle multiple servers and centralize them
- Freemium (starts for free, pay if you grow beyond limits)
Solution - Using Netdata
Netdata is the solution I retained for this, it ticked all my boxes, and was super simple to install.
I tried Grafana first, and ugh, wasted 2-3h trying to understand how to do the setup, eventually succeeded, to finally fail to set up notifications.How to install in 5mn (step by step)
Netdata steps are super simple:
- Create a Netdata account
- Add your first Node, select "Linux" (path:
Deploy/Operating Systems/Linux
) - Copy the command line provided (
wget...
) - Paste and execute the command line in the Linux server you want to monitor (basically, your Cloudron server), you'll need to connect to it first (using SSH, most likely)
- Accept the various prompts (Netdata installs itself as a background service, and it nicely asks for your confirmation before doing that)
- You're done, check your Netdata dashboard, the data will start flowing in immediately
Video guide
Here is a 10mn video guide covering the installation part, and also a demo about how the notification system works when an alert is triggered.
Other solutions
Grafana
Grafana is theoretically supposed to do the same thing as Netdata, it's OSS, too.
But when it came to installing and configuring, I found the process so much harder (I kind of wish I had tried Netdata first).Eventually, I got stuck with the notification system and tried out Netdata, which was a pleasant surprise of simplicity and efficiency.
Custom scripts
Other members have proposed using custom bash scripts to handle the monitoring part.
But I don't want to do that. I don't know what I don't know, and I for sure know I'm not a sysadmin expert, and I also know I don't want to become one.
So, relying on scripts that I would need to install and maintain myself is a big no-go. I'm pretty sure I can't do as good of a job as a specialized tool. And, clearly, Netdata showed me I was on point about that.
-
-
-
-
This should go to https://docs.cloudron.io/guides/community/ - you can create a PR yourself!
-
@necrevistonnezr said in Guide: How to add monitoring to your Cloudron server for free (RAM/Disk/etc.), using Netdata (5mn setup):
This should go to https://docs.cloudron.io/guides/community/ - you can create a PR yourself!
Great suggestion, I'll do that now!
I looked at https://git.cloudron.io/cloudron/docs, and it doesn't provide a "Contributing" section or Contributing.md about how to provide a contribution.
It would help external contributors to get started autonomously while ensuring we're following the expected procedure. Right now, I'm a bit at a loss with how to contribute. Do I need to create an account? Should I just clone (or fork?) and just create a branch? I don't see where Pull Requests are located.
Plenty of questions that could be addressed with a short guide
-
@AmbroiseUnly said in Guide: How to add monitoring to your Cloudron server for free (RAM/Disk/etc.), using Netdata (5mn setup):
I looked at https://git.cloudron.io/cloudron/docs, and it doesn't provide a "Contributing" section or Contributing.md about how to provide a contribution.
I have no idea how to write one either. Is this some standard? In any case, you can just fork the repo and submit a Merge Request (gitlab terminology). YOu can see some previous example here - https://git.cloudron.io/cloudron/docs/-/merge_requests?scope=all&state=merged
-
Well, https://contributing.md/how-to-build-contributing-md/ is a good starting point.
I tried to fork, but to be frank the process is super annoying... Here is what I did:
- Tried to login using GitLab/GitHub, none worked, I guessed I had to create a dedicated account after all
- Created a GitLab account on git.cloudron.io (annoying to have to create a dedicated account just for Cloudron GitLab)
- Setup MFA (super annoying to have to do that just to contribute to some markdown documentation)
- Fork: Failed with "Limit reached You cannot create projects in your personal namespace. Contact your GitLab administrator."
And I believe I'll also need to setup SSH to be able to write/push.
This isn't contributor-friendly, the root issue is the fact we can't simply use our existing GitLab/GitHub account to contribute. Forking isn't possible without an account (and I guess cloning neither)But all of that isn't really related to this topic, maybe it should be moved onto a new post?
-
@AmbroiseUnly fyi afaik all those annoying hoops to jump through are sadly necessary to stop spam bots.
Once you have it all set-up (and have been given permission to fork) and have the credentials saved in your pw manager it's simple. But fair point that getting to that stage isn't as easy as it could be.
-
@girish said in Guide: How to add monitoring to your Cloudron server for free (RAM/Disk/etc.), using Netdata (5mn setup):
@AmbroiseUnly What's your GitLab id? We have to bump the repo limit on our side and then you should be able to fork.
5263
Thanks
-
-
-
So just to be clear netdata is not a free solution, and you have to send your ssh credentials for the server to their platform.
So theres a risk that they get hacked and the credentials would be stolen...I'm not really sold on the cost / risk / benefit of doing this.
-
@AartJansen said in Guide: How to add monitoring to your Cloudron server for free (RAM/Disk/etc.), using Netdata (5mn setup):
you have to send your ssh credentials for the server to their platform
Really?!?
-
@AartJansen where did you get that nonsense? Please proof with evidence.
-
@AmbroiseUnly said in Guide: How to add monitoring to your Cloudron server for free (RAM/Disk/etc.), using Netdata (5mn setup):
Paste and execute the command line in the Linux server you want to monitor (basically, your Cloudron server), you'll need to connect to it first (using SSH, most likely)
Sorry I misread this.
-
I'm the CTO of a few companies and I haven't noticed anything wrong regarding security.
Sorry my phrasing made you believe otherwise. -
@AmbroiseUnly no, its my fault, I didn't read what you had written correctly.
-
@AmbroiseUnly Thank you for sharing this!
- Netdata can also be self-hosted, correct? Did you try this or did you use the cloud-version only?
- If I understand this correctly, this wouldn't contain the individual apps' logs, correct? So, if I wanted to monitor them as well, I would need to set up separate nodes, which would cost separately?
-
-
yes, it seems self-hostable.
https://github.com/netdata/netdata
https://www.reddit.com/r/netdata/comments/1cjo9za/self_hosting_netdata/ -
I'm not sure about the technical details, but I don't believe it processes the apps logs indeed.
It's more about monitoring of the system that is common for all computers.
Although I noted it does check individual processes, like one of my Cloudron App was relying on Postgres and it notified me when the RAM about that particular process was too high, which helped me increase it (for that process) before running out.
-
-