![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Complex Event Processing and SOA: a ?beautiful thing?? | iBot | Complex Event Processing RSS News | 0 | 01-05-2008 12:00 AM |
| Apple OS X Leopard: A beautiful upgrade - InfoWorld | iBot | UNIX and Linux RSS News | 0 | 10-17-2007 09:00 AM |
| How to Run a shell script from Perl script in Parent shell? | hifake | Shell Programming and Scripting | 16 | 08-28-2007 09:42 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
like to share this beautiful shell script
Hello Everybody
I recently got this beautiful shell script from my friend. I like to share it with every body as I am bit new to shell scripting enviorment. I hope people in this site will like it. It is related to checking the filesystem threshold limit. After getting threshold limit of particular server filesystems . This script will show amount of filesystem full on the servers listed in a file called Delhosts. This script must be running continously 24*7 Any modification in this shell script is always welcome, to impove it kind regards to all /export/home/scripts->cat fsmonitor #!/bin/sh #Script to check the Delhi (IDC) Server status /usr/bin/clear while : do BASE=/export/home/scripts LOG=/export/home/scripts/log;export LOG PERC="%";export PERC SZ=94;export SZ echo "|---------------------------------------------------------------------------------------------|" echo "Time: `date +%H:%M:%S` \t\t\t Date: `date +%d/%m/%y`" #echo " \t \033[7m \033[5m FileSystem CHK of IDC Servers Greater Than $SZ% \033[0m \t " echo " \t FileSystem CHK of IDC Servers Greater Than \033[7m \033[5m $SZ% \033[0m \t " echo "|---------------------------------------------------------------------------------------------|" echo "Ip-Addr\t\t MountPoints > Threshold Limit\t\t %SIZE " echo "|---------------------------------------------------------------------------------------------|" #echo "|---------------------------------------------------------------------------------------------|" #echo "Ip-Addr\t\t MountPoints Greater than Threshold Limit\t\t %SIZE CronDaemon" #echo "|---------------------------------------------------------------------------------------------|" for i in `cat $BASE/Delhosts |awk '{print $1}'` do /usr/bin/rsh $i /usr/bin/df -k |egrep -v 'proc|fd|mntt|File|mir|ori'|awk '{print $5 $6}'|awk -F"%" '{print $1"#"$2}' >$LOG/size.out for j in `cat $LOG/size.out` do Z=`/usr/bin/rsh $i /usr/sbin/ifconfig -a|grep net|grep 10 |head -1 |awk '{print $2}'` #C=`/usr/bin/ps -ef|grep cron|grep -v grep |wc -l'` SZ=`echo $j |awk -F"#" '{print $1}'` MNT=`echo $j |awk -F"#" '{print $2}'` if [ $SZ -ge 94 ] then echo "$Z\t$MNT\t\t\t $SZ$PERC" #echo "$Z\t$MNT\t\t\t\t\t\t $SZ\t$C" # else # echo " " fi done done echo "\t\t\t\t\t\t\t Maintained by super user\n" sleep 5 clear done /export/home/scripts->cat Delhosts 10.1.0.84 cm01 10.1.0.85 cm02 10.1.0.87 htappcm03 10.1.0.88 htappcm04 |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|