[SunHELP] filesystem monitor script

Lund, Dennis sunhelp at sunhelp.org
Mon Apr 2 13:40:34 CDT 2001


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C0BBA4.67322D8A
Content-Type: text/plain

Try this:

#!/bin/ksh
# This script will check each UFS filesystem to see if it is over 
# 75% full.
#
for i in `df -n | awk '{print $1}'`
do
   if [ `df -k $i | tail -1 | awk '{print $5}' | sed s/\%//` -gt 75 ]
   then
      print "$i is over 75% full.  Please check the filesystem."
   fi
done

You can add "mailx" to the script to have it send an email to the sysadmin
if a filesystem is over 75%.

Dennis L. Lund
-----Original Message-----
From: walubank at hotmail.com [mailto:walubank at hotmail.com]
Sent: Monday, April 02, 2001 12:06 PM
To: sunhelp at sunhelp.org
Subject: [SunHELP] filesystem monitor script


Can anybody get me a monitoring script that will report when the filesystem 
is over 75%
Thanks
Wally
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

_______________________________________________
SunHELP maillist  -  SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp


     - - - - - - -  Appended by Scientific-Atlanta, Inc.  - - - - - - -  
This e-mail and any attachments may contain information which is
confidential, proprietary, privileged or otherwise protected by law. The
information is solely intended for the named addressee (or a person
responsible for delivering it to the addressee). If you are not the intended
recipient of this message, you are not authorized to read, print, retain,
copy or disseminate this message or any part of it. If you have received
this e-mail in error, please notify the sender immediately by return e-mail
and delete it from your computer. 



------_=_NextPart_001_01C0BBA4.67322D8A
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>RE: [SunHELP] filesystem monitor script</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Try this:</FONT>
</P>

<P><FONT SIZE=3D2>#!/bin/ksh</FONT>
<BR><FONT SIZE=3D2># This script will check each UFS filesystem to see =
if it is over </FONT>
<BR><FONT SIZE=3D2># 75% full.</FONT>
<BR><FONT SIZE=3D2>#</FONT>
<BR><FONT SIZE=3D2>for i in `df -n | awk '{print $1}'`</FONT>
<BR><FONT SIZE=3D2>do</FONT>
<BR><FONT SIZE=3D2>   if [ `df -k $i | tail -1 | awk '{print =
$5}' | sed s/\%//` -gt 75 ]</FONT>
<BR><FONT SIZE=3D2>   then</FONT>
<BR><FONT SIZE=3D2>      print "$i is =
over 75% full.  Please check the filesystem."</FONT>
<BR><FONT SIZE=3D2>   fi</FONT>
<BR><FONT SIZE=3D2>done</FONT>
</P>

<P><FONT SIZE=3D2>You can add "mailx" to the script to have =
it send an email to the sysadmin</FONT>
<BR><FONT SIZE=3D2>if a filesystem is over 75%.</FONT>
</P>

<P><FONT SIZE=3D2>Dennis L. Lund</FONT>
<BR><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: walubank at hotmail.com [<A =
HREF=3D"mailto:walubank at hotmail.com">mailto:walubank at hotmail.com</A>]</F=
ONT>
<BR><FONT SIZE=3D2>Sent: Monday, April 02, 2001 12:06 PM</FONT>
<BR><FONT SIZE=3D2>To: sunhelp at sunhelp.org</FONT>
<BR><FONT SIZE=3D2>Subject: [SunHELP] filesystem monitor script</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Can anybody get me a monitoring script that will =
report when the filesystem </FONT>
<BR><FONT SIZE=3D2>is over 75%</FONT>
<BR><FONT SIZE=3D2>Thanks</FONT>
<BR><FONT SIZE=3D2>Wally</FONT>
<BR><FONT =
SIZE=3D2>_______________________________________________________________=
__</FONT>
<BR><FONT SIZE=3D2>Get your FREE download of MSN Explorer at <A =
HREF=3D"http://explorer.msn.com" =
TARGET=3D"_blank">http://explorer.msn.com</A></FONT>
</P>

<P><FONT =
SIZE=3D2>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>SunHELP maillist  -  =
SunHELP at sunhelp.org</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://www.sunhelp.org/mailman/listinfo/sunhelp" =
TARGET=3D"_blank">http://www.sunhelp.org/mailman/listinfo/sunhelp</A></F=
ONT>
</P>
<BR>

<P>     - - - - - - -  Appended by =
Scientific-Atlanta, Inc.  - - - - - - - =20
<BR>This e-mail and any attachments may contain information which is =
confidential, proprietary, privileged or otherwise protected by law. =
The information is solely intended for the named addressee (or a person =
responsible for delivering it to the addressee). If you are not the =
intended recipient of this message, you are not authorized to read, =
print, retain, copy or disseminate this message or any part of it. If =
you have received this e-mail in error, please notify the sender =
immediately by return e-mail and delete it from your computer. </P>
<BR>

</BODY>
</HTML>
------_=_NextPart_001_01C0BBA4.67322D8A--



More information about the SunHELP mailing list