1.3-Monitor sub-script load.sh502.sh explanation

Source: Internet
Author: User

3. Sample Script load.sh


#! /bin/bash


# #Writen by aming##


load= ' uptime |awk-f ' average: ' {print $} ' |cut-d ', '-f1|sed ' s///g ' |cut-d.-f1 '

If [$load-gt] && [$send-eq "1"]

Then

echo "$addr ' date +%t ' load is $load" ... /log/load.tmp

/bin/bash. /mail/mail.sh $addr \_load $load. /log/load.tmp

Fi

echo "' Date +%t ' load is $load"





4.502.sh


#! /bin/bash

D= ' date-d '-1 min "+%h:%m"

C_502= ' grep: $d: $log |grep ' 502 ' |wc-l '

If [$c _502-gt] && [$send = = 1]; Then

echo "$addr $d 502 count is $c _502" ... /log/502.tmp

/bin/bash. /mail/mail.sh $addr \_502 $c _502. /log/502.tmp

Fi

echo "' Date +%t ' 502 $c _502"





5.disk.sh


#! /bin/bash


# #Writen by aming##


Rm-f. /log/disk.tmp

For R in ' Df-h |awk-f ' [%]+ ' {print $} ' |grep-v use '

Do

If [$r-gt] && [$send-eq "1"]

Then

echo "$addr ' date +%t ' disk useage is $r" >> /log/disk.tmp

Fi


If [-F. /LOG/DISK.TMP]

Then

Df-h >>. /log/disk.tmp

/bin/bash. /mail/mail.sh $addr \_disk $r. /log/disk.tmp

echo "' Date +%t ' disk useage is Nook"

Else

echo "' Date +%t ' disk useage is OK"

Fi




Problem: Df-h |awk-f ' [%]+ ' {print $ ' |grep-v use

awk Plus ' [%]+ ' What do you mean, why not remove spaces and +?


1.3-Monitor sub-script load.sh502.sh explanation

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.