Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

They are a mix of Red Hat and CentOS 5.x, I'd like to have something on one host that can check basics like cpu/mem/disk hardware, Model, HW RAID controllers, etc would be nice.

I have key based ssh authentication set up, but I do not want to have to install anything on these hosts. Worst case, I could scp something to /tmp, but no install please.

Near as I can see, either I need to install something, or it is something really basic that I would run on the machine, and then manually aggregate.

Am I stuck writing some Perl to run and process the output of dmidecode, lspci, etc?

If I do, I'll put it up someplace, and link to it.

Related questions that do not have the answer:
Get server hardware details for ubuntu server
How to find out details about hardware on the Linux machine? this one had a nice bit of shell script, but it errors.

share|improve this question
Why do people keep suggesting I install stuff? There are a bunch of choices if I want to go that route, just looking at the problem, I don't see why ssh, run commands (lspci, lsusb, dmesg, dmidecode, look at /proc), then analyze on my server (ok to install what ever here, it could be a throwaway vm) isn't an option. – Ronald Pottol Oct 12 '10 at 23:17
In general you always need to think about build vs. buy. Is it more productive for you to cook up, debug and maintain scripts to gather inventory data, or to just use one of the thousands of applications out there to gather the data for you? You should have a really good reason to re-invent the wheel. – duffbeer703 Oct 14 '10 at 15:35
Well, it's how can I inventory this large number of inherited machines that are not well documented, and some of which have not really been touched in any sense for over 500 days, yet are critical for production? So I'd rather not install anything. I could live with untaring some perl in /tmp, but no real installs please. I want to see what I have got, to better figure out what can be spared (those 500 day uptime boxes will be available by Jan 1), etc. Rebuilding everything over time. – Ronald Pottol Oct 15 '10 at 1:43
up vote 2 down vote accepted

Maybe try it's just one bash script that outputs to html, which you can upload/download to a central directory. However it's just the output from commands so it's pretty hard to put it in a structured format like sql/xml.

share|improve this answer

Without installing any new software on the remote systems, you can grab a raw snapshot of the remote machine's state with:

lspci > /tmp/`hostname`-lspci
tar -czvf `hostname`-proc-snapshot.tar.gz /proc /tmp/`hostname`-lspci --exclude=/proc/kcore

Then scp the tar archive from the remote server. This will get you: cpuinfo, meminfo, partitions, etc. Add more commands and temporary files for any additional information you may need (logical volumes, raid status, etc.)

As a minor bonus, you get an inventory of running processes on the remote machine at that instant.

share|improve this answer
Yup, throw in dmidecode, etc, and some processing to clean it all up and make a nice csv of it. – Ronald Pottol Oct 15 '10 at 1:44

You could install Spiceworks in a windows vm. It only uses ssh to inventory linux hosts.

share|improve this answer

lshw command gives you a lot of hardware information and can output it in HTML or XML format...

share|improve this answer
lshw isn't available on CentOS or Redhat out of the box as it is in Ubuntu, and Ronald doesn't want to install applications ... – jsnfwlr Oct 12 '10 at 0:30

If lshw is installed on the machines, you can use that, but it doesn't come pre-installed on Redhat and it's derivatives. There are RPM's out there for it, and you may be able to extract the required files from an RPM, SCP them to the machines, create a few symbolic links (most likely a link from /usr/sbin/lshw to the tmp location of the file, and from /usr/share/lshw to the tmp location of the folder) then you run lshw and remove the symbolic links afterwards. That is assuming you have root/sudo access ...

share|improve this answer
Some RPM's for lshw can be found here: – jsnfwlr Oct 12 '10 at 0:30

Depending on if you have Python2 installed on your systems, you could also use Ansible.

ansible -m setup ${hostname}

This will output a nice JSON which includes CPU/RAM/HDD/Network and software configuration. Read the documentation for more information.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.