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

Basic problem with adding a host in an MDS via mgmt_cli

Hi, I'm trying to do some batch imports from one domain to another, but I'm having a strange issue out of the gate. When I do a simple "mgmt_cli add", it adds an object to the "MDS" domain instead of the "Core" domain I'm trying to get.

[Expert@mds-1:0]# mgmt_cli login user [me] domain Core
Password:
uid: "b1f49fd8-daa1-4d0c-ad3e-38f57e75b1b1"
sid: "zQtNUq5L8HG_QI5Zk5v4Vl684kcPezUlG9S2Ef37IaE"
url: "https://127.0.0.1:443/web_api"
session-timeout: 600
last-login-was-at:
posix: 1568061885668
iso-8601: "2019-09-09T13:44-0700"
api-server-version: "1.1"

[Expert@mds-1:0]# mgmt_cli add host name blah ipv4-address 1.2.3.4
Username: [me]
Password:


---------------------------------------------
Time: [13:55:31] 19/9/2019
---------------------------------------------
"Publish operation" succeeded (100%)
[Expert@mds-1:0]# mgmt_cli publish
Username: bcotter
Password:


---------------------------------------------
Time: [13:57:04] 19/9/2019
---------------------------------------------
"Publish operation" succeeded (100%)
tasks:
- task-id: "01234567-89ab-cdef-a3c4-f6cd65a7062f"
task-name: "Publish operation"
status: "succeeded"
progress-percentage: 100
suppressed: false
task-details:
- publishResponse:
numberOfPublishedChanges: 0
revision: "90f810f4-7130-4122-a704-f40810b20fb8"

The object doesn't show up in the Core domain, but rather ends up getting created in "MDS," which I didn't even know had an object database. I'm attaching the audit log from SmartConsole.

What did I do wrong?

 
0 Kudos
1 Solution

Accepted Solutions
Brandon_Cotter
Contributor

Figured it out from https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/multidomain-and-mgmt-cli/m-p/2801...

I was not referencing a session file. Adding "> id.txt" to the "mgmt_cli login" command, and "-s id.txt" to the "mgmt_cli add" command had the desired results.

View solution in original post

0 Kudos
2 Replies
Brandon_Cotter
Contributor

Figured it out from https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/multidomain-and-mgmt-cli/m-p/2801...

I was not referencing a session file. Adding "> id.txt" to the "mgmt_cli login" command, and "-s id.txt" to the "mgmt_cli add" command had the desired results.

0 Kudos
Norbert_Bohusch
Advisor
Correct, if you do not reference the session you opened with "login", it creates a new session, which in your case was going to MDS then and every command without login or session-id set, will do it's own login/<whatever you specified/publish/logout.
0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events