[rt-users] [EXTERNAL] rt::extension::import::csv docs
Mervini, Joseph A
jamervi at sandia.gov
Tue Sep 16 12:11:32 EDT 2014
I just went through this same exercise and posed the same question to the list with a similar response. But I was able to get it working through trial and error and my intent is to create a full blown how-to that may or may not get included in the distribution.
In the meantime as a simple example, here are the things that you will need to do:
1. If you are using custom fields for your assets, create and enable them via the web interface.
2. Create your csv file. Here is a simple example of what I am using:
Name,Description,Status,Type,Model,Serial Number,IP Address,Location,Rack Number
myMachine1,Controller,in-use,Dell Server,R720,abc123,192.168.1.1,Building 1,1
myMachine2,Controller,in-use,Dell Server,R720,def456,192.168.1.2,Building 1,1
myMachine3,Controller,in-use,Dell Server,R720,ghi789,192.168.1.3,Building 1,1
3. Create a custom config file. (This is what I did as opposed to adding it to the RT_SiteConfig.pm file)
Set( $AssetsImportUniqueCF, undef );
Set( %AssetsImportFieldMapping,
'id' => 'Name',
'Name' => 'Name',
'Catalog' => \'Storage Assets',
'Description' => 'Description',
'Status' => 'Status',
'CF.Type' => 'Type',
'CF.Model' => 'Model',
'CF.Serial Number' => 'Serial Number',
'CF.IP Address' => 'IP Address',
'CF.Location' => 'Location',
'CF.Rack Number' => 'Rack Number'
4. Running the script to populate the database:
/opt/rt4/local/plugins/RT-Extension-Assets-Import-CSV/bin/rt-assets-import-csv --update ./test1.csv --debug --config config.test1
I added all the switches to see what's happening. I would suggest that you create a test RT instance to play with to get comfortable with the process.
Hope this helps.
====
Joe Mervini
Sandia National Laboratories
High Performance Computing
505.844.6770
jamervi at sandia.gov<mailto:jamervi at sandia.gov>
On Sep 16, 2014, at 4:43 AM, David Lane (IT Support) <dave at goodchoice.it<mailto:dave at goodchoice.it>> wrote:
Hi guys,
Nearly got this to work i've
Installed the cpan module - and manually compiled so its now installed fine
Added the plugin and configuration to the RT Siteconfig
The distribution notes say i should run
"SYNOPSIS
rt-assets-import /path/to/assets.csv
"
HOW?
It would be really helpful to create a work-through for this...
Thanks for your time
Dave
--
David Lane
Director
GoodChoice.IT Ltd
We reward successful referrals
W: www.goodchoice.it<http://www.goodchoice.it/> E: dave at goodchoice.it<mailto:dave at goodchoice.it> T: 020 8099 5540
--
RT Training - Boston, September 9-10
http://bestpractical.com/training
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140916/ab7d7e17/attachment.htm>
More information about the rt-users
mailing list