Starting from:

$24.99

Linux Administration Lab 1 - BASH Shell Scripting Solution


Summary:
The only Linux system administrator at Dunder Mifflin recently quit on very short notice. ‘Management’ has chosen you to temporarily fill the role because you are the only one (of our valued employees) with any Linux experience.
These scripts are easy to describe and harder to implement. Essentially, you’ll create two different bash scripts to do the following:
1. Monitor the space utilization of the / and /boot filesystems as indicated by the df command, and send an e-mail to the root account using the mail program when either exceeds a specified threshold (80% is reasonable.)
2. Display a system dashboard to give a brief overview of the current state of the system from a few different perspectives: CPU/RAM, network, user accounts and number of files/directories.
Programs you’ll find useful are: free, uptime (load average indicates CPU utilization), cat /proc/net/dev, cat /etc/passwd, and ping.
You must at a minimum implement the features shown in the sample output below:

1/2

A few helpful hints are:
Sometimes you must ‘escape’ characters that have special meaning to bash (e.g. | ) Some commands have very helpful formatting flags (e.g. -e or -n with echo).
If you are sure that you sent mail to the local root account but it never arrives in /var/mail/root, make sure that the postfix daemon is running.
Prerequisites
Please finish the first two reading assignments before starting the lab. You will also need to install some software on your machine. Run the following command to ensure that you have the necessary packages before proceeding:
# yum install mailx
Submission Requirements
1. Make sure you submit the scripts for this lab as separate .sh files, named dashboard.sh andspace.sh
2. The dashboard script, at a minimum, should have all the items in the output listed above. Theformatting need not be exactly the same. You must extract and display the required portions of text from the commands, not simply display the output of the commands.
3. The disk utilization monitoring script should send an e-mail when the disk space of eitherpartition exceeds a percentage defined by a variable in the script (parameterize!).
4. Scripts must work with the version of bash included in CentOS 7.x.
2/2

More products