932
edits
Changes
m
Under construction.The script used to monitor disk space earlier in the lab is very useful but has a noticeable flaw: You have to manually change the script to modify the percentage of disk space usage that will trigger a warning. It also will only ever send the email to root (unless you manually change the script).
→INVESTIGATION 3: Scripting
=INVESTIGATION 3: Scripting=
<ol>
<li>Make a copy of of monitor-disk-space.bash called disk-monitor.bash and place it in your user's bin directory.</li>
<li>Keep the original preamble comments in the script, but add a line indicating that you modified it (and when you did so). Make sure you indicate the change in script name too.</li>
<li>Modify the script so that it will use getopts to accept command line input from the user for their preferred values for who to send the email to, and what percentage of use is worth sending an email over.
::You may choose the letters for each of these options, just document your choice in the comments in the script.
::Make sure your script keeps the original values as defaults, in case the user doesn't specify one of them (i.e. if they don't use the option to set who to send the email to, just continue to use root).</li>
<li>Test your script with both good and bad data to make sure it works.</li>
<li>When you are confident your script works, you are ready to submit the lab.</li>
</ol>
= LAB 5 SIGN-OFF (SHOW INSTRUCTOR) =