Blogs Classifieds Downloads FlashChat Gallery Googlemap Invite Friends Links Projects Reviews Wiki
 


Welcome to the pSeries Tech Forums, our free peer-based support site for administrators, engineers and architects working with IBM pSeries servers and software.

You are currently viewing our site as a guest which gives you limited access to view most discussions, articles, tutorials and access our other free features. By joining our community you will be able to collaborate with administrators, engineers and architects charged with designing, delivering or maintaining IBM pSeries server environments.

Founded by a recognized IBM pSeries consultant and IBM Redbook author, pSeries Tech Forums was developed with the single mission of bringing IBM pSeries professionals together into a single self-help community.

Registration is fast, simple and absolutely free to all IT professionals with responsibility for or interest in IBM pSeries servers. We invite you to join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

Our Sponsors
Want to advertise?  


Reply
 
LinkBack Thread Tools
  #1  
Old July 28th, 2008
adeel123's Avatar
adeel123 Offline
Member
 
Join Date: February 2008
Posts: 30
need script for file system

hi,

problem is tht i m working in a LPAR environment we have almost 30,40 Lpars . watching all of them is quite a problem for me so i just wanted from you guys to help me in making a script or any thing through which when ever any file system size increases it will automatically mailed me an alert.
like for example I want a script which generate mail when either /usr is > then 70% , /home is >90% , /xyz is > 85%. and so on depending on the file system . if they crosses such limit i want tht the LPAR send me an email tht /usr is.... % full.

kindly help me in this regard b/c i dont know scripting at all.

Ross kindly help me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old July 28th, 2008
ross.mather's Avatar
ross.mather Offline
Senior Member
 
Join Date: January 2007
Location: Nomadic in the UK
Posts: 394
Re: need script for file system

Sorry Adel, I can't help you. The functionality you are looking for it usually provided by such apps as Tivoli Enterprise Console - which judging by whatyou are asking for is exactly what you (or your employer) should be investing in.

There are of course other packages that will do the same thing, such as BMC Patrol.

I will be completely honest here and tell you that when you reach 30-40 LPARS you need to move from "Mom & Pop" solutions with scripts, to enterprise level tools. Anything else and you will spend your life just keeping things running.

If you are determined to go down this route then you'll need to learn shell scripting - even if its just to maintain the scripts others give you. Look around the web, and if possible get on a training course - we all know that they are expensive but they will pay off in the long term......

This may help you with scripting:
Korn shell scripting&
__________________
Ross Mather, IBM AIX IT Specialist.
That said anything I say here is my own opinion and not anything that you can ever hold against IBM.
Ohhh and don't forget that I make mistakes too....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old July 28th, 2008
adeel123's Avatar
adeel123 Offline
Member
 
Join Date: February 2008
Posts: 30
Re: need script for file system

thanks Rss. but can u plz help me for only 1 line syntax of scripting rest ill do it by my self.
wht is the syntax if i want a mail if /usr>85%.
like in C language we use if and else statments. how can we do this in AIX . does > sign works in AIX ????
give me a line step ill b thankful to u
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old July 29th, 2008
seth's Avatar
seth Offline
Member
 
Join Date: June 2008
Posts: 70
Re: need script for file system

Well you need to write some kind of process which checks the state (df -k) regularly, do a grep and awk to get the needed field and then compare it to your fixed value (85%) with a while loop. I recommend to let this script be called by cron every or so (in other case you need to write a more complex code). Once the event is triggered you write a automated email with mailx -s "Subject" emailadress < "Textmessage".
Is this so hard to acomplish?
We are here to help each other not to do the work for others...

seth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old July 29th, 2008
ross.mather's Avatar
ross.mather Offline
Senior Member
 
Join Date: January 2007
Location: Nomadic in the UK
Posts: 394
Re: need script for file system

Sorry Adel, I'll help people with specific problems, but I'm not here to teach you the asic tools of the trade. The questions you had about scripting are answewred in the link I gave you or else on various other parts of the net.

I will not write scripts for people as they may well then expect ME to maintain them. I'll do that but only when you pay me :-) ....
__________________
Ross Mather, IBM AIX IT Specialist.
That said anything I say here is my own opinion and not anything that you can ever hold against IBM.
Ohhh and don't forget that I make mistakes too....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old July 29th, 2008
pSerious's Avatar
pSerious Offline
pSerious
 
Join Date: May 2008
Posts: 20
Re: need script for file system

Adeel123

You could try freeware such as Big Brother which is very good for monitoring and very customisable and has usefull alert utilty when thresholds are being breached, via email or SMS.

Regards

pSerious.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old August 13th, 2008
alexisl's Avatar
alexisl Offline
Senior Member
 
Join Date: June 2006
Posts: 147
Re: need script for file system

This is what I use, it was written by Cem Tugrul. I run it once a day, you could run it more oftain.

#!/usr/bin/ksh
################################################## ###################
# Check each disk space.
# If it's 85% or over, email somebody.
#
#
# Cem Tugrul 3980220/1480 Date:09-11-2004
#
# This file is used with crontab entry:
#
# # Check disk space every 15 min.
# 0,15,30,45 * * * * /usr/local/bin/chk_dsk_space > /dev/null 2>&1
################################################## ###################
exec 1>/tmp/chk_dsk_space.trace.log 2>&1
set -o xtrace
function check_bdf {
df -gP|grep -v cdrom |grep -v proc| awk '$0 !~ /^F/'|grep -v ytl > /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
do
if [[ $percent -ge 85 ]] ; then
cd /
df -g $dir > /tmp/df.out
mailx -s "File system full-`hostname`:$dir is at $percent%" larry.alexis@tridenttech.edu < /tmp/df
.out
fi
done
} < /tmp/bdf_info
panic
rm /tmp/bdf_info
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks

Tags
automatically, file, respond, script, system

These are the 100 most searched terms
Search Cloud
0042-001 0042-001 nim 0513-001 the system resource controller daemon is not active 0513-001 the system resource controller daemon is not active. 0514-061 0514-061 cannot find a child device 0514-061 cannot find a child device. 0516-787 0516-787 extendlv 0516-787 extendlv: maximum allocation for logical volume 110000ac aa00e1f3 aio aix aix aio aix freeware aixif_arp_dup_addr b150f22a b181fb53 ba010004 c1001020 d133c002 dacnone dcb47997 dlpar fcp_array_err6 fget_config gnu tar aix gsclvmd gtar aix hi yall hmc root password hmc vmware hscl05db ibm p6 ibm p6 520 libpopt aix libpopt.a libpopt.a(libpopt.so.0) is needed by rsync-2.6.2-1 migratelv mksysb navisphere agent nim server pseries pseriestech rsync aix sc_disk_err4 scan_error_chrp vio server websm xhost file ... powered by Simple Search Cloud


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Powered by vbWiki Pro 1.3 RC5. Copyright ©2006-2007, NuHit, LLC

vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48