Disk Usage I need to create a script sends an email message to the user specified on
Disk Usage
I need to create a script 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". I may use any scripting language including /bin/sh, ksh, bash, awk or perl but not C-Shell. This will be done on my own Linux/UNIX system. Thank you, Theo |
Have you enabled quotas?
They already give a user messages about being over a soft limit, and then again over a hard limit (at which point they can't create new files). |
Hi theondr,
I got something that does kind of exactly what you are asking for, you might want to check it out. I did this some time ago, might not be the most concise script i wrote but it is still on duty now, which makes me think it is not too bad... Check this page Let me know (here or through the blog) how it goes, i may have an updated version of this script at work, if you are interested in getting your hands on. Regards, Pier. |
These will help you with bash
http://rute.2038bug.com/index.html.gz http://tldp.org/LDP/Bash-Beginners-G...tml/index.html http://www.tldp.org/LDP/abs/html/ |
Quote:
I suggest you to use NAGIOS. This is a very powerful opensource software. With this you can monitor one server to thousands of servers... |
and I'm gonna "suggest" you NOT install any software for something you can write yourself.
http://en.wikipedia.org/wiki/Snmp Linux SNMP OIDs for CPU,Memory and Disk Statistics Net-SNMP tutorial |
Agree but ...
Quote:
|
All times are GMT -5. The time now is 05:22 PM. |