1、查找相关日志文件 sudo /usr/sbin/lsof -c nginx 2> /dev/null | grep 'error.log' | grep -v 'delete' | awk '{print $NF}' | sort | uniq sudo /usr/sbin/lsof -c mysql 2> /dev/null | grep 'mysqld.err' | grep -v 'delete' | awk '{print $NF}' | sort | uniq sudo /usr/sbin/lsof 2> /dev/null | grep 'catalina.out' | grep -v 'delete' | awk '{print $NF}' | sort | uniq sudo /usr/sbin/lsof -c php-fpm 2> /dev/null | grep 'php-fpm.log' | grep -v 'delete' | awk '{print $NF}' | sort | uniq
2、zabbix
./zabbix_get -s 127.0.0.1 -p 10050 -k "system.cpu.load[all,avg15]"
python:
os.mknod() 方法 os.popen()