Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
israelgl
Participant
Jump to solution

adding network object with mgmt_cli batch CSV file

i try to add number of network object with cli tool but i received an error.

i followed sk113078 and did exactly the same and received the error:

Line 2: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [name]"

Line 3: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [name]"

Line 4: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [name]"


Executed command failed. Changes are discarded.

 

the csv is:

name,subnet,subnet-mask
network1,10.10.10.0,255.255.255.0
network2,20.20.20.0,255.255.255.0
network3,30.30.30.0,255.255.255.0

 

 

i have R80.20 take: 103

0 Kudos
1 Solution

Accepted Solutions
PhoneBoy
Admin
Admin
This seems like a bug to me.
In R80.30, the above works using both the 1.5 (R80.30) and 1.3 (R80.20) versions of the API.
Suggest opening a TAC case.

View solution in original post

0 Kudos
(1)
13 Replies
Martin_Valenta
Advisor
what's the command syntax which you use to do batch work?
0 Kudos
israelgl
Participant

mgmt_cli add network --batch network.csv

0 Kudos
Maik
Advisor
Sounds like a bug to be honest. Without being able to test it on my own it seems like you specified everything in the correct way. Could you try to run the same command with "--version 1.1" in the end to force the API down to version 1.1? I used this command before and I'm quite sure that it worked. Also; do you experience this issue only via the batch mode or also via "manually" creating one network with the specified parameters?
0 Kudos
israelgl
Participant

i tried with "--version 1.1", same error.

manually adding with "mgmt_cli", works fine.

0 Kudos
Maarten_Sjouw
Champion
Champion
The actual problem here was that you did not use the full path for the csv file. A very common error.
Regards, Maarten
0 Kudos
PhoneBoy
Admin
Admin
This seems like a bug to me.
In R80.30, the above works using both the 1.5 (R80.30) and 1.3 (R80.20) versions of the API.
Suggest opening a TAC case.
0 Kudos
(1)
FMU
Explorer

I had the same issue on R80.10 with --version 1.1 and on R80.30 with --version 1.1, 1.5, 1.6

Constructing the command and "eval"ing it solved it:

<code>

#!/bin/bash

(...)

COMMAND="mgmt_cli add network (...)"

eval $COMMAND

</code>

 

 

 

0 Kudos
LaurentFr
Participant

I think, you create the file on a windows OS. I have the same issue when i create a file on a windows os and then put the file on the  management server. To bypass this problem i copy the text on a clippoard and then i create a file by utility vi on the management server then i do a paste in the file (by vi). Maybe you can use the utility dos2unix on the server management to convert the windows file ?

israelgl
Participant

I just used WinSCP and changed the file encoding.

It fixed the problem for me.

anandkochar123
Explorer

Can you please elaborate the solution 

What exactly you did to resolve this 

 

Thanks in advance

0 Kudos
Yar_Ko
Explorer

Checked on 81.10

Example:
name,ip-address,color,comments
1.1.1.1,1.1.1.1,blue,test

UTF-8-BOM

cd /tmp
cat > test.csv
CTRL+C
vi test.csv
Press I
Copy your list of hosts and press ESC, then :wq
Checking the file cat test.csv
If everything is ok, publish
mgmt_cli add host --batch test.csv

P.S. Requires UTF-8-BOM encoding (at least on 81.10)
and do not use name/host in the file name.

P.S.S. if you need to add a network, then the subnet and mask-length columns and the publish command mgmt_cli add network --batch test.csv are added

0 Kudos
Maarten_Sjouw
Champion
Champion

In your example you use 1.1.1.1 as the name, you're not allowed to use numbers to start the name with. Minor detail.

Regards, Maarten
0 Kudos
vishardb
Participant

Logged in just to say thank you for this!

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events