Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

bash script that monitors who logs in and logs out of Linux machine (e.g., cse01, cse02, etc.) where the script is running. In particular, you

image text in transcribed
bash script that monitors who logs in and logs out of Linux machine (e.g., cse01, cse02, etc.) where the script is running. In particular, you will check the status of who is logged in every 10 seconds and report each user ID that logs in or logs out during that time frame. Note that there may be more than one user that logs in or out during this interval. You must include the host name when reporting the user ID information. In addition, you will install a custom signal handler to trap tho SIGINT (i.e., C) one time before you are able to terminate the script with t e SI IN Yu Mi,0 print out the current date and time and report the number ustbg Ad n e ven ir here are no changes (i.e, no one logged in or out during the interve) DctTe sae te SAMPLE OUTPUT for several examples, indudry th, drure scensrios that might occur REQUIREMENTS Your script should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, course section, date, and brief description), comments for each variable, and commented blocks of code Your bash script should be named "minor2.sh, without the quotes. Note that this must be done as a bash script, not a C program Your script will be graded based largely on whether it works correctly on the CSE machines (e g, cse01,cae02,...ese06), so you should make sure that your script runs on a CSE machine Please pay attention to the SAMPLE OUTPUT for how this script is expected to work. If you have any questions about this, please contact your instructor or TAs assigned to this course to ensure you understand these directions nment that must be the ndividual student Any instance of academic dishonesty will result in a grade of F" for the course, along with a report filed into the Academic Integrity Database SAMPLE OUTPUT (user input shown in bold) s inor2.sh Wed Feb 13 01:05:25 CST 2019initial users logged in > xy20123 logged in to csed1 456 logged in to csed1 de10789 logged in to ce0 mat 0299 Logged in to cse01 mn0012 logged in to cse0 > Est0034 logged in to cse0 jk10056 logged in to cse01 u0078 logged in to cse0f wed Feb 13 01:05:25 CST 2019 ) # of users: 8 Wed Feb 13 01:05:35 CST 2019) of users: 8 Wed Feb 13 01:05:45 CST 2019)of users: Wed Feb 13 01105155 CST 2019of userss Wed Feb 13 01:06:05 CST 2019) of users: bash script that monitors who logs in and logs out of Linux machine (e.g., cse01, cse02, etc.) where the script is running. In particular, you will check the status of who is logged in every 10 seconds and report each user ID that logs in or logs out during that time frame. Note that there may be more than one user that logs in or out during this interval. You must include the host name when reporting the user ID information. In addition, you will install a custom signal handler to trap tho SIGINT (i.e., C) one time before you are able to terminate the script with t e SI IN Yu Mi,0 print out the current date and time and report the number ustbg Ad n e ven ir here are no changes (i.e, no one logged in or out during the interve) DctTe sae te SAMPLE OUTPUT for several examples, indudry th, drure scensrios that might occur REQUIREMENTS Your script should be well documented in terms of comments. For example, good comments in general consist of a header (with your name, course section, date, and brief description), comments for each variable, and commented blocks of code Your bash script should be named "minor2.sh, without the quotes. Note that this must be done as a bash script, not a C program Your script will be graded based largely on whether it works correctly on the CSE machines (e g, cse01,cae02,...ese06), so you should make sure that your script runs on a CSE machine Please pay attention to the SAMPLE OUTPUT for how this script is expected to work. If you have any questions about this, please contact your instructor or TAs assigned to this course to ensure you understand these directions nment that must be the ndividual student Any instance of academic dishonesty will result in a grade of F" for the course, along with a report filed into the Academic Integrity Database SAMPLE OUTPUT (user input shown in bold) s inor2.sh Wed Feb 13 01:05:25 CST 2019initial users logged in > xy20123 logged in to csed1 456 logged in to csed1 de10789 logged in to ce0 mat 0299 Logged in to cse01 mn0012 logged in to cse0 > Est0034 logged in to cse0 jk10056 logged in to cse01 u0078 logged in to cse0f wed Feb 13 01:05:25 CST 2019 ) # of users: 8 Wed Feb 13 01:05:35 CST 2019) of users: 8 Wed Feb 13 01:05:45 CST 2019)of users: Wed Feb 13 01105155 CST 2019of userss Wed Feb 13 01:06:05 CST 2019) of users

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions