-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCheckAllWrapper.php
49 lines (43 loc) · 1.36 KB
/
CheckAllWrapper.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* script that calls all individual check scripts
*
* @author Stefan Konig <[email protected]>
* @package seoSepa\PHP-ZFSHealthCheck
*/
require_once('DiskSmartCheck.php');
require_once('ZpoolCapacityCheck.php');
require_once('ZpoolStatusCheck.php');
require_once('FailHandler.php');
$wrapper = new CheckAllWrapper();
$wrapper->run();
class CheckAllWrapper
{
/**
* Perform all checks
*/
public function run()
{
$failHandler = new FailHandler();
$failHandler->debugLog('Starting ZFS Healthcheck Wrapper');
try{
$diskSmartCheck = new DiskSmartCheck();
$diskSmartCheck->run();
} catch (Exception $e) {
$failHandler->sendNotice('DiskSmartCheck failed', 'Exception: ' . print_r($e,true));
}
try{
$zpoolStatusCheck = new ZpoolStatusCheck();
$zpoolStatusCheck->run();
} catch (Exception $e) {
$failHandler->sendNotice('Zpool Status check failed', 'Exception: ' . print_r($e,true));
}
try{
$zpoolCapacityCheck = new ZpoolCapacityCheck();
$zpoolCapacityCheck->run();
} catch (Exception $e) {
$failHandler->sendNotice('Zpool Capacity check failed', 'Exception: ' . print_r($e,true));
}
$failHandler->debugLog('Finished ZFS Healthcheck Wrapper');
}
}