Understand What the Script Does
The `v-system-report` script collects and displays information about your server's health and configuration. It includes checks for:
- System resources (CPU, memory, disk usage)
- Running services (like Nginx, Apache, MySQL, etc.)
- Network status and open ports
- And more, depending on customization.
You can enable or disable specific parts of the report by editing the script. For example, to disable system resource checks, you can set `CHECK_SYSTEM_RESOURCES=false` inside the script. Similarly, other checks can be toggled by modifying the respective variables at the top of the script.
Please note that the AI feature included in the script is still very premature and was developed as a playful experiment. It is not fully reliable for analysis and should be considered an experimental addition. Additionally, keep in mind that this script is a beta version developed for personal use. You should not rely on it 100% for critical system analysis, as it is still under development and may contain bugs or incomplete features.
Step 1: Create the v-system-report Script
Navigate to the Vesta bin directory where custom scripts are typically stored:
Code: Select all
cd /usr/local/vesta/bin
Code: Select all
nano v-system-report
Save and exit `nano` (Ctrl+O, Enter, Ctrl+X).
Step 2: Make the Script Executable
Set the appropriate permissions to make the script executable:
Code: Select all
chmod +x v-system-report
Code: Select all
chown root:root v-system-report
To generate a system report, simply run the script:
Code: Select all
v-system-report
Every time you run the `v-system-report` script, it automatically creates a log file with all the details of the report. The log files are stored at:
Code: Select all
/var/log/v-system-report/
If email notifications are enabled (by default), the script will also send a detailed HTML report to the admin email configured in MyVestaCP. This allows you to receive system health updates directly in your inbox.
How to Schedule Daily Reports with Cron in MyVestaCP
You can automate the execution of the script by adding a cron job in the MyVestaCP panel. This way, you will receive a daily report without manual intervention.
To add a daily cron job at 23:50, follow these steps:
1. Go to the MyVestaCP panel and navigate to Server > CRON.
2. Click on ADD CRON JOB.
3. In the command field, enter:
Code: Select all
sudo /usr/local/vesta/bin/v-system-report >/dev/null 2>&1
- Minute: `50`
- Hour: `23`
- Day: `*`
- Month: `*`
- Day of week: `*`
5. Save the cron job.
This will run the system report script every day at 23:50.
Let me know if you have any questions or need help customizing the script!
