Server auto-Send mail monitor FreeSWITCH process

Source: Internet
Author: User
Tags freeswitch


vim/etc/mail.rc AddSet from=******@163.com smtp=smtp://smtp.163.com:25set smtp-auth-user=******@163.com smtp-auth-password=****** smtp-auth=loginVim check.sh#!/bin/bashsource. Bash_profilepip=101.251.251.92ip= '/sbin/ifconfig eth0 | grep "inet addr" | awk ' {print $} ' | awk-f: ' {print $} 'i= ' ps-ef | grep freeswitch | grep-v grep | wc-l 'date= ' Date 'cpu= ' top-b-N 1 | grep CPU | awk ' {print $} ' | cut-f 1-d "%" 'ping= ' ping-c 3 $pip |awk ' nr==7 {print $4} '
if [$ping-eq 0] Thentext2= "$pip status grashed"Elsetext2= "$pip status Ready"fiif [$i-lt 1] Thentext= ' Freeswitch is down 'echo "Server:" $ip $ ' \ n ' $date $ ' \ n ' "CPU used:" $cpu $ ' \ n ' "$text 2" $ ' \ n ' "$text" | mail-s "$ip Abnormal"-a/home/freeswit Ch/log/freeswitch.log ****** @qq. com#else#text = ' Freeswitch is running ... '#echo "Server:" $ip $ ' \ n ' $date $ ' \ n ' "CPU used:" $cpu $ ' \ n ' "$text 2" $ ' \ n ' "$text" | mail-s "$ip Normal" ****** @qq. com fi
set 8-23 points per day to automatically execute scripts to send messages every hourcrontab-e0 8-23 * * */root/check.sh

Server auto-Send mail monitor FreeSWITCH process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.