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

Show total number of objects in database

Is there a way from either the command line or in the gui to show the total number of objects in the objects_5_0.C file? Specifically for R65 and R77.

 

Thx

1 Solution

Accepted Solutions
JozkoMrkvicka
Authority
Authority

Hi,

 

For SMS via CLI:

cat $FWDIR/conf/objects_5_0.C | grep -c ":table ("

 

For MDS via CLI:

mdsenv <DOMAIN_NAME>
cat $FWDIR/conf/objects_5_0.C | grep -c ":table ("

 

If needed, you can search for a specific table, like network_objects (for all network objects) or services (for all services).

echo -n "There are ";cat $FWDIR/conf/objects_5_0.C | grep -c ":table (network_objects)" | tr -d "\n"; echo " network objects."

Output:

image.png

Kind regards,
Jozko Mrkvicka

View solution in original post

3 Replies
JozkoMrkvicka
Authority
Authority

Hi,

 

For SMS via CLI:

cat $FWDIR/conf/objects_5_0.C | grep -c ":table ("

 

For MDS via CLI:

mdsenv <DOMAIN_NAME>
cat $FWDIR/conf/objects_5_0.C | grep -c ":table ("

 

If needed, you can search for a specific table, like network_objects (for all network objects) or services (for all services).

echo -n "There are ";cat $FWDIR/conf/objects_5_0.C | grep -c ":table (network_objects)" | tr -d "\n"; echo " network objects."

Output:

image.png

Kind regards,
Jozko Mrkvicka
J_Saun
Contributor

Thanks Jozko. That worked perfectly and was exactly what I needed.

JozkoMrkvicka
Authority
Authority

Glad that I helped 🙂

Another way is to use a command 'cpmiquerybin' which is capable to do more stuff like finding all network ranges, all TCP ports, all time objects and so on.

Kind regards,
Jozko Mrkvicka
0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events