Operating System - HP-UX
1832275 Members
1650 Online
110041 Solutions
New Discussion

Do you have script to do this?

 
Silver_1
Regular Advisor

Do you have script to do this?

Hi,

I have several servers and also have a adminstration server from where i can run the SSH to all the servers.

My aim is to make a script that will go and check all the filesystems in the ROOT vg and send me a mail saying that this server's the following filesystems are at "this" percentage like.

Nile's opt is 92%
Nile's var is 85%
Hudson's opt is 88% like that.

Do you any thought on this.

Tx,
Nair
6 REPLIES 6
Patrick Wallek
Honored Contributor

Re: Do you have script to do this?

How about something like:

#!/usr/bin/sh

for i in server1 server2 server3 server4
do
echo "${i} VG00 filesystems:"
ssh ${i} bdf | grep vg00
echo ""
echo ""
done
Isralyn Manalac_1
Regular Advisor

Re: Do you have script to do this?

Hi Nair,

Please see attached. There are several others which I got from ITRC as well.

Regards,

Isralyn

P.S. Dunno how to do multiple attachments, though so I'll send you another one.
Isralyn Manalac_1
Regular Advisor

Re: Do you have script to do this?

and another...
Isralyn Manalac_1
Regular Advisor

Re: Do you have script to do this?

and another one...
Nguyen Anh Tien
Honored Contributor

Re: Do you have script to do this?

I think you need this doc for further administration task
http://www.cs.virginia.edu/~an4m/books/oreilly/unix_bookshelf/sedawk/
HTH
tienna
HP is simple
Cem Tugrul
Esteemed Contributor

Re: Do you have script to do this?

i also got it from itrc but do not remember
the authır but i am still using;

function check_bdf {
bdf -l |grep -v cdrom | awk '$0 !~ /^F/' > /tmp/bdf_out
awk '{if (NF!=1){
if (NF==5){
print $4"\t" $5"\t"
}
else{
print $5"\t\t" $6"\t"
}
}}' < /tmp/bdf_out
rm /tmp/bdf_out
}

check_bdf | sed 's/'%'/''/' > /tmp/bdf_info

function panic {
while read percent dir ### If file system is >= 90% - email to addresses below
do
if [[ $percent -ge 95 ]] ; then
mailx -s "File system full-`hostname`:$dir is at $percent%" mailaddress < /dev/null
fi
done
} < /tmp/bdf_info

panic
rm /tmp/bdf_inf
Our greatest duty in this life is to help others. And please, if you can't