Instructions
Fill out the worksheet as you progress through the lab and discussions. Hold your worksheets until the end to turn them in as a final submission packet.
Resources / Important Links
Downloads
The worksheet has been provided below. The document(s) can be transposed to
the desired format so long as the content is preserved. For example, the .txt
could be transposed to a .md
file.
Unit 8 Recording
Discussion Post #1
Scenario:
It’s a 2 week holiday in your country and most of the engineers and architects who designed the system are out of town.
You’ve noticed a pattern of logs filling up on a set of web servers from increased traffic. Your research shows, and then you verify, that the logs are being sent off real time to Splunk. Your team has just been deleting the logs every few days, but one of the 3rd shift engineers didn’t read the notes and your team suffered downtime.
How might you implement a simple fix to stop gap the problem before all the engineering resources come back next week?
-
What resources helped you answer this?
-
Why can’t you just make a design fix and add space in /var/log on all these systems?
-
Why can’t you just make a design change and logrotate more often so this doesn’t happen?
-
For 2,3 if you are ok with that, explain your answer. (This isn’t a trick, maybe there is a valid reason.)
Discussion Post #2
Scenario:
You are the only Linux Administrator at a small healthcare company. The engineer/admin before you left you a lot of scripts to untangle. This is one of our many tasks as administrators, so you set out to accomplish it. You start to notice that he only ever uses nested
if
statements in bash.You also notice that every loop is a conditional
while true
, and then he breaks the loop after a decision test each loop. You know his stuff works, but you think it could be more easily written for supportability, for you and future admins. You decide to write up some notes by reading some google, AI, and talking to your peers.
-
Compare the use of nested if versus case statement in bash.
-
Compare the use of conditional and counting loops. Under what circumstances would you use one or the other?
The discussion posts are done in Discord threads. Click the 'Threads' icon on the top right and search for the discussion post.
Definitions
Variables:
Interpreted program:
Compiled program:
Truth table:
AND/OR logic:
Single/Dual/Multiple alternative logic:
Digging Deeper
- Read:
- https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html
- https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_02.html
- https://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_03.html
What did you learn about capabilities of bash that can help you in your scripting?
- If you want to dig more into truth tables and logic, this is a good start: https://en.wikipedia.org/wiki/Truth_table
Reflection Questions
-
What questions do you still have about this week?
-
Just knowing a lot about scripting doesn’t help much against actually doing it in a practical sense. What things are you doing currently at work or in a lab that you can apply some of this logic to?