[Novalug] script for getting hardware info

Jon LaBadie novalugml@jgcomp.com
Thu May 27 17:04:42 EDT 2010


On Thu, May 27, 2010 at 04:46:12PM -0400, Peter Larsen wrote:
> On Thu, 2010-05-27 at 18:05 +0000, Miguel Gonzalez wrote:
> > I'm trying to write a plugin for GLPI that retrieves some hardware info from a specific machine. Right now I just need CPU, total memory and total hard drive. I'm trying to get this info from a non-root account so there is no risk involved since GLPI is web-based.
> 
> That's what HAL is for. Try "lshal" first - you can apply filters after
> that.
> 
> > /proc/cpuinfo can be a little cumbersome to parse since it shows an entry for each core or cpu in the machine but it's still helpful
> > 
> > /proc/meminfo - you can get the total.
> > 
> > the problem is to get the total hard drive (either IDE, SATA, SAS o SCSI). Is this possible as a non-root? /sbin/fdisk -l doesn't work as non-root.
> 
> lshal | grep storage.size
> 

Looks like a winner!

jl
-- 
Jon H. LaBadie                  novalugml@jgcomp.com
 JG Computing
 12027 Creekbend Drive		(703) 787-0884
 Reston, VA  20194		(703) 787-0922 (fax)



More information about the Novalug mailing list