- CheckMates
- :
- Products
- :
- Developers
- :
- API / CLI Discussion
- :
- What is the easiest way to get the number of objec...
- 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
What is the easiest way to get the number of objects for a specific type, e.g. hosts
What is the easiest way to get the number of objects for a specific type, e.g. hosts?
Especially if there are more than the current limit maximum value of 500?
I don't see easy commands like "get number of objects" or something like "show <objects> total"
This is what I found might work:
[Expert@X:0]# mgmt_cli login > id.txt
[Expert@X:0]# mgmt_cli show groups --format json -s id.txt | $CPDIR/jq/jq ".total"
171
And generating a variable would look like this:
[Expert@X:0]# total_groups=$(mgmt_cli show groups --format json -s id.txt | $CPDIR/jq/jq ".total")
[Expert@X:0]# echo "$total_groups"
171
Am I missing something here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
what about something like that:
# show objects order.1.ASC "name" type "host" --format json | $CPDIR/jq/jq ".total"
My env:
I have 1K hosts , I run the command and got:
1000
using show-objects with filter option
https://sc1.checkpoint.com/documents/latest/APIs/index.html#gui-cli/show-objects~v1.1
