Jump to content

Grabbing Server Stats using PHP


leachus2002

Recommended Posts

Hi Everyone,

 

I have seen on the web that you can purchase some server monitoring applications, which mainly run using PHP. Because I don't necesserally need something so powerful, I just want to monitor memory usage and cpu usage. Is there anyway that I can do this using PHP? I have SMNP enabled if that helps?

 

Thanks

Matt

Link to comment
https://forums.phpfreaks.com/topic/220449-grabbing-server-stats-using-php/
Share on other sites

You can use the exec php function, then run the shell command 'uptime'. Then dump these results into a text file or database at whatever intervals with cron. If you really want to get fancy you can write a log parsing file to display them nicely for you.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.