PHP Classes

PHP Server Status Script: Check a status file to determine if a site is down

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 122 All time: 9,480 This week: 59Up
Version License PHP version Categories
server-downtime 1.0.0Custom (specified...5PHP 5, System information, Tools
Description 

Author

This package can check a status file to determine if a site is down.

It provides a script that can be executed from a cron task to check the time an application recorded it is up and running.

If it passes a given time after the last uptime moment, the script will record a downtime moment in another file.

Innovation Award
PHP Programming Innovation award nominee
June 2023
Number 6
Every Web project needs to be monitored to confirm it responds well when the users access the site.

One way to monitor a site is to try to access one page and check if it is responding quickly.

This package provides a script that responds to accesses from a separate server.

The script can check an internal file that records the last time the site application responded well.

If it passed more than a given time, the script can record a down time moment and output a response that displays the current down time.

This way, a developer can implement a simple server status script cheaply.

Manuel Lemos
Picture of Aleksandar Vranesevic
Name: Aleksandar Vranesevic is available for providing paid consulting. Contact Aleksandar Vranesevic .
Classes: 1 package by
Country: Serbia Serbia
Age: ???
All time rank: 435913 in Serbia Serbia
Week rank: 178 Up2 in Serbia Serbia Up
Innovation award
Innovation award
Nominee: 1x

Documentation

How to install

Add cron job:

curl https://(your_website_address)/cronjob/server_uptime.php >/dev/null 2>&1  

Set cron job to be once per minute.

Make sure used directory is writable.

Downtime log will be in used/downtime_log.dat file, open file with any text editor to see logged data.


  Files folder image Files (4)  
File Role Description
Files folder imagecronjob (2 files)
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (4)  /  cronjob  
File Role Description
  Accessible without login Plain text file configuration.php Conf. Configuration script
  Accessible without login Plain text file server_uptime.php Appl. Application script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:122
This week:0
All time:9,480
This week:59Up