程序監控
程序監控 下面script可以監控給定的程序(利用process的識別單字),亦可以將結果透過MAIL發送出來 #!/bin/bash ################################################################################# # # Author: simon su # Create Date: 2008/6/6 # Object: To show the PS array processes and can also mail alert for losing processes. # Usage: # 1. "psMonitor-sync.sh": to show all process status # 2. "psMonitor-sync.sh -m xxx@ooo.com ": to mail the monitor result to xxx # ################################################################################# usage(){ echo Usage: echo 1. psMonitor-sync.sh: to show all process status \(JobName...\) echo 2. psMonitor-sync.sh -m xxx@ooo.com: to mail the monitor result to xxx. echo 3. psMonitor-sync.sh -d \"JobName XXXX OOOO\" [-m xxx@ooo.com]: to using specific keyword as the monitor key. } if [ -n "$1" ] && [ "$1" == "--help" ]; then usage exit 0 fi MAIL_TMP=/tmp/mail-psMonitor.txt if [ -n "$1...