Please give detailed implementation methods, thank you,
CodePudding user response:
Use ps - aux can get all the processes of CPU information (column 5), the process of using awk will you want to monitor the fifth column values, and then make judgment to the value, more than 80% is executed systemctl restart mysqld. ServiceTime this script can use crontab establish execution, also using a loop in a script, use of sleep time interval to achieve timing control, specific code written by yourself, or simple,
CodePudding user response:
Can include a zabbix, action set in a remote command invocation (trigger alarm, restart the database)CodePudding user response:
Include a sysstat, using SAR + shell