Sponsored Content
Full Discussion: Filesystems GT 95%
Top Forums Shell Programming and Scripting Filesystems GT 95% Post 29117 by auswipe on Monday 30th of September 2002 01:19:34 PM
Old 09-30-2002
I had to search, but I had written this Perl script for automatic notification if the filesystem was greater than some arbirtary percentage:

Code:
#!/usr/bin/perl

# auswipe, 5 Apr 2002
# Tested under OpenBSD 2.9
# auswipe sez : "No guarantees!"

$upperLimit = 80;              # Upper Limit in % for a File System
$mailTarget = "joe\@blow.com"; # Target for the automatic e-mail message

open(STATS, "df -h\|grep '%'|") || die "$!";

my @fileStats = <STATS>;

foreach $entryLine (@fileStats) {
  chomp($entryLine);
  $entryLine =~ s/\s+/ /g;
  my @fsStats = split(/ /, $entryLine);
  $fsStats[4] =~ s/%//g;
  if ($fsStats[4] >= $upperLimit) {
    open(MAIL, "|mail -s \"FileSystem $fsStats[0] Getting Full!\" $mailTarget ") || die "Can't open m
ail!";
    select(MAIL);
    print << "EOF";

    The FileSystem $fsStats[0] is getting full.
    Currently, the file system is ${fsStats[4]}% full. The upper
    limit has been placed at ${upperLimit}%.

    Please attend to this matter.

    -auswipe

    This message has been created automatically. Please do not respond to this message.
EOF
    close(MAIL);

  };
};
close(STATS);

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Filesystems

my partner change the server's ip address and now i can't to mount the oracle's filesystem, what i do? i don't want to reinstall Unix. My unix is SCO UNIX 5.0.5 (9 Replies)
Discussion started by: marun
9 Replies

2. UNIX for Dummies Questions & Answers

mounted filesystems

If you have multiple hard drives and multiple mounted filesystems, how can you tell which filesystem resides on which disk? (3 Replies)
Discussion started by: jalburger
3 Replies

3. UNIX for Advanced & Expert Users

resize filesystems

Dear All We have HP9000 rp7400 Server running with hp-ux 11i. Our Disk storage has two volume groups and are allocated as follows: 1. /#vgdisplay -v --- Volume groups --- VG Name /dev/vg00 VG Write Access read/write VG Status available... (1 Reply)
Discussion started by: mhbd
1 Replies

4. AIX

Extending filesystems

Hi to all i want to increase the /usr size. but, it is mirrored on hdisk0 and hdisk1. i know that chfs will work, but i am not confident about mirroring. can anyone tell me the procedure. thanks (2 Replies)
Discussion started by: honeym210
2 Replies

5. AIX

Filesystems cmd

hi is that any command to find out which filesystems occupying more process in cpu utilisation (4 Replies)
Discussion started by: senmak
4 Replies

6. UNIX for Dummies Questions & Answers

mounted filesystems

how to check the record of previously mounted remote filesystems after the filesystems are unmounted .operating system is solaris 10 (0 Replies)
Discussion started by: ravijanjanam12
0 Replies

7. UNIX for Dummies Questions & Answers

Read only filesystems

hi guys suse 10.2 today some guys are adding some luns from a SAN so in order to add them I followed this command echo 1 > /sys/class/fc_host/host1/issue_lip echo "- - -" > /sys/class/scsi_host/host<number>/scan nice now after that I tried to create a folder in / but it won't let... (2 Replies)
Discussion started by: karlochacon
2 Replies

8. Shell Programming and Scripting

Filesystems using more than 75% capacity

i need to write a shell script for printing the list of filesystems whose disk utilization is more than 75%...i tried using df -h along with awk but cud'nt make the combination work.....:wall: when we do df -h then the filesystems which are using more than 75% capacity shud be printed according to... (11 Replies)
Discussion started by: xtatic
11 Replies

9. Shell Programming and Scripting

filesystems > 70%

I need a scrip that will show me the filesystems that are greater than 70%...but not sure how to filter using the df -h | grep Thank you for your help!! (6 Replies)
Discussion started by: eponcedeleonc
6 Replies

10. Solaris

Clustering filesystems

SunOS 5.10 Generic_142900-15 sun4u sparc SUNW,SPARC-Enterprise How can I tell if "clustering" is being used in my shop? I have to file systems that are identical. These filesystems are nfs mounted. But how can I tell if they are being kept in sync as a result of clustering or some other... (2 Replies)
Discussion started by: Harleyrci
2 Replies
VM(1)								      mgetty								     VM(1)

NAME
vm - VoiceModem is the program for handling the voice modem functionality from shell scripts ACTIONS
beep options [<frequency [<length in 0.001sec>]]> diagnostics options device name (e.g. ttyS2 dial options phone number help play options [<file names]+> record options file name shell options [<shell script [shell options]]> wait options [<time in seconds]> devicetest OPTIONS
-c n use compression type n -d n set i/o device -t, -m, -i, -e, -s, -H equals to -d <2,3,4,5,6,7> -l s set device string (e.g. -l ttyS2:ttyC0) -v verbose output -w use off / on hook signal from local handset to start and stop recording -x n set debug level -L n set maximum recording length in sec -P print first DTMF tone on stdout and exit -R read and print DTMF string on stdout and exit -S s set default shell for shell scripts (e.g. -S /bin/sh) -T n set silence timeout in 0.1sec -V n set silence threshold to <n> (0-100%%) SEE ALSO
vgetty(1) POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 30: You forgot a '=back' before '=head1' Around line 32: '=item' outside of any '=over' Around line 71: You forgot a '=back' before '=head1' perl v5.10.1 2010-04-04 VM(1)
All times are GMT -4. The time now is 10:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy