help me achieve this:
I'm managing several raspberry pi remotely, and some VPS servers
I need to monitorize their status, remotely. For this I built an app that I install on each server and it reports to my main server the data I need.
I know there's a TON of tools to achieve this but I have no experience with any of those and many of those seems complicated to use or are paid, and I'm running out of time and money, that's why I decided to keep with the simple approach of building a basic app.
So far my app is working fine for the basic stats I need, but there's other stats that I'm not sure how to get.
My app just reports the following so far:
CPU usage: sar -P ALL 3 1 | grep -m 1 "all" | awk '{print 100 - $NF}'
RAM usage: free | grep Mem | awk '{print ($3/$2)*100}'
Storage usage: df -h / | awk 'NR==2 {print $5}'
But I need the temperature of each server too, because some microsd of some raspberrys sometimes gets damaged, etc and it could help me check it's health(? Maybe there's an alternative like SMART tests but I don't know them. If you know, please let me know.
Also I would like to know the temp of the CPU and maybe the temp of the ram too, idk if it's useful or just a waste of time
So far I've been using the commands before to get that data but I don't know if there's an alternative that could also give me all the data I need in a single command from the terminal so I can leverage on it and avoid making several runs of distinct apps everytime my app makes a report
Sorry if it's a basic question, I'm not a Linux pro. Nor a DevOps expert, etc.
Why not just use a monitoring tool like Icinga2, Zabbix or Prometheus?
You can use a tool like Monit or Nagios however personally I haven't used either of them so can't really confirm if they're gonna work as expected
I don't have time to learn how to use them and I need to centralize the reports in a single server
Hire someone who does then
Icinga2 is very straight forward and has good documentation.
I really wouldn't claim it's straightforward :D
It's more straightforward than Zabbix
I hope you're at least throwing the data into grafana or something. Either way, launching MORE processes probably isn't helping, why don't you do the parsing in your application?
I don't want to launch more processes, all I said is that I'm looking a way to launch a single process of some app that could give me all the data I need from a single command, instead of actually launching several programs And no, I'm not using grafana nor prometheus nor anything, as I said I'm not an expert and I don't have much free time, all I do is run this app and update a simple database in a centralized server through a web api so I can check it when I need it, not everything must be fancy and complex, this is not for selling services, it's just a personal basic tool to help me achieve a simple goal
Yes, you can write one. Instead of free, grep and awk, parse /proc/meminfo, for example.
Yes I could do that, or just avoid all that parsing if there's some app that does it, then leverage on it and save a lot of time I mean, it could be more reliable to just use other's professionals work and abstract my app from those tasks, that's exactly what I'm looking for but I think it does not exist (? A tool named like "hoststats" and maybe some command like "hoststats -cpu -ram -storage -temp" I don't know, lol, there's so many tools that maybe in a Linux group, somebody knows about it so I can save a lot of time than building it myself, and if it's paid, I would pay it if the price is affordable
Time to exfiltrate inhouse monitoring and make some money on the side 😂
If I'm willing to pay for it, maybe there's another person like me lol
If only it weren't awfully illegal, I would have helped you out :D
Why is it illegal?
This ^ Meminfo does require a bit of basic math to get it to display the human readable values, but it’s a lot easier on the code because of that too. Not to mention that now you’re the one in control of what’s displayed and how. Nobody else stands in between that.
Yeah let's say ram usage is done that way, how about everything else?
Nagios with NRPE. The NRPE plugin can be coded with just Bash for whatever output status you want
I'd argue that Icinga2 with NRPE is better...I dislike Nagios
They are family. Grandpa and daddy 😂
This is why I don't even know where to start lol
NRPE runs as daemon on the remote client including the required plugins and command definitions. Icinga 2 calls the check_nrpe plugin binary in order to query the configured command on the remote client.
Обсуждают сегодня