Question
Create a shell script on cyberserver.uml.edu, fs_usage_warning that sends email to users when a file system is above certain disk usage percentage. You would check
Create a shell script on cyberserver.uml.edu, fs_usage_warning that sends email to users when a file system is above certain disk usage percentage. You would check against the Use% of the df command. fs_usage_warning [-c capacity-percentage] email-address [email-address] You can specify more than one email address separate by spaces o the email address can just be an account name (e.g. mrichard) or a complete email address (mrichard@cyberserver.uml.edu or michael_richards@uml.edu) If no email addresses are specified, the programs should exit with an error. If the -c capacity-percentage is not specified, it should default to 60%. o You do not specify the % on the capacity-percentage If the file system is less than the specified amount, no mail message is sent. If the file system is greater than or equal to the specified amount and less than 90%, the mail message should have the following subject: Warning: the file system is above % used The message body should have complete disk usage line from the df command for that file system along with the header. No other file systems should be in the mail message. If the file system is greater than or equal to 90%, the mail message should have the following subject: Critical Warning: the file system is greater than or equal to 90% capacity The message body should have complete disk usage line from the df command for that file system along with the header. No other file systems should be in that mail message. You are required to use the mailx command and in-line redirection (here-document) to send the email. Temporary files are not allowed. Use of a temporary file results in the loss of 15 points from the grade and not using in-line redirection will also result the loss of 15 points. You can lose a total of 30 points is you use a temporary file and dont use in-line redirection. A separate email message should be sent for each file system that meets the warning capacity requirements. This program is to be written, executed and tested on cyberserver.uml.edu. The student should use the df command and process the output of the df command and only process these file system types, nfs, ext4 and ext2. df -k -t nfs -t ext4 -t ext2 Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/cyberserver-root 141786532 5874056 128816568 5% / /dev/sda1 233191 49878 170872 23% /boot ce-srv-02:/export/space/ 38113280 4802560 33310720 13% /space ce-srv-02:/export/home/ 35976192 2665472 33310720 8% /users The student should upload the completed shell script to Blackboard Learn. Do not submit a word document or pdf file. Name the file fs_usage_warning- where is your last name. The file should be in Unix/Linux format
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started