This is where you get to put all the knowledge you've accumulated through the entire Linux Basics section into play.
What is needed is a script that will collect some system information on a daily schedule and write that data to a file.
The script should be packaged into an rpm file and installed with the rpm commands. It should automatically setup the scheduling to be run at 2:05 am Monday - Friday. The output file should be /tmp/status_check. The rpm should be named GTRI-status-test with appropriate version numbers. A template src.rpm is provided. Each of the output requirements below should be added as a patch to the original GTRI-status-test package (a total of 7 patches).
The data to be collected is
- name and shell of all users with UID 0
- User name and number of logins yesterday
- How long has the system been running?
- What is the memory usage at the time this script runs and the date and time it runs.
- rpm info of the Status-test rpm including the md5 signature of the package
- The size of the output file and its SELinux context
- A copy of the script that produces this report.
Output format should be as follows:
Report name |
hostname |
Report date |
Report time |
Memory usage |
System run time |
output file name |
size of file in bytes |
SELinux context |
|
__________________________
rpm info
__________________________
UID 0 and shell data
__________________________
User login count data
__________________________
copy of script
__________________________
Concepts of this exercise The goal is to work through a simulated project that has most of the ideas presented in the beginning training process. The initial script is bash. But if another scripting language is preferred, use it as long as the patching process is preserved. Of course, the main bash script can call external scripts in other languages easily.
|