- CheckMates
- :
- Products
- :
- Developers
- :
- API / CLI Discussion
- :
- Re: Remove member from a group via "add host" comm...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Remove member from a group via "add host" comment
Hi all,
I'm testing a csv files to modify multiple host by "add host" comments.
ex : mgmt_cli add host -b test.scv
I agree that I need to create the group first.
the csv file can be run.
but If I want to modify a host let it remove from a group.
Which "character" I need to fill in group column ?
It looks like only can run A group move to B group.
Any suggestion ?
put "Double quotes" in the comments column that can remove the comments contents.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You cannot remove an object from the group this way. You can probably remove objects from a group by using set group command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You cannot remove an object from the group this way. You can probably remove objects from a group by using set group command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
that right, it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can use the set group command or set host commands
https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/set-group~v1.8%20
https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/set-host~v1.8%20
More section
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you're importing the second CSV with the cli command mgmt_cli add host -b test.scv, that's not going to work as it is not possible to change an object's group by using the "add-host" API endpoint.
You would need a differently constructed CSV for this purpose as well as a different command (e.g. mgmt_cli set host -b test.csv).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just test it again by demo mode (R81.10)
It works for "change group" via add-host comment by a csv file.
I think that is why I want to remove a members(host) from a group (Does not belong anyone) through add-host comments with a csv file.
the Audit log show as below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That seems like unexpected behavior (changing a group membership via add host).
@Omer_Kleinstern ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The field "set-if-exists" is used which makes it a set-host command and not add-host.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'll try it on CheckMates-Labs later.🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I launch a Lab to testing again, the testing result show as before.
the comment "add host" with a csv file could move object from groupA to groupB
[A&B gruop need exist first]
