UrbanPro
true

Learn Unix Shell Scripting Training from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Unix (Automation for Disk space Alert on Server using Shell Script)

Umesh Prasad
03/03/2021 0 0

disk_check_advance.sh
#!/bin/ksh
var=`df -a|grep home|tail -1|awk '{print $3}'`
HOST=`hostname`
echo $var1
if [ $var -le 3000000 ]; then
df -h|grep home >data
# du -s /home/* 2>/dev/null| sort -rn |head -20>>data
# cat data|
# mail -s "Alert: Almost out of disk space on $HOST" umesh.prasad@fedex.com
while read line; do

ED=`echo $line|cut -d "/" -f3`
ID=`echo $line|cut -d "/" -f3|cut -c1`

if [ "$ID" == "f" ]
then

ID1=`echo $ED|cut -c2-`
`echo $line | mail -s "Alert:Almost out of Disk space on $HOST" $ID1@fedex.com`
else
ID1=`echo $ED|cut -c3-`
`echo $line | mail -s "Alert:Almost out of Disk space on $HOST" $ID1@fedex.com`
fi
done < data
fi

0 Dislike
Follow 2

Please Enter a comment

Submit

Other Lessons for You

Internal and external commands Linux
Internal and external commands cmd: help To see all available internal commands cmd: type <your cmd> To check your cmd is internal or external.

Ramesh Gundlapalli | 07/11/2019

1 0
0

Basics Of Unix
What is Unix ? The Unix operating system is a set of programs that act as a link between the computer and the user. The computer programs that allocate the system resources and coordinate all the details...

Dinesh Kumar G. | 23/05/2017

0 0
0

How to check disk group size veritas symantec and volume size script?
#!/usr/bin/kshvxprint | grep Disk |awk {'print $3'} | grep -v rootdg >/var/tmp/dgnameprintf "\n......................................................................\n"printf "Server Name : "hostnamecat...

Ravindra Babu | 18/02/2017

0 0
0

Amazon written test for experience
For the below written test answer I defined with "*" at the end of the options NULL is the same as 0 for integer the same as blank for character * the same as 0 for integer and blank for character the...

Suresh | 13/02/2017

0 0
0

Unix Shell Scripting
UNIX Shell Scripting Unix – An Introduction:- Features & Advantages Unix Vs Linux Unix Architecture File Management Comparative study between Windows & Unix Vi Editor Unix –...

Saravanan B. | 08/12/2016

0 0
0

Looking for Unix Shell Scripting Training classes?

Learn from Best Tutors on UrbanPro.

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
Sponsored
X

Looking for Unix Shell Scripting Training Classes?

The best tutors for Unix Shell Scripting Training Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Unix Shell Scripting Training with the Best Tutors

The best Tutors for Unix Shell Scripting Training Classes are on UrbanPro

Book a Free Demo

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more