Shell 1 that monitors PHP processes and Error Log checks: When asynchronous processing is performed, it is inevitable that the program will be suspended. This shell can be used to listen to PHP script processes processed by the queue, if the process is dead, it will restart. Www.2cto.com Python code #! /Bin/bash process = 'ps-ef | grep'/www/project/handle. php' | grep-v grep | wc-l 'if [$ process-eq 0]; then/usr/bin/php/www/project/handle. php # You can also record the logs here to learn about failures. fi 2: in actual development, interface interaction between layers or systems is inevitable, however, some core interaction logs are essential. Once an exception occurs during the interaction process, developers must be notified quickly. Python code #! /Bin/sh now = 'date + % Y % m % d % H' # logPath =/data/log/# log directory thisIp = 'ifconfig- a | grep inet | grep-v 127.0.0.1 | grep-v inet6 | head-n1 | awk '{print $2}' | tr-d "addr: "'# If the program is published to multiple machines, retrieve the IP address of the current machine # errorLogFile = 'Find $ logPath-name $ errorBegin "*. log "'# if you are looking for all error logs, use this fileName = $ now" _ test_error.log "# if [-f" $ logPath $ fileName" ]; then echo $ thisIp "server have error log;-logpath: "$ logPath $ fileName | mail-s server error log user@domain.com # send mail to related personnel # if there is a notification mechanism already implemented, execute this program here to fi