![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Disk Usage | harikamamidala | Shell Programming and Scripting | 4 | 08-16-2007 02:22 PM |
| How to calculate Memory and CPU Usage on AIX | asutoshch | Shell Programming and Scripting | 0 | 07-31-2007 08:28 AM |
| disk usage | rrs | Shell Programming and Scripting | 1 | 04-13-2007 03:48 AM |
| Disk Usage | lewisoco | UNIX for Dummies Questions & Answers | 3 | 05-09-2006 08:44 PM |
| Application servers, proper usage | jonwillog | UNIX for Dummies Questions & Answers | 1 | 08-22-2005 09:19 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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. |
|
||||
|
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
|
|
||||
|
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. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|