The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 407 Weeks Ago, 6 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Getting and displaying System Information
Objectives of this Lab:
How to proceed with the Program:
Where to look for information in (/proc) directory ?
Search the (/proc ) directory and its sub-directories for the files which contain information required for this lab. You can refer to the online manual for more information on proc (man proc). For example, you can type the following in the command line
more /proc/hostname
to find the hostname of the machine.
Exercise : Write a program in C or C++ or Java to display the following information.
1. General information.
In this section you will assemble some basic facts about the system
2. Time information.
In this section you will print out how long the system has been up and how busy it has been.
a. Duration of uptime # get these information from /proc/uptime
b. Duration of idletime
The skeleton of the program
(1) read file “/proc/uptime” to obtain Totaltime and Idletime
(2) read file “/proc/sys/kernel/hostname” to obtain the hostname
(3) read file “/proc/version” to obtain the kernel version
(4) read file “/proc/meminfo” to obtain the amount of used memory and free memory
(5) read file “/proc/driver/rtc” to obtain time and date
Items to turn in to Week 6 dropbox:
NOTE: (IMPORTANT !!!)
Percentage Distribution
Total : 100%
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll