Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
MichaelGur
Explorer

how to find in which group a specific network object exists

Hello everyone

I need to find a Linux command with which I can see in which groups there is an object that I give like the existing function in the Smart-Console "where-used".

In addition I have found the command:

mgmt_cli -r true where-used name "host 5" details-level full

 from this link:

https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solut...

(This command's output gave me a lot of UIDs and etc.)
What this command is for? Is there an option to do what we want?

0 Kudos
2 Replies
PhoneBoy
Admin
Admin

That is the correct command.
The UIDs have to be dereferenced most likely, I.e. this will require some level of scripting.

0 Kudos
delToro1
Participant

Hello,

As PhoneBoy said, you could use that command. In addition, you can use JQ in order to filter your results and display only the fields you are interest in, like name, object type, etc.

 

Here you have an example of how to use it:

 

Command:

# mgmt_cli where-used name hostName --format json -s id.txt | jq -r '."used-directly".objects[] |["Name: " + .name,"Object Type: " + .type]'

 

Result:
[
"Name: Group1",
"Object Type: group"
]
[
"Name: Group2",
"Object Type: group"
]
[
"Name: Group3",
"Object Type: group"
]

0 Kudos