- Products
- Learn
- Local User Groups
- Partners
- More
MVP 2026: Submissions
Are Now Open!
What's New in R82.10?
10 December @ 5pm CET / 11am ET
Announcing Quantum R82.10!
Learn MoreOverlap in Security Validation
Help us to understand your needs better
CheckMates Go:
Maestro Madness
Hi All,
I'm trying to use 'mgmt_cli' to add multiple hosts to our management server (81.10). I'm following the format in the 'Management API Reference'. I've created a .csv file and tried to import using --batch:
[Expert@mgmt:0]# mgmt_cli add host --batch cli_mgmt_test.csv:
At first this failed with the following error
---------------------------------------------START
Time: [22:34:12] 1/4/2023
---------------------------------------------
"Publish operation" failed (100%)
Publish failed, the following error has occurred:
tasks:
- task-id: "01234567-89ab-cdef-bfad-4320b3d28dca"
task-name: "Publish operation"
status: "failed"
progress-percentage: 100
suppressed: false
task-details:
- fault-message: "Publish cannot be performed without entering a session name and description."
--------------------------------------------------END
So I altered the command to include the session description:
[Expert@mgmt:0]# mgmt_cli set session description "API Session test" add host --batch cli_mgmt_test.csv
This time it failed with the following error:
--------------------------------------------------START
Line 2: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [ip-address]"
Line 3: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [ip-address]"
Line 4: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [ip-address]"
Line 5: code: "generic_err_invalid_parameter_name"
message: "Unrecognized parameter [ip-address]"
Executed command failed. Changes are discarded.
--------------------------------------------------END
My .csv look like this:
[Expert@mgmt:0]# cat cli_mgmt_test.csv
name,ip-address,color,comments
net-test.svr.1,169.254.0.1,red,this is a test -- delete once complete
net-test.svr.2,169.254.0.2,red,this is a test -- delete once complete
net-test.svr.3,169.254.0.3,red,this is a test -- delete once complete
net-test.svr.4,169.254.0.4,red,this is a test -- delete once complete
Any ideas why its not liking the ip-address? I've also tried using 'ipv4-address' with same failure. I'm able to create the hosts directly on Smartconsole but want to know how to create hosts via a batch script.
Thanks in advance.
Hi All,
This took a little while to figure out as I'm quite new when it comes to APIs.
Anyway, after a bit more reading and playing around, I managed to figure it out -- as Im using 81.10, I have a windows version of mgmt_cli.exe so created a local script pointing to my management server with a local copy of the .csv file. Here is a copy of the working script:
----------------------START
mgmt_cli.exe login -u myusername -p mypassword -m [mgmt IP address] > C:\Users\username\Documents\id.txt
mgmt_cli.exe add host --batch C:\Users\username\Documents\cli-mgmt-test.csv -s C:\Users\username\Documents\id.txt
mgmt_cli.exe set session description "API Session Test" new-name "username@03042023" -s C:\Users\username\Documents\id.txt
mgmt_cli.exe publish -s C:\Users\username\Documents\id.txt
mgmt_cli.exe logout -s C:\Users\username\Documents\id.txt
----------------------END
Simple I know but chuffed to get this working -- can now build on this for all sorts of tasks.
Thanks all and hope someone finds this useful 🙂
Chris.
This should be two separate commands:
mgmt_cli set session description “API Test”
mgmt_cli add host --batch cli_mgmt_test.csv
Hi Phoneboy,
Just tried and get the following error on the first cmd:
--------------------------------------START
[Expert@mgmt:0]# mgmt_cli set session description “API Test”
Username: [myusername]
Password: [mypassword]
Error: The parameters of set-session command should be provided in pairs (key and value). You have provided an odd number of parameters which suggests that you are probably missing a parameter.
[Expert@mgmt:0]#
--------------------------------------END
Kind Rgds
Chris
See sk113078. Your csv filename shouldn't contain underscores.
Hi, I removed the underscores from the .csv but get the same issue.
Thanks
Hi All,
This took a little while to figure out as I'm quite new when it comes to APIs.
Anyway, after a bit more reading and playing around, I managed to figure it out -- as Im using 81.10, I have a windows version of mgmt_cli.exe so created a local script pointing to my management server with a local copy of the .csv file. Here is a copy of the working script:
----------------------START
mgmt_cli.exe login -u myusername -p mypassword -m [mgmt IP address] > C:\Users\username\Documents\id.txt
mgmt_cli.exe add host --batch C:\Users\username\Documents\cli-mgmt-test.csv -s C:\Users\username\Documents\id.txt
mgmt_cli.exe set session description "API Session Test" new-name "username@03042023" -s C:\Users\username\Documents\id.txt
mgmt_cli.exe publish -s C:\Users\username\Documents\id.txt
mgmt_cli.exe logout -s C:\Users\username\Documents\id.txt
----------------------END
Simple I know but chuffed to get this working -- can now build on this for all sorts of tasks.
Thanks all and hope someone finds this useful 🙂
Chris.
Leaderboard
Epsum factorial non deposit quid pro quo hic escorol.
| User | Count |
|---|---|
| 19 | |
| 19 | |
| 8 | |
| 7 | |
| 7 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
Fri 12 Dec 2025 @ 10:00 AM (CET)
Check Mates Live Netherlands: #41 AI & Multi Context ProtocolTue 16 Dec 2025 @ 05:00 PM (CET)
Under the Hood: CloudGuard Network Security for Oracle Cloud - Config and Autoscaling!Fri 12 Dec 2025 @ 10:00 AM (CET)
Check Mates Live Netherlands: #41 AI & Multi Context ProtocolTue 16 Dec 2025 @ 05:00 PM (CET)
Under the Hood: CloudGuard Network Security for Oracle Cloud - Config and Autoscaling!Thu 18 Dec 2025 @ 10:00 AM (CET)
Cloud Architect Series - Building a Hybrid Mesh Security Strategy across cloudsAbout CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY