PHP code example of leankoala / healthfoundation

1. Go to this page and download the library: Download leankoala/healthfoundation 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/ */

    

leankoala / healthfoundation example snippets


# health.php

= new \Leankoala\HealthFoundation\HealthFoundation();

// max disc usage 95%
$spaceUsedCheck = new \Leankoala\HealthFoundation\Check\Device\SpaceUsedCheck();
$spaceUsedCheck->init(95);

$foundation->registerCheck(
    $spaceUsedCheck, 
    'space_used_check', 
    'Space used on storage server');

$runResult = $foundation->runHealthCheck();

$formatter = new \Leankoala\HealthFoundation\Result\Format\Ietf\IetfFormat(
    'Storage server is up and running.', 
    'Some problems occurred on storage server.'
);
    
$formatter->handle(
    $runResult  
);
bash
$ php bin/health.php run health.yml