|
@@ -60,14 +60,17 @@ discard block |
|
|
block discarded – undo |
|
60
|
60
|
|
|
61
|
61
|
$log = ''; |
|
62
|
62
|
|
|
63
|
|
- if ($cpuUsage > config(('stethoscope.thresholds.cpu')) && config('stethoscope.monitorable_resources.cpu')) |
|
64
|
|
- $log .= $this->cpuMessage($cpuUsage) . "\n"; |
|
|
63
|
+ if ($cpuUsage > config(('stethoscope.thresholds.cpu')) && config('stethoscope.monitorable_resources.cpu')) { |
|
|
64
|
+ $log .= $this->cpuMessage($cpuUsage) . "\n"; |
|
|
65
|
+ } |
|
65
|
66
|
|
|
66
|
|
- if ($memoryUsage > config(('stethoscope.thresholds.memory')) && config('stethoscope.monitorable_resources.memory')) |
|
67
|
|
- $log .= $this->memoryMessage($memoryUsage) . "\n"; |
|
|
67
|
+ if ($memoryUsage > config(('stethoscope.thresholds.memory')) && config('stethoscope.monitorable_resources.memory')) { |
|
|
68
|
+ $log .= $this->memoryMessage($memoryUsage) . "\n"; |
|
|
69
|
+ } |
|
68
|
70
|
|
|
69
|
|
- if (!$networkStatus && config('stethoscope.monitorable_resources.network')) |
|
70
|
|
- $log .= $this->networkMessage($networkStatus) . "\n"; |
|
|
71
|
+ if (!$networkStatus && config('stethoscope.monitorable_resources.network')) { |
|
|
72
|
+ $log .= $this->networkMessage($networkStatus) . "\n"; |
|
|
73
|
+ } |
|
71
|
74
|
|
|
72
|
75
|
if (($webServerStatuses['nginx'] != 'active' && config('stethoscope.monitorable_resources.web_server'))) { |
|
73
|
76
|
$log .= $this->webServerMessage('nginx', $webServerStatuses['nginx']) . "\n"; |
|
@@ -77,14 +80,16 @@ discard block |
|
|
block discarded – undo |
|
77
|
80
|
$log .= $this->webServerMessage('apache', $webServerStatuses['apache']) . "\n"; |
|
78
|
81
|
} |
|
79
|
82
|
|
|
80
|
|
- if ($hardDiskFreeSpace < config(('stethoscope.thresholds.hard_disk')) && config('stethoscope.monitorable_resources.hard_disk')) |
|
81
|
|
- $log .= $this->hardDiskMessage($hardDiskFreeSpace) . "\n"; |
|
|
83
|
+ if ($hardDiskFreeSpace < config(('stethoscope.thresholds.hard_disk')) && config('stethoscope.monitorable_resources.hard_disk')) { |
|
|
84
|
+ $log .= $this->hardDiskMessage($hardDiskFreeSpace) . "\n"; |
|
|
85
|
+ } |
|
82
|
86
|
|
|
83
|
87
|
if ($log != '') { |
|
84
|
88
|
$log = $this->timeMessage() . "\n" . $log; |
|
85
|
89
|
|
|
86
|
|
- if ($this->storage->exists($file)) |
|
87
|
|
- $log = $this->storage->get($file) . "\n \n" . $log; |
|
|
90
|
+ if ($this->storage->exists($file)) { |
|
|
91
|
+ $log = $this->storage->get($file) . "\n \n" . $log; |
|
|
92
|
+ } |
|
88
|
93
|
|
|
89
|
94
|
$this->storage->put($file, $log); |
|
90
|
95
|
} |