Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Netadmin2020
Collaborator

Mgmti_cli import new hosts to an existing group with csv

Hello,

I am trying to import from a csv with the below format:

 

name , ip-address, groups.1

server1, 10.100.12.1, Edge Servers

server2 , 10,100.12.92, Edge Servers

…..

name is the name of the host I want to import, ip-address is the ip of the host , groups.1 is the existing group that I need the new host to be added.

I tried multiple ways to make it happen but nothing worked.

mgmt_cli add host --batch rightone.csv

I received the below messages cause some of the hosts are already saved with other name I suppose.

 

Line 3xxxx: code: "err_validation_failed"

message: "Validation failed with 1 warning and 1 error"

warnings:

- message: "Multiple objects have the same IP address 10.1.21.82"

errors:

- message: "More than one object named 'server_sql' exists."

 

What can I do to resolve the problem?

 

 

0 Kudos
4 Replies
funkylicious
Advisor

hi,

you could try adding ignore-warnings, ignore-errors column and set them to true to the csv file.

 

 

ignore-warnings boolean
Default: false
Apply changes ignoring warnings.
ignore-errors boolean
Default: false
Apply changes ignoring errors. You won't be able to publish such a changes. If ignore-warnings flag was omitted - warnings will also be ignored.
Netadmin2020
Collaborator

I don't want to import duplicated hosts, If it is possible hosts that already exists imported to my group with their current name.

0 Kudos
funkylicious
Advisor

i think that you would need to sanitize the batch file with everything that's already created

0 Kudos
PhoneBoy
Admin
Admin

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events