Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Scripting for Disk usage

    Could somebody kind of walk me through the following? What areas would one study to get a handle on what the below requirements are?

    This is for disk usage.

    I have had one course in Linux/Unix. I have had C programming.
    Is Bash ok to use?

    Create a script that sends an email message to the user specified on the command line if any of the filesystems are at more than 70% of capacity. The script should not process special filesystems as /proc . It should only process filesystems which are either locally mounted or are mounted via NFS.
    An individual email should be sent for each filesystem which is at the warning level. There should be a subject on the email with a message "Warning: Filesystem <put filesystem the>here is at <X>% of capacity" If the filesystem is at greater than 90% of capacity, the "Warning" should be changed to "Critical Warning".

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Bash is fine as a scripting language to do this, and you can use a tool such as df to monitor the usage of your file systems. Then you need to parse that output and trigger the appropriate actions (email, etc) when trigger events occur. I presume this is a school project? If so, then according to the terms of use for these forums, this is about as much help as I can give you. If you post your efforts, scripts, etc here, then we may be able to help you fix specific problems.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts