Shell script is program monitoring

Monitor the program of this machine and send alarm emails abnormally

#!/bin/bash

# Native IP
HOST=‘59.110.69.217’

# Mail service address
URL=‘http://101.201.150.205:9527’

# Mail receiving end; separated by spaces, not commas
MAILS=(‘[email protected]****.net‘ ‘[email protected]***.net’ ‘[email protected]***.net’)

# Monitoring process
PROCESS=(‘callout1‘ ‘callout2‘ ‘callout4’)



# Splicing receiver
data=‘‘
for mail in ${MAILS[@]};
    do
       data="$data""receivers=$mail&"
    done




# implement
for proc in ${PROCESS[@]};
    do
        echo ‘>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>‘
        result=`ps -ef | grep $proc | grep -v ‘grep‘`
        echo -e "grep $proc process result 
$result"

        if ["$result" = ‘‘ ]; then
             echo -e "$proc process is dead"
             wget --post-data="$data""content=HOST:$HOST PRODESS:$proc MESSAGE:monitor process is not alive&title=process monitor error!" $URL
             echo -e "$proc send email
"
        else
             echo -e "$proc process is alive
"
        fi
     done

#!/bin/bash

# Native IP
HOST=‘59.110.69.217’

# Mail service address
URL=‘http://101.201.150.205:9527’

# Mail receiving end; separated by spaces, not commas
MAILS=(‘[email protected]****.net‘ ‘[email protected]***.net’ ‘[email protected]***.net’)

# Monitoring process
PROCESS=(‘callout1‘ ‘callout2‘ ‘callout4’)



# Splicing receiver
data=‘‘
for mail in ${MAILS[@]};
    do
       data="$data""receivers=$mail&"
    done




# implement
for proc in ${PROCESS[@]};
    do
        echo ‘>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>‘
        result=`ps -ef | grep $proc | grep -v ‘grep‘`
        echo -e "grep $proc process result 
$result"

        if ["$result" = ‘‘ ]; then
             echo -e "$proc process is dead"
             wget --post-data="$data""content=HOST:$HOST PRODESS:$proc MESSAGE:monitor process is not alive&title=process monitor error!" $URL
             echo -e "$proc send email
"
        else
             echo -e "$proc process is alive
"
        fi
     done

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5529 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.