kaankilic/serverup

Server Uptime Checker Tool

2.3 2016-11-07 05:37 UTC

This package is auto-updated.

Last update: 2024-12-13 00:36:24 UTC


README

Basic useful Server Uptime and connection checker tool.

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

Installation

You can install the package via composer:

composer require kaankilic/serverup

or require the tool in your composer.json file.

"kaankilic/serverup": "^2.0"

then run composer install command from your command line.

Once ServerUp is installed you need to register the service provider.Open up config/app.php and add the provider key of tool.

'providers' => array(
	...
    Kaankilic\ServerUp\Providers\ServerUpServiceProvider::class,
)

After that, you need to register the facade in the aliases key of your config/app.php file.

'aliases' => array(
	... aliases
	'ServerUp'=> Kaankilic\ServerUp\Facades\ServerUp::class,
)

Finally, from the command line again, publish the default configuration file:

php artisan vendor:publish --provider="Kaankilic\ServerUp\Providers\ServerUpServiceProvider"

Usage

Simple Usage

	ServerUp::ping("http://facebook.com",80);
	ServerUp::getIsTotalyAvail(); //returns boolean value

Advanced Usage

You must define Hostname and Port values for the ping values.Then, you can get availibility of ip or domain with ping() facades. Example code is on the below:

	ServerUp::setHostname("http://facebook.com");
	ServerUp::setPort(80);
	ServerUp::setSampleAmount(50);
	ServerUp::setTimeoutDuration(10); // unit is integer based milliseconds
	ServerUp::getIsTotalyAvail(); //returns boolean value
	var_dump(ServerUp::ping()); //returns the SocketResponses for each ping request