@@ -34,7 +34,7 @@ |
||
| 34 | 34 | public function hardDiskMessage($hardDiskUsage) |
| 35 | 35 | { |
| 36 | 36 | return "hard disk free space ===> $hardDiskUsage Byte (" . |
| 37 | - number_format($hardDiskUsage / 1024 / 1024 / 1024, 2, '.', '') . ' GB)'; |
|
| 37 | + number_format($hardDiskUsage / 1024 / 1024 / 1024, 2, '.', '') . ' GB)'; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -60,26 +60,32 @@ |
||
| 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 | - if ($webServerStatus == 'inactive' && config('stethoscope.monitorable_resources.web_server')) |
|
| 73 | - $log .= $this->webServerMessage($webServerStatus) . "\n"; |
|
| 75 | + if ($webServerStatus == 'inactive' && config('stethoscope.monitorable_resources.web_server')) { |
|
| 76 | + $log .= $this->webServerMessage($webServerStatus) . "\n"; |
|
| 77 | + } |
|
| 74 | 78 | |
| 75 | - if ($hardDiskFreeSpace < config(('stethoscope.thresholds.hard_disk')) && config('stethoscope.monitorable_resources.hard_disk')) |
|
| 76 | - $log .= $this->hardDiskMessage($hardDiskFreeSpace) . "\n"; |
|
| 79 | + if ($hardDiskFreeSpace < config(('stethoscope.thresholds.hard_disk')) && config('stethoscope.monitorable_resources.hard_disk')) { |
|
| 80 | + $log .= $this->hardDiskMessage($hardDiskFreeSpace) . "\n"; |
|
| 81 | + } |
|
| 77 | 82 | |
| 78 | 83 | if ($log != '') { |
| 79 | 84 | $log = $this->timeMessage() . "\n" . $log; |
| 80 | 85 | |
| 81 | - if ($this->storage->exists($file)) |
|
| 82 | - $log = $this->storage->get($file) . "\n \n" . $log; |
|
| 86 | + if ($this->storage->exists($file)) { |
|
| 87 | + $log = $this->storage->get($file) . "\n \n" . $log; |
|
| 88 | + } |
|
| 83 | 89 | |
| 84 | 90 | $this->storage->put($file, $log); |
| 85 | 91 | } |
@@ -64,19 +64,19 @@ |
||
| 64 | 64 | ); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - if ($resources->contains('memory') || $resourcesIsEmpty) { |
|
| 67 | + if ($resources->contains('memory') || $resourcesIsEmpty) { |
|
| 68 | 68 | $this->info( |
| 69 | 69 | $this->memoryMessage($this->memory->check()) |
| 70 | 70 | ); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if ($resources->contains('network') || $resourcesIsEmpty) { |
|
| 73 | + if ($resources->contains('network') || $resourcesIsEmpty) { |
|
| 74 | 74 | $this->info( |
| 75 | 75 | $this->networkMessage($this->network->check()) |
| 76 | 76 | ); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - if ($resources->contains('web-server') || $resourcesIsEmpty) { |
|
| 79 | + if ($resources->contains('web-server') || $resourcesIsEmpty) { |
|
| 80 | 80 | $this->info( |
| 81 | 81 | $this->webServerMessage($this->webServer->check()) |
| 82 | 82 | ); |