Hi everyone:
Can everyone help me do the following prgram written in shell script?
A program is required which will monitor the host on which it runs for any
login/logout activity; reporting any change of status to the user display
accompanied by a beep. [Such a program is an example of an agent.]
Notes:
The time interval at which sampling occurs is to be supplied as a command
line argument.
Only one instance of the program can be run by a user on any host at the one
time. Instances may run simultaneously on different hosts.
The user is to specify in advance on which hosts the program is permitted to
run. This information is not to be located in the program code itself.
The program must exit in an orderly fashion when the user logs out, i.e. it
must be able to start up and function sensibly the next time that user logs
in.
You are to provide as part of the Specification section of your
documentation an explanation of how the program is to be started up
automatically each time the user logs in.
Output should be as concise as possible but should at least show who has
logged in/out since last this information was sampled.
The program must be able to be terminated by the user without needing to
lookup the process table and kill the relevant process.
Your main logic should be implemented as a Shell script, but you may call
other programmable utilities, e.g. awk, or write modules in C if you think
that is necessary. However you must ensure that your solution logic is
independent of such implementation choices.
The command sleep may be of some use.
Particular attention should be paid as to how this program is to be tested,
and a careful description is to be given in the Test Plan section.
Refer to earlier warnings in regard to any attempts to include mischievous
code in executables.
Thank you so much!!!