Listing Live System Status

  1. Edit a script named update.sh that generates status.html in your web directory: ~/public_html/.
    I need to write specific commands to show each specific item
  2. The generated webpage should include information related to:
    UNIX : kernel version of ed-lab server
    USER : number of users on the server and who they are
    PROCESS : what is the first (oldest) root's process, and when it started
    NETWORK : IP address of eth0 interface and its MAC address
    ROUTE : what is the default route of ed-lab server
    LAN : how many other machines are there in ed-lab server's local area network (LAN)? what are their IP/MAC mappings?
    CONNECTION : how many TCP connections
    UPDATE : when is the system information last updated

Relevant:
uname, who, route, ifconfig, hostname, and more

I've already completed the kernel version and the number of users, but I am having a lot of difficulty figuring out what switches to use with the certain commands.

UMass Amherst, Amherst, MA, United States, Robert Walls and Yung Chih Chen, CS197U

Some of the commands are proprietary or have special options - based on what Unix/Linux you have. So- before anyone can help:

  1. What OS?
  2. What shell are you using to write your code?

I'm using Windows 7 as my OS but I'm accessing Unix through ssh onto a remote server. I'm using tcsh as the shell

What UNIX? Linux, Solaris, HPUX, BSD, FreeBSD, SCO ....?
When connected to the UNIX box please post the output of:

uname -a

Thanks.

Oh hahaha sorry about that I should have known, I'm getting way too stressed over this assignment but I'm using Linux

---------- Post updated at 11:00 PM ---------- Previous update was at 10:33 PM ----------

Sorry it was Linux

OK.
What specifcally do you have a problem with? You said you have done some steps, so there must be others that are a problem.

The problems as of right now that I am having difficulty with are:

  1. finding the first process and the date it started( i know it has to do with init but i can't find out how to find a command that only prints the name of the process and another command that prints out the date)
  2. Using a command that shows only the MAC address as the output
  3. Using a command that shows the default route of the server I am on
  4. Using a command that finds the number of LAN connections on the server
  5. And a command showing the IP/MAC mappings of each of the LAN connected computers

If none of this was explained by your teacher, lecturer, or whoever, then it is right to assume it has been given to you as an exercise in research.

Research doesn't generally entail telling everyone what you need and expecting to get the answer.

Have you Googled any of the stuff you're looking for?

Of course I have searched through Google looking for my answers. I was using these forums as a last effort to finish the assignment.

I don't know that there are single commands ("a command") to do exactly what you need.

So it might be that you need to find the command that gets generally what you're looking for, and then use other commands, like awk, sed, cut and grep, etc. to extract the exact information you need.

Which version of what Linux are you using, and what shell?

Could you give me any hints as to what sort of commands I could look into for more information?

As much of what you are looking for is network-related, perhaps that would be a good place to start?

Let me google that for you

Additionally, I am sure you must have used the ps command? With the right options, that can also show the date when a process starteed. Here's a link to the man page: ps(1).

There's PERL, which is a "practical extraction and reporting language". It can be a bit overwhelming for newbies, so if you need to "extract" anything from ps or any of the network commands, I would suggest using awk!

1 : Finding the first process: once youve mastered a bit ps command it should not be too difficult to find the requested... it must be PID 0 or 1 or...
You are to look at the man pages for ps syntax differ between OS (e.g ps ax v.s. ps -ef...)

Here is a tip: you can find a man page by entering

man <command>

but this assumes that you know which command you look for. You can also search the man database for keywords by using the "-k" switch.

man -k foo

will display a list of all articles involving "foo". You can then start to read these articles one by one. Also useful: at the end of each man page there is usually a paragraph labeled "SEE ALSO". I suggest you do exactly this.

For instance:

You sure know the network protocol which maps layer-2 (MAC) addresses to layer-3 (IP) addresses, don't you? Now, enter this as a keyword in a "man" search and you might find some useful references.

I hope this helps.

bakunin