Rt::extension::import::csv docs

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 E: dave@goodchoice.it T: 020 8099 5540

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…

I don’t understand your question.

It’s a command line program. You run it. In a shell. On a unix box.

Just like you would run ls to list files.

-kevin

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

  1. 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’

  1. 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@sandia.govmailto:jamervi@sandia.govOn Sep 16, 2014, at 4:43 AM, David Lane (IT Support) <dave@goodchoice.itmailto:dave@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.ithttp://www.goodchoice.it/ E: dave@goodchoice.itmailto:dave@goodchoice.it T: 020 8099 5540
RT Training - Boston, September 9-10

Thanks so much for that

Worked perfectly - I owe you a beer!

Please try and get this included in the docs!

DaveOn Tue, Sep 16, 2014 at 5:11 PM, Mervini, Joseph A jamervi@sandia.gov wrote:

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

  1. 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’

  1. 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@sandia.gov

On Sep 16, 2014, at 4:43 AM, David Lane (IT Support) dave@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 E: dave@goodchoice.it T: 020 8099 5540

RT Training - Boston, September 9-10
http://bestpractical.com/training

David Lane
Director
GoodChoice.IT Ltd

We reward successful referrals

W: www.goodchoice.it E: dave@goodchoice.it T: 020 8099 5540