I use Wasp Inventory to print labels and I would like to export out of Wasp and import into spiceworks to update existing devices already in the inventory. I would like to match the device with the serial number in spiceworks and populate the asset tag field. Can this be done?

4 Spice ups

Check out this How-To on doing just that: http://community.spiceworks.com/how_to/show/203-import-devices-into-spiceworks-from-a-csv-file

2 Spice ups

Thanks for your support. This is what I have as a script to update the asset tag and it does not work. Thankfully it does not create a duplicate device.

ruby bulk_import.rb -e email@domainname -p password --no-manual b_asset_tag filename.csv

I believe the correct syntax is:

… -m no-manual …

Also the “b_…” fields are not user facing, so you should have ‘asset_tag’ in your line instead.

(Be sure you’ve made a backup of your Spiceworks before all this)

2 Spice ups

Thanks for the quick response.

Here is the command and error:

ruby bulk_import.rb -e email@domainname -p password -m no-manual asset_tag filename.csv

error: bulk_import.rb:20:in ‘initialize’: No such file or directory - no-manual (errno:Enoent) from bulk_import.rb:20:in ‘open’ from bulk_import.rb:20:in ‘load_encoded_file’ from bulk_import.rb:121:in (main)’

Let me check on this for you.

1 Spice up

Okay, so the ‘–no-manual’ was correct before.

Try that and the ‘asset_tag’ field.

2 Spice ups

Thanks for getting back to me. The --no-manual worked but when I list the asset_tag it barks at me. it says - no such file or directory for the asset_tag. Is there flag or something that needs to go in front of asset_tag. ex. -m asset_tag

bulk_import.rb:20:in ‘initialize’ : No such file or directory - asset_tag (Errno::Enoent)

from bulk_import.rb:20:in ‘open’

from bulk_import.rb:20:in ‘load_encoded_file’

from bulk_import.rb:121:in ‘(main)’

It just smacked me in the face!

Don’t put the field in the command line. That should be a column in your csv. I don’t know exactly what fields you have, but if you’re just updating the asset tag, you csv should look something like this:

Name,Asset Tag
Computer1,TW232
Computer2,TW233

The “Name” should match what is in your Inventory already. You can add Serial Number too if you wish.

2 Spice ups

Thanks. The csv is what it should be. All I have is the Name and Asset Tag in the csv file. I run the ruby bulk_import and it says it ran correctly but when I go to the inventory in spiceworks and refresh the device, it does not update the Asset Tag field.

If I create a new device with the ruby program it populates what it should but does not update. I am going to try the ruby command with out the --no-manual command and see if it duplicates.

You could also try ‘asset_tag’ as the column name.

1 Spice up

Good, I am getting to learn spiceworks ruby bulk_import.rb program a little more.

the underscores in the columns help a lot.

Yeah, I’m not sure why the how-to just shows the UI label, and not the actual database field. It’s possible that certain fields you can us the label, and others you need the db field name.

If you get a SQLite browser program (SQLite Manager Firefox plugin is great), you can browse the database and get the table names and fields. *** DO NOT MAKE ANY CHANGES IN THE DATABASE DIRECTLY ***