- Products
- Learn
- Local User Groups
- Partners
- More
Quantum Spark Management Unleashed!
Introducing Check Point Quantum Spark 2500:
Smarter Security, Faster Connectivity, and Simpler MSP Management!
Check Point Named Leader
2025 Gartner® Magic Quadrant™ for Hybrid Mesh Firewall
HTTPS Inspection
Help us to understand your needs better
CheckMates Go:
SharePoint CVEs and More!
Hey guys,
Apologies if this may sound like a really silly question, but Im trying to figure out if Im doing this right. To make a long story short, I imported customer's config into my lab and trying to see if I can export large group with about 5000 IPs into csv format file via cli, but not having much luck so far. Below is command I ran:
mgmt_cli show group name "Block" > block.csv
It seems like it did take it and after I logged in, its just "sitting" there for 20 mins and file size is not moving at all.
If someone could confirm if this is correct, would be awesome.
Tx as always.
Andy
My colleague, who is Linux GENIUS (everyone says that about him), helped me figure it out. Anyway, creds are just my lab, so you get an idea 🙂
He will also send me info how he converted the file to fit into when you try import hosts into another mgmt.
mgmt_cli show group -u admin -p 'maxwe!!' name "Block" > blockips.csv --format json
Command to import the file:
mgmt_cli add host --batch block.csv
Example (it HAS TO look like something below)
#cat test.csv
name,ip-address
obj1,192.168.1.1
Btw, here is example how to get right file format that can be used right away to add via mgmt_cli:
example for hosts, but you get an idea for ranges or subnets:
mgmt_cli -r true show-group name "Block" --format json | jq '.members[] | [.name, ."ipv4-address"] | @csv' -r >> ip_block_test.csv
--->To add address-range via API:
mgmt_cli add address-range --batch address-ranges_full.csv
#cat address-ranges_full.csv
name,ip-address-first,ip-address-last
range1,10.0.0.0,10.0.0.100
---> To add a network via API:
mgmt_cli add network --batch networks.csv
#cat networks.csv
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
---> To add a host
mgmt_cli add host --batch test.csv
#cat test.csv
name,ip-address
obj1,192.168.1.1
Hope this saves a headache for whoever has to do this in the future 🙂
Andy
Hi Andy,
did you try to execute it without redirecting to a file?
what exactly do you want/need to achieve?
as output would be like this:
when having so much objects, maybe using async-response would help
Hey @Nüüül
Tx a lot for responding, appreciated! Yes, without redirecting to a file, works fine, but reason why I need a file is because we are trying to get right CSV file that can be imported into S1C portal for the customer, but only TAC can do it, since there is no regular ssh access.
Andy
OK, i would go with the web API - exporting all the objects and reimporting them to smart1cloud. As web API should still be there (another argument necessary "context" if i remember correctly)
Do you have an example? I tried exporting from smart console, but does NOT let you export only single group, even from object explorer : - (
Andy
how urgent is this? can send you something tomorrow if thats ok?
Its not urgent, no rush. Im just trying to see if I can get this exported from the lab, but so far, no luck.
Andy
Tx mate, will definitely test it Monday.
Have an awesome weekend 🙂
Andy
Thanks, you too..
additionally - i checked about the smart-1 cloud api. import to / export from there is possible, see README at the repo. it´s working - at least what i was able to test.
(currently only works with new to-create network objects/hosts. maybe will adjust that at a later moment. )
TAC told me as long as they can get right CSV file, they can import it easily, so I think we are good.
Tx a lot!
Andy
My colleague, who is Linux GENIUS (everyone says that about him), helped me figure it out. Anyway, creds are just my lab, so you get an idea 🙂
He will also send me info how he converted the file to fit into when you try import hosts into another mgmt.
mgmt_cli show group -u admin -p 'maxwe!!' name "Block" > blockips.csv --format json
Command to import the file:
mgmt_cli add host --batch block.csv
Example (it HAS TO look like something below)
#cat test.csv
name,ip-address
obj1,192.168.1.1
Btw, here is example how to get right file format that can be used right away to add via mgmt_cli:
example for hosts, but you get an idea for ranges or subnets:
mgmt_cli -r true show-group name "Block" --format json | jq '.members[] | [.name, ."ipv4-address"] | @csv' -r >> ip_block_test.csv
--->To add address-range via API:
mgmt_cli add address-range --batch address-ranges_full.csv
#cat address-ranges_full.csv
name,ip-address-first,ip-address-last
range1,10.0.0.0,10.0.0.100
---> To add a network via API:
mgmt_cli add network --batch networks.csv
#cat networks.csv
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
---> To add a host
mgmt_cli add host --batch test.csv
#cat test.csv
name,ip-address
obj1,192.168.1.1
Hope this saves a headache for whoever has to do this in the future 🙂
Andy
Leaderboard
Epsum factorial non deposit quid pro quo hic escorol.
User | Count |
---|---|
9 | |
9 | |
4 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |
Wed 10 Sep 2025 @ 11:00 AM (CEST)
Effortless Web Application & API Security with AI-Powered WAF, an intro to CloudGuard WAFWed 10 Sep 2025 @ 11:00 AM (EDT)
Quantum Spark Management Unleashed: Hands-On TechTalk for MSPs Managing SMB NetworksFri 12 Sep 2025 @ 10:00 AM (CEST)
CheckMates Live Netherlands - Sessie 38: Harmony Email & CollaborationWed 10 Sep 2025 @ 11:00 AM (EDT)
Quantum Spark Management Unleashed: Hands-On TechTalk for MSPs Managing SMB NetworksFri 12 Sep 2025 @ 10:00 AM (CEST)
CheckMates Live Netherlands - Sessie 38: Harmony Email & CollaborationAbout CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY