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

find duplicate host and network and service objects in Checkpoint SMC and delete if not used

Hello,

I would like help to find duplicate host and network and service objects in Checkpoint SMC and delete if not used. how can we achieve that using API?

thanks

0 Kudos
1 Solution

Accepted Solutions
Tomer_Noy
Employee
Employee

Assuming that the use-case is to "tidy" your environment from unused objects, you can use the Object Explorer in the SmartConsole application. Pop out the full dialog via the toolbar button, then select "Unused Objects" in the top left filter.

This will show all unused objects (it's similar to going through every object and doing "Where Used"). You can verify each one and delete them. It will show both duplicates or unique objects that aren't in use, but you probably want to clean up both types.

ObjectExplorer Pane.png

ObjectExplorer Unused Objects.png

View solution in original post

0 Kudos
4 Replies
PhoneBoy
Admin
Admin

You'd have to pull the entire object database (by type) and find the duplicates manually.
You can use the 'where-used' API to ensure nothing is using that object before deletion: https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/where-used~v1.9%20 

0 Kudos
knassif
Explorer

is there a script available that does already that? how do I pull the database with api? we would need to do a duplicate check first how to achive that in api? then we do the where used I think?thx

0 Kudos
PhoneBoy
Admin
Admin

I haven't seen a script that does that.
You'd have to pull the different object types, such as:

Note that these endpoints will return a limited number of results.
You may need to iterate with the offset parameter to capture all the results.

Your script would have to figure out which of the objects are duplicates according to your logic.
You'd also have to call where-used for each object to see what results are returned.

Bottom line: this will require some development work.

0 Kudos
Tomer_Noy
Employee
Employee

Assuming that the use-case is to "tidy" your environment from unused objects, you can use the Object Explorer in the SmartConsole application. Pop out the full dialog via the toolbar button, then select "Unused Objects" in the top left filter.

This will show all unused objects (it's similar to going through every object and doing "Where Used"). You can verify each one and delete them. It will show both duplicates or unique objects that aren't in use, but you probably want to clean up both types.

ObjectExplorer Pane.png

ObjectExplorer Unused Objects.png

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events