Can I make a script to check peripheral serials against a DB? [message #168046] |
Tue, 18 April 2006 09:35 |
Azrael
Messages: 8 Registered: April 2006
|
Junior Member |
|
|
I am working on a basic unix asset management database, and wish to remove some of the human element by having a script, run periodically via crontab, to check the serial numbers of peripherals (listed as part of iostat -En I believe) attatched to a unix machine against those on a database. Where it finds a device in the database that has the same serial number, the entry will be marked as updated by having a 'last updated' field marked with the current date, and the field listing the machine it is attatched to is set to match the machine running the script. The idea is that the script will detect movement of kit from one machine to another.
I'm thinking of using C, but Im open to suggestions. I dont think it should be too complicated, I just want to gather ideas. Here's the flow just to summerise:
List serial numbers of attatched devices (iostat -En)
Check against database table of devices
For each device with a matching serial number, set host to this machine, set 'last updated' to today's date
|
|
|
|
|
|
|
|