Server-Monitor

Server Monitor platform built with Laravel 11 + PHP 8.2 and SQLite. Plataforma de Monitorización de Servidores creada con Laravel 11 + PHP 8.2 y SQLite.

MIT License

Stars
20
Committers
1

Requirements

  • PHP 8.2 or higher (bcmath bz2 intl mbstring opcache pcntl redis sqlite3 xsl zip)
  • Redis

Install

  1. Clone the repository.
git clone https://github.com/eusonlito/Server-Monitor.git
  1. Launch the setup
./composer setup
  1. Edit the .env file and fill in the necessary variables.
vi .env
  1. Launch the deploy
./composer deploy
  1. Configure the cron job for the user related to the project.
* * * * * cd /var/www/monitor.domain.com && install -d storage/logs/artisan/$(date +"\%Y/\%m/\%d") && /usr/bin/php artisan schedule:run >> storage/logs/artisan/$(date +"\%Y/\%m/\%d")/schedule-run.log 2>&1
  1. Create the main user.
php artisan user:create --email[email protected] --name=Admin --password=StrongPassword2 --enabled
  1. Configure the web server DocumentRoot to /var/www/project/public.

  2. Create your first server.

  3. Connect to remote server and download the client script (never as root).

curl -H "Authorization: Bearer AUTH_TOKEN" \
  -o server-monitor.sh \
  https://monitor.domain.com/server/script

chmod 755 server-monitor.sh
  1. Verify that the script matches the one at https://github.com/eusonlito/Server-Monitor/blob/master/resources/app/server/script

  2. Test the script (never as root).

./server-monitor.sh
  1. Add the script to cron jobs (never as root).
* * * * * cd /script/path && ./server-monitor.sh >> server-monitor.log 2>&1

Upgrade

Updating the platform can be done in a simple way with the ./composer deploy command executed by the user who manages that project (usually www-data).

Screenshots

Related Projects