Status Report Assignment In commercial organisations management by exception is a term commonly used. It means that no system should be logged into for routine maintenance. Computers are expected to be set up and to run for years with no human intervention. To facilitate this, scripts that monitor the health of a system are common, the idea is that the computer will run with no one checking it. A script will then run on the computer that checks everything looks okay and reports any problems that occur. In some cases the same script can also be used to help an operator investigate an incident. In this assignment you will write such a script. In the first instance, you should develop a menu driven programme that an operator can run, which is able to provide them with useful system information. This is all that is expected for a basic pass. Once it is developed, the concept can be advanced so that the application has its ‘own operator status report’ login, enabling the programme to run without giving the operator access to a shell. Advancing the concept further the programme could be developed so that it is able to run with a ‘none interactive flag’ – enabling it’s execution to be automated with the resultant file e-mailed to a user perhaps once a day or once a week (please don’t use root’s crontab for this). For the most advanced students the concept could be advanced to the point where a user is e-mailed only if there is a problem that needs to be addressed or repair functions could be added that will allow the system to be changed if things are not as the operator expected. Requirements What your script covers is completely up to you. However for guidance purposes you may want to consider the following: General system information, such as : The name of the machine The current system date and time Licensing information such as the operating system revision level When was the system last rebooted Information on registered users, such as : Names of all registered users and/or information about them Information on users currently logged in Total number of users Total disk usage for each user Details of last logins and/or users who have logged in at unusual times Details of those users who currently have an account but are not logged on. Details of users who have not logged onto the system for a certain period of time (e.g. 1 month, 6 months, 12 months+). Information on network connectivity, such as : To check the current status of the NIC The availability of other machines, based on those named in /etc/hosts To provide additional information about the NIC such as its IP address, the physical card address ( the MAC address ) and the subnet mask Information on processes, such as : Those that are running Those that belong to a specific user Those that are using a lot of resources Installed software Hardware utilisation information, such as : The configuration and percentage usage of the UNIX file systems Amount of RAM and the percentage used Amount of swap space and the percentage used Size of the CPU run queue, extent to which the CPU is utilised Guidance on grades A basic menu driven script that has four functioning options each of which presents some useful information to the user. For a grade D this information need not be formatted but may simply be the out put of four relevant commands As above but a reasonable range of system information should be accessible to the user (perhaps twelve options). Output and menu structure should be formatted and tidy as should the script. For a higher C grade the techniques used within the menu options to gather information should include additional conditional and/or iteration statements. Deliverables Your submission should be sufficient to inform ‘the markers’ of all your achievements. Consider the following. A series of screen shots and outputs that provide a comprehensive explanation of everything that your script(s) is capable of. A listing of your script(s) their implementation and configuration files A report that combines the submissions together. On week 11, you will be required to demonstrate your work to your tutor. Useful Fedora commands (don’t forget the man pages) uname date whoami users lspci free df du ps –ef top /sbin/chkconfig –list rpm stat /sbin/ifconfig /sbin/ifconfig eth0 cat /etc/hosts /bin/ping cat /etc/passwd cat /etc/group /dev/null whereis ping ping –c1 wc –l tr cut uname date mailx -s subject user < filename mailx who who am i whoami last hostname who –q uname –a ifconfig –a ping vmstat netstat sar