<?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: ifconfig output differs from manual execution to script execution in Firewall and Security Management</title>
    <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/158994#M27786</link>
    <description>&lt;P&gt;I suspect you’re ultimately referencing a different ifconfig in your script:&amp;nbsp;&lt;BR /&gt;Use the command “which ifconfig” to see the precise location of the ifconfig binary you use on the CLI.&lt;BR /&gt;Use that in your script to ensure you are calling the same ifconfig binary.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2022 12:52:49 GMT</pubDate>
    <dc:creator>PhoneBoy</dc:creator>
    <dc:date>2022-10-07T12:52:49Z</dc:date>
    <item>
      <title>ifconfig output differs from manual execution to script execution</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/158992#M27785</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;I run a script every day on our VSX platform clusters with extracts a number of metrics for reporting about usage for each of our customers.&lt;/P&gt;&lt;P&gt;I wanted to expand the script to get the interface-values to make sure our documentation are up to date, but when I include this command to the bash-script:&lt;/P&gt;&lt;P&gt;ifconfig | grep -A1 Ethernet | grep -v '\-\-' | paste -sd ' \n' | awk '{ print $1","$7","$9 }' | awk -v vsname=$VS_NAME -F '[,:]' '{ print vsname","$1","$3"/"$5 }' &amp;gt;&amp;gt; /var/tmp/$Ldate-cp_facts_vs_interfaces_output-$1.txt&lt;/P&gt;&lt;P&gt;I get a different output, than if I run the command manually. The output in the script match what the \ifconfig puts out.&lt;/P&gt;&lt;P&gt;Example output:&lt;/P&gt;&lt;P&gt;Running command manually on a vs:&lt;/P&gt;&lt;P&gt;vs-customer1,bond1.3237,10.50.237.240/255.255.255.0&lt;BR /&gt;vs-customer1,bond3.1349,47.29.2.60/255.255.255.248&lt;BR /&gt;vs-customer1,wrp384,200.83.4.25/255.255.255.0&lt;/P&gt;&lt;P&gt;Running command in script on a vs:&lt;/P&gt;&lt;P&gt;vs-customer1,bond1.3237,100.127.48.1/255.255.255.240&lt;BR /&gt;vs-customer1,bond3.1349,100.127.48.17/255.255.255.240&lt;BR /&gt;vs-customer1,wrp384,100.127.48.33/255.255.255.240&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Do I need to set a parameter in the script for ifconfig to give me the correct output, like with using specific checkpoint commands in scripts: source /etc/profile.d/CP.sh; ?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 12:37:12 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/158992#M27785</guid>
      <dc:creator>ias_gc-dk</dc:creator>
      <dc:date>2022-10-07T12:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: ifconfig output differs from manual execution to script execution</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/158994#M27786</link>
      <description>&lt;P&gt;I suspect you’re ultimately referencing a different ifconfig in your script:&amp;nbsp;&lt;BR /&gt;Use the command “which ifconfig” to see the precise location of the ifconfig binary you use on the CLI.&lt;BR /&gt;Use that in your script to ensure you are calling the same ifconfig binary.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 12:52:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/158994#M27786</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2022-10-07T12:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: ifconfig output differs from manual execution to script execution</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159000#M27787</link>
      <description>&lt;P&gt;use "/sbin/ifconfig" in the script.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 13:52:08 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159000#M27787</guid>
      <dc:creator>JozkoMrkvicka</dc:creator>
      <dc:date>2022-10-07T13:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: ifconfig output differs from manual execution to script execution</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159132#M27820</link>
      <description>&lt;P&gt;Nope, that gives the undesired result.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 11:29:57 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159132#M27820</guid>
      <dc:creator>ias_gc-dk</dc:creator>
      <dc:date>2022-10-10T11:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: ifconfig output differs from manual execution to script execution</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159134#M27821</link>
      <description>&lt;P&gt;Running which in the command gives this:&lt;/P&gt;&lt;P&gt;# which ifconfig&lt;BR /&gt;alias ifconfig='/bin/cp-ifconfig.sh'&lt;BR /&gt;/bin/cp-ifconfig.sh&lt;/P&gt;&lt;P&gt;So its a CP-script. So perhaps I need the source /etc/profile.d/CP.sh;&amp;nbsp; in my script after all.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 11:31:34 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159134#M27821</guid>
      <dc:creator>ias_gc-dk</dc:creator>
      <dc:date>2022-10-10T11:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: ifconfig output differs from manual execution to script execution</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159148#M27826</link>
      <description>&lt;P&gt;Try adding&amp;nbsp;&lt;FONT color="#3366FF"&gt;source /etc/profile.d/vsenv.sh&lt;/FONT&gt; &lt;FONT face="helvetica" color="#000000"&gt;to your script.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 14:14:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159148#M27826</guid>
      <dc:creator>Alex-</dc:creator>
      <dc:date>2022-10-10T14:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: ifconfig output differs from manual execution to script execution</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159149#M27827</link>
      <description>&lt;P&gt;On VSX in interactive shells, 'ifconfig' is intercepted by the alias you saw above, which returns false results based on the cluster VIPs. Real 'ifconfig'—which your headless script is using—returns the real data.&lt;/P&gt;
&lt;P&gt;To get the fake data via your script, you can source&amp;nbsp;&lt;SPAN&gt;/etc/profile.d/CP.sh, then call&amp;nbsp;/bin/cp-ifconfig.sh instead of ifconfig.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Oct 2022 14:12:11 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159149#M27827</guid>
      <dc:creator>Bob_Zimmerman</dc:creator>
      <dc:date>2022-10-10T14:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: ifconfig output differs from manual execution to script execution</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159206#M27842</link>
      <description>&lt;P&gt;Nope, doesn't work either.&lt;/P&gt;&lt;P&gt;its source /etc/profile.d/CP.sh, then call /bin/cp-ifconfig.sh instead of ifconfig as Bob_Zimmerman describes.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 05:39:27 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159206#M27842</guid>
      <dc:creator>ias_gc-dk</dc:creator>
      <dc:date>2022-10-11T05:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: ifconfig output differs from manual execution to script execution</title>
      <link>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159207#M27843</link>
      <description>&lt;P&gt;This worked! Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 05:48:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/Firewall-and-Security-Management/ifconfig-output-differs-from-manual-execution-to-script/m-p/159207#M27843</guid>
      <dc:creator>ias_gc-dk</dc:creator>
      <dc:date>2022-10-11T05:48:53Z</dc:date>
    </item>
  </channel>
</rss>

