[SOLVED] Please help !!! I need Linux Script to obtain IP,MAC,Hostname,/proc/cpuinfo,conncted
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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.
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.....
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?
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.....
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.