Script to get system configuration

Hi,

We have >1000 UNIX boxes in our environment with various UNIX flavors like Solaris, HP-UX and Redhat Linux ES 3/4/5. We need to collect their system configuration like

  • No. of CPUs and their frequencies
  • RAM Size
  • No. of HDDs installed and their usage
  • Exact OS Version and its revision.

I think it's best to write a Generic Script so that it can be run on ALL UNIX flavors and get the system configuration and pipe to a file.

Does anyone have this script? Please help.

Thanks
Prvn

I doubt that anyone has such script, but I'll be happy to see it. My suggestion is :
write an TCL / expect script, that will connect to all your servers, and get the info based on OS type.
Sample logic as follows :

$ list of servers to connect to = server1, server2, server3, etc.
# few functions : 
function Linux { 
# execute list of commands to get the info you want : 
exec (uname -a, cat /proc/cpuinfo, free -mt, etc)
}
function Solaris { 
exec (prtconf, prtdiag, psrinfo, etc)
}
main { 
if OS = Linix then Linux()
elsif OS = Solaris then Solaris(), etc
}
# Define a way to write to a log file, based on the selected language, and some date/timestamp. 

You can use TCL/Expect, as I said, or use Perl, in particular Perl's implementation of Expect library.
HTH. I'd love to see ready script, this can be very useful, as writing such script from scratch may be extensive and time consuming task.

Hi.

I think I responded to a similar query in another forum recently. I'll look around.

In the meantime, there are a few items found here: freshmeat.net: Search results - +System +Configuration +Collector

An interview with the author of one is at Interview with Siem Korteweg: System Configuration Collector - The Community's Center for Security

Another item posted long ago is at Sysinfo - A Linux Box System Information Retriever - sysinfo

A commercial utility is MagniComp - SysInfo(TM) Total System and Storage Asset Information

cheers, drl

Hi.

Apparently it was on this self-same forum: Shell Scripts for automating server inventory for unix servers
... cheers, drl