antonioribeiro / health

Laravel Health Panel
BSD 3-Clause "New" or "Revised" License
1.94k stars 198 forks source link

Add basic support for NPRE standard exit codes #241

Closed keevan closed 2 years ago

keevan commented 2 years ago

Related to https://github.com/antonioribeiro/health/issues/239 and https://github.com/antonioribeiro/health/issues/240

Example output

root@a01fe36051f6:/siteroot/api# php artisan health:panel
+--------------------------------------+----------+--------------------------------------------------------------+
| Resource                             | State    | Message                                                      |
+--------------------------------------+----------+--------------------------------------------------------------+
| App Key (default)                    | OK       |                                                              |
| Cache (default)                      | OK       |                                                              |
| Configuration Cached (default)       | Critical | Configuration is not cached                                  |
| Debug Mode (default)                 | Critical | Application is in debug mode                                 |
| Directory Permissions (default)      | OK       |                                                              |
| Disk Space (root)                    | OK       |                                                              |
| .env Exists (default)                | OK       |                                                              |
| Filesystem (default)                 | OK       |                                                              |
| Framework (default)                  | OK       |                                                              |
| LaravelServices (default)            | OK       |                                                              |
| LocalStorage (default)               | OK       |                                                              |
| Migrations Up to Date (default)      | OK       |                                                              |
| NginxServer (default)                | OK       |                                                              |
| Php (default)                        | OK       |                                                              |
| Queue (default)                      | OK       |                                                              |
| QueueWorkers (default)               | OK       |                                                              |
| RebootRequired (default)             | OK       |                                                              |
| Routes Cached (default)              | Critical | Routes are not cached                                        |
| ServerUptime (default)               | OK       | Looks like your server was recently rebooted, current uptime |
|                                      |          | is now "2 weeks 17 hours 56 minutes" and it was "1 week 6    |
|                                      |          | days 21 hours 4 minutes" before restart.                     |
| Supervisor (default)                 | OK       |                                                              |
+--------------------------------------+----------+--------------------------------------------------------------+
root@a01fe36051f6:/siteroot/api# echo $? # print out exit code
2

https://localhost/health/resources/queue?format=summary

OK: Queue is running as expected (Checked Sep 8 16:09:01)

https://localhost/health/resources/configuration-cached?format=summary

CRITICAL: Configuration is not cached (Checked Sep 8 16:09:27)
PragmaRX\Health\Checkers\Expression was used to determine the health
antonioribeiro commented 2 years ago

Loved everything you did here, @keevan , sorry for being late, will work on merging and testing it.

Thank you.