PHP code example of ericmakesstuff / laravel-server-monitor
1. Go to this page and download the library: Download ericmakesstuff/laravel-server-monitor library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ericmakesstuff / laravel-server-monitor example snippets
'monitors' => [
/*
* DiskUsage will alert when the free space on the device exceeds the alarmPercentage.
* path is any valid file path, and the monitor will look at the usage of that disk partition.
*
* You may add as many DiskUsage monitors as you checkPhrase is not found in the response.
*/
'HttpPing' => [
[
'url' => 'http://www.example.com/',
],
[
'url' => 'http://www.example.com/',
'checkPhrase' => 'Example Domain',
'timeout' => 10,
'allowRedirects' => false,
],
],
/*
* SSLCertificate will download the SSL Certificate for the URL and validate that the domain
* is covered and that it is not expired. Additionally, it can warn when the certificate is
* approaching expiration.
*/
'SSLCertificate' => [
[
'url' => 'https://www.example.com/',
],
[
'url' => 'https://www.example.com/',
'alarmDaysBeforeExpiration' => [14, 7],
],
],