PHP Classes
elePHPant
Icontem

PHP Server Stat Monitor: Monitor machine resources using own Web server

Recommend this page to a friend!
  Info   View files Documentation   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-12-08 (2 months ago) RSS 2.0 feedNot enough user ratingsTotal: 481 This week: 1All time: 5,688 This week: 777Up
Version License PHP version Categories
serverstat 1.4BSD License5.3System information, Statistics, Unix, W..., W...
Description Author

This package can monitor machine resources using own Web server.

It starts a Web server that responds to requests to retrieve the information on the server machine resource usage like CPU load, memory usage, swap space usage, RAM usage, etc..

The package can monitor resource usage on either Linux/Unix or Windows machines.

The resource usage values are returned as Web responses encoded in JSON format.

The IP address and port that the Web server are configurable parameters.

Innovation Award
PHP Programming Innovation award nominee
February 2015
Number 4


Prize: One subscription to the PDF edition of the PHP Architect magazine
Checking the usage of resources on a machine is a recommended procedure to detect problems that may be happening on the machine.

This class can check the usage of resources on a machine and provide that information by the means of a Web server started by the class.

This way the class can be used to monitor the resource usage of a machine without using another Web server that may be running on the machine or not.

Manuel Lemos
  Performance   Level  
Name: Sergey Vanyushin <contact>
Classes: 20 packages by
Country: Russian Federation Russian Federation
Innovation award
Innovation award
Nominee: 10x

Winner: 1x

Details

ServerStat

Composer package ServerStat is a server monitoring software that tracks cpu, mem and swap.

It's a web server and daemon that saves monitoring statistics and allows access it via ajax request.

serverstat is a standalone web server that reads data from storage and outputs it in web. serverstatd is a daemon that keeps system information and stores it in storage.

Configuration

File serverstat.conf: storage* - can be file only. period* - time between checks system status. typeperf* - a counter name for typeperf utility.

Starting

Run daemon serverstatd. Run server serverstat and provide port (if you want) of server: serverstat --port 83.

Typical serverstat response on any request is:

{  
   "processors":4,
   "processor_load":24,
   "memory":{  
      "total":"8499281920",
      "free":"2103896",
      "busy":8497178024
   },
   "swap":{  
      "total":0,
      "free":"0",
      "busy":0
   },
   "tasks":{  
      "total":105,
      "running":0
   },
   "uptime":30488
}
  Files folder image Files  
File Role Description
Files folder imagebin (2 files)
Files folder imagesrc (5 files)
Plain text file composer.json Data Auxiliary data
Plain text file LICENSE Data Auxiliary data
Plain text file README.md Doc. Auxiliary data
Plain text file serverstat.conf Data Auxiliary data

  Files folder image Files  /  bin  
File Role Description
  Plain text file serverstat Appl. Auxiliary data
  Plain text file serverstatd Aux. Auxiliary data

  Files folder image Files  /  src  
File Role Description
  Plain text file ConfigurationReader.php Class Class source
  Plain text file InformationCollector.php Class Class source
  Plain text file Storage.php Class Class source
  Plain text file WebServer.php Class Class source
  Plain text file WindowsInformation.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:481
This week:1
All time:5,688
This week:777Up