cancel
Showing results for 
Search instead for 
Did you mean: 
Post a Question
Highlighted
J_Saun
Nickel

Show total number of objects in database

Jump to solution

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

Re: Show total number of objects in database

Jump to solution

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
3 Replies

Re: Show total number of objects in database

Jump to solution

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
Nickel

Re: Show total number of objects in database

Jump to solution

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

Re: Show total number of objects in database

Jump to solution

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