This guide provides step-by-step instructions to set up additional monitoring tools on your server, including top, iotop, Apache process list, MySQL process list, and iostat.
Overview
Create a directory for MySQL logs:
Download the MySQL process list monitoring script:
Make the script executable:
Download the Apache process list monitoring script:
Make the script executable:
Set up a cron job to run the MySQL process list script every minute and log the output:
Set up a cron job to run the Apache process list script every minute and log the output:
Set up a cron job to delete logs older than one day, running daily at 4:05 AM:
By following these steps, you will have additional monitoring tools set up to track the performance and processes of your server, helping you to diagnose issues and maintain optimal performance.
Overview
- top: Displays real-time system summary information and a list of processes or threads currently being managed by the Linux kernel.
- iotop: Monitors disk I/O usage information output by the Linux kernel.
- Apache process list: Monitors the processes of the Apache web server.
- MySQL process list: Monitors the processes of the MySQL database server.
- iostat: Reports CPU statistics and input/output statistics for devices and partitions.
Create a directory for MySQL logs:
Code:
mkdir /root/mysql-logs
Code:
wget -nv http://dl.myvestacp.com/vesta/see-mysql-processlist.sh -O /root/see-mysql-processlist.sh
Code:
chmod u+x /root/see-mysql-processlist.sh
Code:
wget -nv http://dl.myvestacp.com/vesta/see-apache-processlist.sh -O /root/see-apache-processlist.sh
Code:
chmod u+x /root/see-apache-processlist.sh
Code:
crontab -l | { cat; echo ‘* * * * * /root/see-mysql-processlist.sh > /root/mysql-logs/mysql-date +\%Y-\%m-\%d-\%H-\%M-\%S-cron.log 2>&1’; } | crontab -
Code:
crontab -l | { cat; echo ‘* * * * * /root/see-apache-processlist.sh > /root/mysql-logs/apache-date +\%Y-\%m-\%d-\%H-\%M-\%S-cron.html 2>&1’; } | crontab -
Code:
crontab -l | { cat; echo ‘5 4 * * * find /root/mysql-logs/ -mtime +1 -delete’; } | crontab -
Statistics: Posted by isscbta — Wed Nov 27, 2024 4:34 pm