![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Disk Usage | harikamamidala | Shell Programming and Scripting | 4 | 08-16-2007 11:22 AM |
| How to calculate Memory and CPU Usage on AIX | asutoshch | Shell Programming and Scripting | 0 | 07-31-2007 05:28 AM |
| disk usage | rrs | Shell Programming and Scripting | 1 | 04-13-2007 12:48 AM |
| Disk Usage | lewisoco | UNIX for Dummies Questions & Answers | 3 | 05-09-2006 05:44 PM |
| Application servers, proper usage | jonwillog | UNIX for Dummies Questions & Answers | 1 | 08-22-2005 06:19 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Calculate disk usage in different servers
Hello,
I'm writing a script to monitor different filesystems in multiple servers. And depending on the % free, my script will send an Alert email if % free is less than threshold. I want to keep a input_feed_file which would have "server,filesystem". If I run a script a host 'a', then I can find the file systems usage on that server. But I'm intrested to watch few more filesystems that are in host 'b'. How do I find the disk usage from my script, of these filesystems which aren't on one single server. I'm not inclined to use any monitoring tools, so I'm trying to accomplish this in one single Korn shell script. ------------------------------------------- Example of Input file: host_a,/export/appl/filesystem_a/ host_a,/export/appl/filesystem_b/ host_b,/export/appl/filesystem_y/ . . . -------------------------------------------- Thanks in advance. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
short pseudo-code sketch:
Code:
for line in input_file
do
server=split line ...
dir = split line ...
output=`ssh server du -m dir`
usage=split output ...
if [ usage > treshold]
then
do something
fi
done
|
|
#3
|
|||
|
|||
|
Quote:
For now I'm getting the file system usage by connecting with ssh, but the downside is, I had to get ssh keys setup on all the hosts for my app id. |
|
#4
|
|||
|
|||
|
use nagios
or invoke df -H from all server. Regards, Bash |
|||
| Google The UNIX and Linux Forums |