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