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

Remove member from a group via "add host" comment

Jump to solution

Hi all,

I'm testing a csv files to modify multiple host by "add host" comments.
ex : mgmt_cli add host -b test.scv

P1.jpg

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.

P2.jpg

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.

 

0 Kudos
1 Solution

Accepted Solutions
_Val_
Admin
Admin

You cannot remove an object from the group this way. You can probably remove objects from a group by using set group command.

View solution in original post

9 Replies
_Val_
Admin
Admin

You cannot remove an object from the group this way. You can probably remove objects from a group by using set group command.

vavava
Participant

that right, it works.

0 Kudos
PhoneBoy
Admin
Admin

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).

0 Kudos
vavava
Participant

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.
P3.jpg

the Audit log show as below

P5.jpg

P4.jpg

0 Kudos
PhoneBoy
Admin
Admin

That seems like unexpected behavior (changing a group membership via add host).
@Omer_Kleinstern ?

0 Kudos

The field "set-if-exists" is used which makes it a set-host command and not add-host.

0 Kudos
vavava
Participant

I'll try it on CheckMates-Labs later.🙂

0 Kudos
vavava
Participant

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]

 

0 Kudos