<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can someone put together a script to delete automatically created networks? in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9532#M773</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could be. I only looked at 1.1 / R80.10 and that did not show those objects.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 05 Mar 2019 19:42:08 GMT</pubDate>
    <dc:creator>Kaspars_Zibarts</dc:creator>
    <dc:date>2019-03-05T19:42:08Z</dc:date>
    <item>
      <title>Can someone put together a script to delete automatically created networks?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9529#M770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Scripting gurus, should one of you have a chance, please help with the script for identification and deletion of the automatically created network objects.&lt;/P&gt;&lt;P&gt;These are created based on topology of the gateways and/or static routes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When "get interfaces with topology" is executed or when newly&amp;nbsp;deployed gateway objects with static routes are created, number of networks starting with "Net_" are created that is impossible to delete from SmartConsole, but are present and visible in the group membership selection window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suspect that the script to identify and remove those will be welcome, especially if it could differentiate between automatically created objects and those defined manually or via scripts, even if using same prefix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vladimir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Mar 2019 14:43:23 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9529#M770</guid>
      <dc:creator>Vladimir</dc:creator>
      <dc:date>2019-03-04T14:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone put together a script to delete automatically created networks?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9530#M771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;They are kept there for revision rollbacks so probably not too smart to delete them.. But otherwise you would have to use dbedit commands as API does not show "hidden" networks created by automatic topology process. If you look at this bit "cdm_auto_calculated", true will hide the object from being visible in console / API&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="195" src="https://community.checkpoint.com/legacyfs/online/checkpoint/79791_pastedImage_1.png" width="590" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you can list all the "invisible" networks&amp;nbsp;that are not used in any groups using this one-liner &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;names=($(echo -e "query network_objects,cdm_auto_calculated='true'\n-q\n" | dbedit -local | grep "Object Name:" | sed 's/Object Name: //')); for name in "${names[@]}"; do if [ `echo -e "whereused network_objects $name\n-q\n" | dbedit -local | grep -c "Numebr of results: 0"` -eq 1 ] &amp;amp;&amp;amp; [ `echo -e "print network_objects $name\n-q\n" | dbedit -local | grep -c "type: group"` -eq 0 ]; then echo $name; fi; done&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will be fairly slow as it's running dbedit commands. To delete you will have to replace last echo used to print out with&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;echo -e "delete network_objects $name\n-q\n" | dbedit -local&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would not run it in production without lab testing. Worked OK on some CMAs that i tried on &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2019 15:22:44 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9530#M771</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2019-03-05T15:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone put together a script to delete automatically created networks?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9531#M772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jeez, Kaspars, that one-liner wouldn't fit in a twitter post &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.checkpoint.com/migrated-users/2075"&gt;Dameon Welch-Abernathy&lt;/A&gt;&amp;nbsp;claims that these objects could be deleted via API. I'd like to hear from him if the deletion requires manual definition of the objects or if 1.3 allows us to pull those out and feed them into delete object.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2019 15:42:37 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9531#M772</guid>
      <dc:creator>Vladimir</dc:creator>
      <dc:date>2019-03-05T15:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone put together a script to delete automatically created networks?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9532#M773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could be. I only looked at 1.1 / R80.10 and that did not show those objects.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Mar 2019 19:42:08 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9532#M773</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2019-03-05T19:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone put together a script to delete automatically created networks?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9533#M774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to do it in R80.10 from the CLI, (and thus the API) as I recall.&lt;/P&gt;&lt;P&gt;Haven't seen the issue again to validate.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2019 06:45:07 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9533#M774</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-03-06T06:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone put together a script to delete automatically created networks?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9534#M775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;100% correct - it was only Console that hides some nets, not API. So I can take my words back &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/79820_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whereas API and dbedit return two extra&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/79821_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it is visible in the group it's used in Console&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/79823_pastedImage_5.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this a Console bug Dameon? I know it worked OK in R77.30 &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.checkpoint.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2019 07:43:42 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9534#M775</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2019-03-06T07:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone put together a script to delete automatically created networks?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9535#M776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess the only limitation with API is that we cannot see if network was created by topology generation process:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/79825_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;compare to dbedit:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/79829_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2019 09:49:25 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9535#M776</guid>
      <dc:creator>Kaspars_Zibarts</dc:creator>
      <dc:date>2019-03-06T09:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone put together a script to delete automatically created networks?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9536#M777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vladimir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd like to refer you to &lt;A href="https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&amp;amp;solutionid=sk126872"&gt;sk126872 &lt;/A&gt;id you have not read it yet. It is important to understand why these objects are exist and make sure you do not use them before you delete them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can contact Check Point support in order to get this done.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2019 17:42:10 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9536#M777</guid>
      <dc:creator>Ari_Heber</dc:creator>
      <dc:date>2019-03-06T17:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone put together a script to delete automatically created networks?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9537#M778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you &lt;A href="https://community.checkpoint.com/migrated-users/58080"&gt;Ari Heber&lt;/A&gt;‌. Unfortunately, these objects are being created not only when you perform "Get Interfaces with Topology" , but as I have described earlier, also during creation of the gateway objects with static routes already pre-provisioned.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These network objects are conflicting with scripted ingestion of the actual network objects with intended properties defined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to know is that if it is safe to delete those using Kaspar's suggested one-liner if they are NOT used in the topologies of the gateways (i.e. topology of each was re-defined manually with custom groups containing manually created networks).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In a situation where multiple gateways destined for different sites, it is necessary to provision them with routes allowing communication with the management server.&lt;/P&gt;&lt;P&gt;Changing their properties individually via GuiDBedit is not really a viable option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vladimir&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2019 19:07:39 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9537#M778</guid>
      <dc:creator>Vladimir</dc:creator>
      <dc:date>2019-03-06T19:07:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone put together a script to delete automatically created networks?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9538#M779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vladimir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These 2 flows are actually the same flow; when initializing a SIC with remote gateway the interfaces and the routes are fetched automatically by the management (same as in Get Interfaces With Topology).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the one-liner command is quite safe, the operation will fail if the object is used by an interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2019 19:01:05 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/9538#M779</guid>
      <dc:creator>Ari_Heber</dc:creator>
      <dc:date>2019-03-07T19:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can someone put together a script to delete automatically created networks?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/152828#M6976</link>
      <description>&lt;P&gt;Does anyone know how to simply disable the auto-creation of these objects? These objects pollute our database too much, especially when we have more than 300 GW.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2022 18:25:31 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Can-someone-put-together-a-script-to-delete-automatically/m-p/152828#M6976</guid>
      <dc:creator>Maxim_Tremblay</dc:creator>
      <dc:date>2022-07-12T18:25:31Z</dc:date>
    </item>
  </channel>
</rss>

