LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 10-18-2009, 10:58 AM   #1
shourieksr
LQ Newbie
 
Registered: Mar 2008
Posts: 4

Rep: Reputation: 0
Please help !!! I need Linux Script to obtain IP,MAC,Hostname,/proc/cpuinfo,conncted


Hello,

I am a newbie to Linux, I need some help from the experts.

I need a script which will give the following info when executed.

a script that returns for each machine of your network :
–hostname
–IP
–Mac address
–cpu's model name from cat /proc/cpuinfo
–the RAM size from cat/proc/meminfo
–disk capacity using df or du commands
–The name of each connected user.

This is an assignment in my college. I've tried every avenue but could not find correct answers.....Kindly help me, you can directly mail me at
shourieksr@gmail.com


Thanks a Lot in advance.
 
Old 10-18-2009, 11:06 AM   #2
Lordandmaker
Member
 
Registered: Sep 2005
Location: London, UK
Distribution: Debian
Posts: 258

Rep: Reputation: 39
Quote:
Originally Posted by shourieksr View Post
This is an assignment in my college. I've tried every avenue but could not find correct answers.....
What have you tried, and what didn't work? Generally, we won't just give you answers to your homeworks, but we will help you with the bits of it you can't understand.
Quote:
Kindly help me, you can directly mail me at
shourieksr@gmail.com
Posting your email address is a pretty easy way to find yourself on even more spam lists. We don't tend to email answers to posters, since the forum offers an easier way to answer to the question, and lets everyone see the answer. You can subscribe to this thread, though, to have answers posted to it emailed to you.
 
Old 10-18-2009, 03:20 PM   #3
shourieksr
LQ Newbie
 
Registered: Mar 2008
Posts: 4

Original Poster
Rep: Reputation: 0
To be really honest,I have no clue, as I'm completely new to linux.
I understand that you do not want to spoon feed me.....I'm okay with that, but at least give me some insight into it so that I can work on it and possibly learn how to do it my self......
I apologize for the fallacy of giving my email id directly, won't do that again.....

Thank you.

Last edited by shourieksr; 10-18-2009 at 03:28 PM.
 
Old 10-18-2009, 03:23 PM   #4
shourieksr
LQ Newbie
 
Registered: Mar 2008
Posts: 4

Original Poster
Rep: Reputation: 0
what I meant by "tried every avenue" is that I googled it and asked all my acquaintances who knew something about linux, I still couldn't find a correct answer.....
 
Old 10-18-2009, 04:16 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,721

Rep: Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914Reputation: 5914
Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.

I find it curious that a web search did not help. What type of correct answers are you looking for? What commands have you learned in class?
 
Old 10-18-2009, 05:56 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,646

Rep: Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969Reputation: 7969
Quote:
Originally Posted by shourieksr View Post
what I meant by "tried every avenue" is that I googled it and asked all my acquaintances who knew something about linux, I still couldn't find a correct answer.....
Well, Google has lots of information about writing shell scripts, and I suspect that the texts you have also have insight on this.

Quote:
a script that returns for each machine of your network :
–hostname
–IP
–Mac address
–cpu's model name from cat /proc/cpuinfo
–the RAM size from cat/proc/meminfo
–disk capacity using df or du commands
–The name of each connected user.
Step by step:
- The "hostname" command would probably do this
- IP, MAC would come from ifconfig
- CPU, RAM come from the commands you stated
- Disk capacity comes from the commands you stated
- The "who" command returns this

Now, this is for your LOCAL machine. Over the network requires shell access (somehow), or SNMP access, with lots of other variables that you don't touch on. And as others have said, post what you've written, and where you're getting stuck, and we'll help.

However, a hand UP is far different than a hand OUT.....
 
Old 10-18-2009, 08:50 PM   #7
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,987

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
I would use nmap to discover who is on your network, eg.:

# nmap 192.168.1.*

would give you the IP, hostnames and macs of everyone on a network that has starting IPs of 192.168.1. It will also tell you what services are up. Google nmap; there are a lot of tricks you can do with the various options.
 
Old 10-19-2009, 02:47 AM   #8
Lordandmaker
Member
 
Registered: Sep 2005
Location: London, UK
Distribution: Debian
Posts: 258

Rep: Reputation: 39
Quote:
Originally Posted by shourieksr View Post
what I meant by "tried every avenue" is that I googled it and asked all my acquaintances who knew something about linux, I still couldn't find a correct answer.....
The angle I'd approach this from is to write the script to do it on the local machine, then run it on the other hosts.

So, have you got a script that will run locally yet? If not, what're you stuck on? If so, what've you looked into as far as running on other hosts? We know very little about these other hosts, too.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/proc/cpuinfo flag lm Henry_1 Linux - General 8 05-23-2019 06:15 PM
It is possible to modify the /proc/cpuinfo ? fc3_fan Linux - Newbie 21 01-30-2013 02:43 PM
Proc/CpuInfo sipsipi Linux - Software 4 03-03-2006 11:42 AM
/proc/cpuinfo oops! feta Linux - Hardware 2 11-08-2004 10:16 PM
/proc/cpuinfo embsupafly Linux - General 3 12-29-2003 06:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 05:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration