It is currently Thu, 08 Jun 2023 13:15:14 GMT



 
Author Message
 Script to Monitor Specific FIel system and send alert
I'm looking for a script that can take as input a specific file or systems
and send an email idf the percent specified on the filesystem is reached .

Any guidance or help will be appreciated



 Sun, 25 Jul 2004 09:50:44 GMT   
 Script to Monitor Specific FIel system and send alert

Take 2 hours to read man pages of sh (for control structure like if then
else), df, cut, (or sed), mailx.  Then another hour to write a simple
script (could be less than 5 lines - but if you have to do with more,
OK).  It's much more awarding than getting the script.  Super if you
spend another two hours trying to improve the script.

Yuan Liu



 Sun, 25 Jul 2004 14:33:02 GMT   
 Script to Monitor Specific FIel system and send alert

Hi,  here is a script that will perform an action if a filesystem goes
over
a specified capacity.  Just change the echo line to whatever action
you want to take:

#!/bin/ksh

for SLICE in `df -k | egrep -v Filesystem | nawk '{print $6}'` ; do
 USED=`df -k $SLICE | tail -1 | nawk '{print int($5)}'`
# If capacity is over 85%, do something
 if [ "$USED" -gt 85 ] ; then
  echo "The ${SLICE} partition is over ${USED}% full."
 fi
done

Hope this gets you started

jim



 Mon, 26 Jul 2004 08:54:28 GMT   
 
   [ 3 post ] 

Similar Threads

1. NMIS (Network Management Information System); Sending Alerts

2. System Messages or Alerts sent as mail

3. System monitoring and SNMP traps/alerts

4. Needfull Things: after a script that monitors a sap log file for specific words

5. Needfull Things: script that monitors a sap log file for specific words

6. Where does the system restricts fiel size?

7. Sending IPv6 HopByHop extension header with Router Alert

8. self-diagnosing computers send beeper alerts to staff

9. Sending IPv6 HopByHop extension header with Router Alert

10. Send Alert to Client Screen ?


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software