Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Shells Virtual Desktop
BMail.ag - Secure Email Service
Server.net
CPLicense.net
VPS Server
Buy VPN
Vultr
VMs for AI
HostDare
ReliableSite White-Label Dedicated Hosting for Resellers
InterServer VPS
BMail.ag - Secure Email Service
Best VPN
High-Performance Bare Metal Server Solutions
Karvl.com
Server Mania Cloud Hosting
DataWagon Hosting
AlphaVPS Hosting
Evoxt.com
Clouvider
VPS Hosting with NVMe
Residential IPs in the US & 4G Mobile Proxies in EU & US with Unlimited Bandwidth
ReliableSite White-Label Dedicated Hosting for Resellers
Rabisu - Hosting Solutions
Shells Virtual Desktop
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.

Opensource PHP code for server metrics

edited June 2025 in General

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

    Thanked by 2WyvernCo ariq01
  • edited June 2025

    @faleddo said:
    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.

  • itzgeoitzgeo Member

    @WyvernCo said:
    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.

    This is the way.

    Thanked by 1WyvernCo
  • eva2000eva2000 Veteran

    @LosPollosHermanos said:
    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 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.

    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 :)

    Thanked by 2WyvernCo 0xC7
  • @LosPollosHermanos said:

    @faleddo said:
    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.

    You want to show the monitor for yourself or your customer?

  • @faleddo said:

    @LosPollosHermanos said:

    @faleddo said:
    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.

    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/

  • nfnnfn Veteran

    I'm using netdata because it has more details, mainly the individual processes memory and cpu

  • darkimmortaldarkimmortal Member
    edited June 2025

    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)

  • edited June 2025

    @darkimmortal said:
    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.

  • edited June 2025

    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.

  • eva2000eva2000 Veteran

    @LosPollosHermanos said:
    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 ;)

  • edited July 2025

    @eva2000 said:

    @LosPollosHermanos said:
    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 ;)

    The Copilot extension for Visual Studio Code lets you select which AI engine it uses. Claude and Gemini are two of the choices (although they are considered premium features) in addition to ChatGPT 4.1.

    There is also a premium feature for Github called coding agent. You just create a pull request explaining what you want done, and it looks through all of your code and creates the proposed commits. It's like having your own team of coders. I created 3 pull requests that probably would have taken me a couple of weeks full-time to do manually. The agent did all 3 in about 20 minutes. The one time it didn't get something quite right I just added a comment to the pull request and it made the necessary changes.

    I couldn't imagine going back to doing things the old way.

  • edited July 2025

    Just FYI, I tried doing the same module in Copilot and Deepseek with exactly the same instructions. Google Gemini did a much better job by far. It provided a complete application from the start with all code and hooks in place, and even a fairly nice looking UI.

    Copilot only provided a basic file and folder structure without a lot of the details filled in. I had to keep prompting it telling it, this feature doesn't work, that feature doesn't work etc. One feature and function at a time and then it would fill it in. It made a lot of mistakes because it's context is too short. What AI context basically means is how far back in the conversation it can remember. As the conversation continued it would forget about things that I asked for back in time and would then get that wrong again as I asked for more changes. A more premium account would probably improve that but Google seems to give the longest context on free accounts.

    Deepseek probably provided the most advanced code, using features in WHMCS I did not know even existed, such as access to Laravel Models. However, it's context is too short for involved coding requiring it to remember lots of details, so it kept forgetting things I asked for not too far back in the conversation and then changed them again. Similar to the problem I had with copilot. It also cut off the conversation after a couple hours saying I reach my time limit, and there was no way for me to restart that same conversation. I can log back in and see the details of the conversation, but there is no way to restart it on a free account as far as I can tell.

Sign In or Register to comment.