Sequence 1: Check System Status and inform Super User (root) about the same.
1. Check the CPU Usage and Memory Utilization
[student @ stationX ~] $ cat /proc/cpuinfo /proc /meminfo
[Student @ stationX ~] $ cat /proc/cpuinfo /proc/meminfo | more
2. Mail the Details to root
[student @ stationX ~] $ cat / proc /cpuinfo /proc /meminfo | mail -s “System Stats for $(hostname)” root@localhost
3. Check the Email account root@localhost
- Log in as root
# su –
- Run the command mutt or mail .
# mutt
- If you are using mutt Press y.
- Select the message you want to View with the up and down Arrows and Press Enter to View it.
Note That while viewing a message, the up and down Arrows Move between messages , not Lines. To Scroll Within the current message, Use Enter and Backspace
- Press q to Exit message View
Sequence 2 : Use Output redirection to grab CPU status
- Send the output of date command to a file
[Student @ stationX ~] $ date> cpumem.info
- Send CPU info and Memory status to same file. (It should over-write it)
[Student @ stationX ~] $ cat /proc /cpuinfo /proc /meminfo> cpumem.info
- Try the same Command again. Send Output of date command to same file to over-write previous contents
[Student @ stationX ~] $ date> cpumem.info
- Use >> symbol in place of > to append the file with CPU information and Memory information
[Student @ stationX ~] $ cat /proc/cpuinfo /proc/meminfo >> cpumem.info
- Send the contents of this file using piping symbol | as mail to root user
[student @ stationX ~] $ cat cpumem.info | mail -s “System Info for $ (hostname) – 2” root@localhost
- Use Command Grouping ( ) to send output of multiple commands as mail to root and also display it on the terminal using tee.
[student @ stationX ~] $ (date; cat /proc/cpuinfo /proc/meminfo) | tee cpumem.info | mail -s “System Stats for `hostname` ” root
- Try same sequence of commands without command grouping.
[Student @ stationX ~] $ date; cat / proc /cpuinfo / proc /meminfo | tee cpumem.info | mail -s “System Stats for` hostname` ” root
Would Date Print Screen and only to the cat’s output Would be piped to tee.