<?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: Getting error when running CPView in a bash script at the background in General Topics</title>
    <link>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/47330#M9233</link>
    <description>To be honest, I'm not familiar with the SNMP tools that are in-use today. They all require, at the very least, importing the MIB file. Beyond that, I defer to the rest of the community on their experience.</description>
    <pubDate>Mon, 18 Mar 2019 02:56:30 GMT</pubDate>
    <dc:creator>PhoneBoy</dc:creator>
    <dc:date>2019-03-18T02:56:30Z</dc:date>
    <item>
      <title>Getting error when running CPView in a bash script at the background</title>
      <link>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/46847#M9079</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Recently due to multiple performance issues on the Checkpoint VSX, we have been trying to set up more monitors on Checkpoint platform and one of them is to record the history data of CPView.&lt;/P&gt;&lt;P&gt;As all of you may already know cpview history cannot be well supported on VSX platform, we are now testing a bash script to export the output of "cpview -p" to one file with timestamp appended and save to one specific folder. Pretty straightforward. We can manually run the script and get the result, however when scheduling the script to run every minute via crontab, we are getting below error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT color="#800080"&gt;CPView: Failed windows size ioctl with 22, Invalid argument&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;We then updated the script by using "when true;do...done" loop and use "nohup script.sh &amp;gt; /PATH/TO/LOG 2&amp;gt;&amp;amp;1 &amp;amp;" to run it at the background. No luck and we are getting the same error as above"&lt;/P&gt;&lt;P&gt;We then run the script directly with "&amp;amp;", and then use the disown command to clear the job. Got the same error.&lt;/P&gt;&lt;P&gt;We then run the script directly with "&amp;amp;", and then use the disown command with -h option on the job. This time it worked fine until we closed the putty client.&lt;/P&gt;&lt;P&gt;From the tests above it looks like "CPView -p" relies on terminal. Anyone had the same experience? And in this case how we can record the cpview history?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 05:06:02 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/46847#M9079</guid>
      <dc:creator>David_Guan</dc:creator>
      <dc:date>2019-03-14T05:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when running CPView in a bash script at the background</title>
      <link>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/46872#M9090</link>
      <description>&lt;P&gt;We've "deprecated" cpview -p &lt;A href="https://community.checkpoint.com/t5/Developers-API-CLI/quot-cpview-p-quot-with-cprid-util-Failed-windows-size-ioctl/m-p/32630#M2007" target="_self"&gt;per this thread&lt;/A&gt;. You should be able to get the required data via SNMP.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 08:28:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/46872#M9090</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-03-14T08:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when running CPView in a bash script at the background</title>
      <link>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/46883#M9093</link>
      <description>Try to use "nohup script.sh &amp;gt;/dev/null 2&amp;gt;&amp;amp;1" and make sure the output of your commands are handled within the script.</description>
      <pubDate>Thu, 14 Mar 2019 08:47:42 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/46883#M9093</guid>
      <dc:creator>Maarten_Sjouw</dc:creator>
      <dc:date>2019-03-14T08:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when running CPView in a bash script at the background</title>
      <link>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/47323#M9229</link>
      <description>&lt;P&gt;Hi PhoneBoy,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for sharing this. Didn't know that "cpview -p" has been deprecated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could u pls also recommend which SNMP monitor tool natively works well with Checkpoint VSX platform supporting polling on VSX gateway and multiple VS without too much customisation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;</description>
      <pubDate>Sun, 17 Mar 2019 22:19:10 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/47323#M9229</guid>
      <dc:creator>David_Guan</dc:creator>
      <dc:date>2019-03-17T22:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when running CPView in a bash script at the background</title>
      <link>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/47324#M9230</link>
      <description>&lt;P&gt;Thanks will give it a try and let u know.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Mar 2019 22:20:18 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/47324#M9230</guid>
      <dc:creator>David_Guan</dc:creator>
      <dc:date>2019-03-17T22:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when running CPView in a bash script at the background</title>
      <link>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/47330#M9233</link>
      <description>To be honest, I'm not familiar with the SNMP tools that are in-use today. They all require, at the very least, importing the MIB file. Beyond that, I defer to the rest of the community on their experience.</description>
      <pubDate>Mon, 18 Mar 2019 02:56:30 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/47330#M9233</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-03-18T02:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when running CPView in a bash script at the background</title>
      <link>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/47354#M9235</link>
      <description>&lt;P&gt;Any SNMP platform should be good here. Do not forget to enable Check Point snmp daemon and to put snmp into vsx mode, as per documentation&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2019 06:31:23 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/47354#M9235</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2019-03-18T06:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error when running CPView in a bash script at the background</title>
      <link>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/55661#M11138</link>
      <description>&lt;P&gt;seems many people have had this issue over time, scripting cpview.&lt;/P&gt;&lt;P&gt;it appears to need a properly scoped tty to run happily. i have the following working, inside a script:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;for x in yourlistofvsids; do
export gVSID="$x";
bash -i -c 'source /home/admin/.bash_profile; \
		source /home/admin/.bashrc; \
		source /etc/profile.d/vsenv.sh; \
		vsenv $gVSID; \
		/bin/./cpview_start.sh -p &amp;gt; $gVSID.log';
done&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 02:52:42 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/General-Topics/Getting-error-when-running-CPView-in-a-bash-script-at-the/m-p/55661#M11138</guid>
      <dc:creator>Mario_Lucas</dc:creator>
      <dc:date>2019-06-13T02:52:42Z</dc:date>
    </item>
  </channel>
</rss>

