Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
KeonNg
Participant

How to import multiple objects using Mgmt_CLI through CSV files

Hi All,

 

I was trying to import hundreds of host object to a group using CSV files via command mgmt_cli. However, most of the time when I try to run the command, and after enter the password, it does not show any output or response.

 

At first I'm thinking whether the files consist of too much of IP list which cause the system hang/fail to process it. Therefore, I break to several files which lesser IP (50 IPs per csv files) and somehow it is working for sometimes but not success all the time. And the weird thing is I do tried to import csv files that consists of IP more than that (about 100+ IPs) and it is import successfully but not success all the time. So that I conclude that might not because of too much of IPs that need to add in the csv files.

 

And when I check on the Smartconsole, I did see the session of Management API changes report is already import all the objects insides. Therefore, currently my work around is after ran the command in CLI to import, then go to Smartconsole and take over the session and publish. 

 

Command that I run as below:

dos2unix * * 

mgmt_cli add host --batch /home/admin/tmp/xxx.csv

 

 

Kindly please advise for this weird behavior. Any solution for this? Or did I do any steps wrongly? 

 

 

Quantum Security Management API and CLI Discussion SmartConsole Extensions 

 

Best Regards,

Keon

0 Kudos
4 Replies
AkosBakos
Leader Leader
Leader

Hi @KeonNg 

Did you try #mgmt_cli publish command?

https://sc1.checkpoint.com/documents/latest/APIs/#cli/publish~v1.9.1%20

I think this is what is missing. 🙂

Akos

 

----------------
\m/_(>_<)_\m/
0 Kudos
KeonNg
Participant

Hi Akos,

 

The command supposed to auto publish after it import the object successfully. Please find the attached for the example of success scenario, it won't stuck after entering the password and it will show the progress output and publish.

 

 

 

Best Regards,

Keon

0 Kudos
AkosBakos
Leader Leader
Leader

Hi @KeonNg 

Did you tried in to log the process?

[--log-file]
Path to the debugging log file.
Default {mgmt_cli.log}
Environment variable: MGMT_CLI_LOG_FILE

 

Akos

----------------
\m/_(>_<)_\m/
0 Kudos
PhoneBoy
Admin
Admin

The only time mgmt_cli will “auto publish” is when used with -r true.
Otherwise you must use an explicit publish action. 

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events