- CheckMates
- :
- Products
- :
- Quantum
- :
- Management
- :
- Best way to add Object host name in the Group??
- 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
Best way to add Object host name in the Group??
Hi Everyone,
I've been tasked to add over 100+ object host names in the group.
Now some of the object names (host) does exist but through scripting how is it possible that if a written script does not create one that already in the Object database.
I have looked few options, through Management CLI is easy...
1 - # add host name myHost ip-address 192.168.0.100
or
2 - # add group name myGroup members.1 myHost1 members.2 myHost2
Through number 2 statement above, can I create a script where it does not create where it exists already?
I have tried also that, if I break second line command in 10 members host and run it then "add group" does give an error that this group name exists already.
REST api could be an option but through cli with for loop or if conditions .. is there anything available?
Regards,
B
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the case of "add host" command, you can use the "set-if-exists" parameter with value "true" and it will override an existing host with the new values.
In the case of "add group" command, there is no such parameter. You can call the "show group" command and check if the return value is 1 - group doesn't exist.
Robert.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Rob,
Is there a way that we can add host object in the existing group?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Of course, there is a "set-group" command to update an existing group object -
https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/set-group~v1.2%20
For example-
mgmt_cli set group name "my_group" members.add.1 "host1" members.add.2 "host2" members.add.3 "host3"
Robert.
