New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Opensource PHP code for server metrics

I would like to build my own server for connecting to VPS servers and storing metrics for charting. Exactly the same sort of functionality that SolusVM, Virtualizor, and DigitalOcean provide. So CPU%, Load, Memory, Storage. Saving data every few minutes and storing 14 days worth. Anyone know of any good opensource PHP projects that can do that? I can chart it myself using chart.js. I just need something that collects the data without having to write the whole thing from scratch.
Anyone know what the above mentioned CPs use? I am only interested in open source. Not commercial paid software or services.
Comments
Prometheus? You can use their node exporter to collect system stats and store it on your prometheus instance. From there, you could query it via PHP (one of the seven pages of composer results should do it). Or just use grafana, which is awesome.
Zabbix
I am already using zabbix to monitor my nodes, so that is an option for vps servers yes. However, I would then need to link it up with WHMCS to automatically add the VPS servers. I have too many to try deal with that manually. Probably just as much work to build my own and maybe just run it on my WHMCS server.
Maybe someone already has a metrics module for WHMCS? I would probably be willing to pay for that if the price was right. Looks like ModulesGarden has something for $100/year. Not a fan of their software but I haven't tried using them in a few years. Maybe they are getting better? I've looked at the 360 Monitoring addon from Plesk and wasn't impressed. Maybe I will have to build my own.
This is the way.
Prometheus/node exporter is definitely one as already mentioned.
I work with my clients and need to quickly understand their resource usage, so created my own standalone script that can grab sysstat native sar CPU, memory, disk, network stats in JSON format and they have it parsed and displayed via static HTML pages with highchart JS library. Some clients don't want the overhead of installing Prometheus/Grafana or setups for such, so a simple standalone script would be easy to setup and remove after I finish my work.
example for my standalone script but it ain't open source. But just gives you an idea for another method
You want to show the monitor for yourself or your customer?
It's for the customers.
A vouch for Prometheus/node exporter & Grafana
Maybe take a look at: https://www.netdata.cloud/
I'm using netdata because it has more details, mainly the individual processes memory and cpu
I like the old fashioned approach - collectd and collectd graph panel (PHP). It's traditional rrd graphs, updated as fast as you like (1s no problem), and rendered client side (optional but fast)
Thanks. Will take a look.
I told Gemini AI that I wanted to add metrics to an existing WHMCS provisioning module, gave it a basic idea of my file and folder structure and where it can hook in, and it created the whole thing for me. All object oriented, properly organized into separate classes and folders. Probably saved me weeks of work.
When something didn't work and I got some cryptic SQL error, I would just give it the error and it would fix it. If I wanted variable names changed or other tweaks, it would just regenerate everything again. It would even highlight the changes if I asked. It remembers the conversation so I was able to go back the next day and tell it to make more changes.
I also got it to create an addon module for tracking and assigning my IP address blocks. It probably would have taken me several days on my own. Gemini helped me finish it in several hours. Seems to be getting quite good at it.
I'd get it to double check code for security issues and also get Claude or OpenAI models to double check the code too