Sponsored Content
Full Discussion: Filesystem ??
Top Forums UNIX for Dummies Questions & Answers Filesystem ?? Post 19098 by auswipe on Friday 5th of April 2002 02:34:03 PM
Old 04-05-2002
If you call this routine with a cronjob, it should do what you want.

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);

Customer the target e-mail address accordingly (please note the \@ for @) and give it a try. If you have any problems, please let me know.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

io by filesystem???

I'm cross-posting from the "Unix for Dummies Q&A" forum as I didn't get any response there. I'm wanting to drill down one level deeper from iostat. For example, for the following iostat output, I'd like to now understand the io for hdisk2 by filesystem: Disks: % tm_act Kbps tps Kb_read... (1 Reply)
Discussion started by: priceb
1 Replies

2. UNIX for Dummies Questions & Answers

io by filesystem??

I'm wanting to drill down one level deeper that iostat. For example, for the following iostat output, I'd like to now understand the io for hdisk2 by filesystem: Disks: % tm_act Kbps tps Kb_read Kb_wrtn hdisk3 4.7 1792.0 80.7 0 5376 hdisk1... (2 Replies)
Discussion started by: priceb
2 Replies

3. UNIX for Dummies Questions & Answers

filesystem

hi, had a basic question. Inspite of deletion files from a filesystem(belonging to non-rootvg), the filesystem says 99% full. can someone suggest something? except reboot could someone tell me how to proceed? thanks (1 Reply)
Discussion started by: karthikosu
1 Replies

4. UNIX for Dummies Questions & Answers

How to know about filesystem

HI Gurus, I would like to know how can i know the dates when the filesystem was added to the server. Thanks Shaan (3 Replies)
Discussion started by: shaan_dmp
3 Replies

5. UNIX for Dummies Questions & Answers

filesystem

i am about to install oracle on my solaris x86-64 This installation require 4Gb space and i qish to do this installation on the directory /u01/app/oracle The following was my approch mkdir -p /u01/app/oracle i then use the command below to see if there is enough space # df -h... (6 Replies)
Discussion started by: seyiisq
6 Replies

6. Solaris

filesystem

partition> print Current partition table (original): Total disk cylinders available: 15934 + 2 (reserved cylinders) Part Tag Flag Cylinders Size Blocks 0 root wm 3 - 959 14.66GB (957/0/0) 30748410 1 swap wu 960 - ... (2 Replies)
Discussion started by: seyiisq
2 Replies

7. Solaris

Filesystem - error when extend the filesystem

Hi all, currently , my root filesystem already reach 90 ++% I already add more cylinder in the root partition as below Part Tag Flag Cylinders Size Blocks 0 root wm 67 - 5086 38.46GB (5020/0/0) 80646300 1 swap wu 1 - ... (11 Replies)
Discussion started by: SmartAntz
11 Replies

8. UNIX for Dummies Questions & Answers

hwo to find shared filesystem and local filesystem in AIX

Hi, I wanted to find out that in my database server which filesystems are shared storage and which filesystems are local. Like when I use df -k, it shows "filesystem" and "mounted on" but I want to know which one is shared and which one is local. Please tell me the commands which I can run... (2 Replies)
Discussion started by: kamranjalal
2 Replies

9. Solaris

Solaris Filesystem vs. Windows FileSystem

Hi guys! Could you tell me what's the difference of filesystem of Solaris to filesystem of Windows? I need to compare both. I have read some over the net but it's so much technical. Could you explain it in a more simpler term? I am new to Solaris. Hope you help me guys. Thanks! (4 Replies)
Discussion started by: arah
4 Replies

10. AIX

Mount Filesystem in AIX Unable to read /etc/filesystem

Dear all, We are facing prolem when we are going to mount AIX filesystem, the system returned the following error 0506-307The AFopen call failed : A file or directory in the path name does not exist. But when we ls filesystems in the /etc/ directory it show -rw-r--r-- 0 root ... (2 Replies)
Discussion started by: m_raheelahmed
2 Replies
Sys::Filesystem::Aix(3pm)				User Contributed Perl Documentation				 Sys::Filesystem::Aix(3pm)

NAME
Sys::Filesystem::Aix - Return AIX filesystem information to Sys::Filesystem SYNOPSIS
See Sys::Filesystem. INHERITANCE
Sys::Filesystem::Aix ISA UNIVERSAL METHODS
version () Return the version of the (sub)module. ATTRIBUTES
The following is a list of filesystem properties which may be queried as methods through the parent Sys::Filesystem object. account Used by the dodisk command to determine the filesystems to be processed by the accounting system. boot Used by the mkfs command to initialize the boot block of a new filesystem. check Used by the fsck command to determine the default filesystems to be checked. dev Identifies, for local mounts, either the block special file where the filesystem resides or the file or directory to be mounted. free This value can be either true or false. (Obsolete and ignored). mount Used by the mount command to determine whether this file system should be mounted by default. nodename Used by the mount command to determine which node contains the remote filesystem. size Used by the mkfs command for reference and to build the file system. type Used to group related mounts. vfs Specifies the type of mount. For example, vfs=nfs specifies the virtual filesystem being mounted is an NFS filesystem. vol Used by the mkfs command when initializing the label on a new filesystem. The value is a volume or pack label using a maximum of 6 characters. log The LVName must be the full path name of the filesystem logging logical volume name to which log data is written as this file system is modified. This is only valid for journaled filesystems. SEE ALSO
Sys::Filesystem Example /etc/filesystems * @(#)filesystems @(#)29 1.22 src/bos/etc/filesystems/filesystems, cmdfs, bos530 9/8/00 13:57:45 * IBM_PROLOG_BEGIN_TAG * This is an automatically generated prolog. * * <snip> * * This version of /etc/filesystems assumes that only the root file system * is created and ready. As new file systems are added, change the check, * mount, free, log, vol and vfs entries for the appropriate stanza. /: dev = /dev/hd4 vol = "root" mount = automatic check = false free = true vfs = jfs2 log = /dev/hd8 type = bootfs /proc: dev = /proc vol = "/proc" mount = true check = false free = false vfs = procfs /scratch: dev = /dev/fslv02 vfs = jfs2 log = INLINE mount = true account = false Example /usr/sbin/mount output node mounted mounted over vfs date options -------- --------------- --------------- ------ ------------ --------------- /dev/hd4 / jfs2 Mar 24 12:14 rw,log=/dev/hd8 /proc /proc procfs Mar 24 12:15 rw /dev/fslv02 /scratch jfs2 Mar 24 12:15 rw,log=INLINE filesystems(4) Manpage includes all known options, describes the format and comment char's. VERSION
$Id: Aix.pm 128 2010-05-12 13:16:44Z trevor $ AUTHOR
Nicola Worthington <nicolaw@cpan.org> - <http://perlgirl.org.uk> Jens Rehsack <rehsack@cpan.org> - <http://www.rehsack.de/> COPYRIGHT
Copyright 2004,2005,2006 Nicola Worthington. Copyright 2008-2010 Jens Rehsack. This software is licensed under The Apache Software License, Version 2.0. <http://www.apache.org/licenses/LICENSE-2.0> perl v5.10.1 2010-05-18 Sys::Filesystem::Aix(3pm)
All times are GMT -4. The time now is 01:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy