Thursday, April 15, 2010

Using DNS for inventory tracking

This post will be quite short - rather a tip ;-).
Recently I started using DNS to store information about my assets. It turned out to be a primitive but very handy way to do it.

You usually keep track of your hardware in some kind of spreadsheet or a database. They can be updated automatically or manually. Ready tools to do it are ocsinventory or puppet storeconfigs. This is cool, but to access the data you need to launch your browser, enter fields etc. etc. It all takes time, particularly when you need to look up information on only one host.

I found things turn much simpler if you put vital hardware data into your DNS (hinfo, txt custom fields are just for that). You can access them later on using "host -t " command from any unix-like os.

For one of my hosts the output might look like this:

host -t txt compute002
descriptive text "location: Rack103a-5"
descriptive text "role: compute-node"
descriptive text "hardware: ibm, 8gb ram, 2xIntel Xeon 5540"

No comments:

Post a Comment