<?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: script is producing garbage at end in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4834029#M641722</link>
    <description>&lt;P&gt;Thank you all, you have provided some more ideas for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My suspicions are with the nrpe agent on the HPUX systems. I did download the source and compile on HP using the HP compiler.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can run similar sar commands via nrpe to Linux systems without the funky output. And I can run the same command locally without the funky output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried redirecting, no joy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jul 2011 15:03:11 GMT</pubDate>
    <dc:creator>Rick Garland</dc:creator>
    <dc:date>2011-07-20T15:03:11Z</dc:date>
    <item>
      <title>script is producing garbage at end</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4832295#M641717</link>
      <description>&lt;P&gt;Hi all:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using nagios 3.2.3 to monitor services. Trying to run a script for monitoring. Problem is that on HPUX 11.23 &amp;amp; 11.31 systems the script produces garbage output at the end. Example, here is the script&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;#!/bin/ksh&lt;/LI&gt;&lt;LI&gt;WAITIO=`sar -i 1 3 | tail -1 | awk '{print $4}'`&lt;/LI&gt;&lt;LI&gt;CRIT=50&lt;/LI&gt;&lt;LI&gt;echo "%waitio = $WAITIO | /=$WAITIO%;;$CRIT;0;100"&lt;/LI&gt;&lt;LI&gt;exit 0&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;And the output&lt;/P&gt;&lt;P&gt;[nagios@nagserver ~]$ check_nrpe -H hostname -c 'check_HPwait'&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;%waitio = 6 | /=6%;;50;0;100&lt;/LI&gt;&lt;LI&gt;��w���&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;See that garbage at the end? How do I prevent that from happening on the HP systems?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2011 14:43:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4832295#M641717</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2011-07-19T14:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: script is producing garbage at end</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4832625#M641718</link>
      <description>&lt;P&gt;Hi Rick:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.hpe.com/t5/user/viewprofilepage/user-id/614139"&gt;@Rick Garland&lt;/a&gt; wrote:&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;��w���&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;See that garbage at the end? How do I prevent that from happening on the HP systems?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;It's not clear to me if this is a mangled representation on the new Forum or not.&amp;nbsp; Could you show us what you have pasted into a code-block to prevent interpretation?&amp;nbsp; Could you pipe your script's output into 'cat -etv' or 'od -tax2' please?&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;Regards!&lt;/BLOCKQUOTE&gt;&lt;BLOCKQUOTE&gt;...JRF...&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 19 Jul 2011 19:24:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4832625#M641718</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-07-19T19:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: script is producing garbage at end</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4832631#M641719</link>
      <description>&lt;P&gt;i wonder if the problem isn't actually over on the nagios server.&amp;nbsp; this line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %waitio = 6 | /=6%;;50;0;100﻿&lt;/P&gt;&lt;P&gt;has a very nagios-look to it and running the bit of script by-hand on hpux doesn't produce any strange characters (at least for me).&amp;nbsp; is 'waitio' a(nother) nagios script?&amp;nbsp; are the spaces before/after the 1st equal sign problematic?&amp;nbsp; or even all the spaces on that line?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2011 19:32:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4832631#M641719</guid>
      <dc:creator>donna hofmeister</dc:creator>
      <dc:date>2011-07-19T19:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: script is producing garbage at end</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4832647#M641720</link>
      <description>&lt;P&gt;There should be no output after your last echo.&lt;/P&gt;&lt;P&gt;Unless that sar call is sending output to stderr?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why don't you redirect your stdout and stderr for your script and see where the garbage goes?&lt;/P&gt;&lt;P&gt;your-script &amp;gt; stdout 2&amp;gt; stderr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise tusc is your friend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2011 19:53:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4832647#M641720</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-07-19T19:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: script is producing garbage at end</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4834011#M641721</link>
      <description>The piped output&lt;BR /&gt;&lt;BR /&gt;[nagios@nagserver libexec]$ check_nrpe -H hostname -c 'check_HPwait' | cat -etv&lt;BR /&gt;%waitio = 2 | /=2%;;50;0;100^M$&lt;BR /&gt;$&lt;BR /&gt;M-(wM-}M-3M-^XwM-}M-3M-^X@^AM-_M-l@$&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Jul 2011 14:53:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4834011#M641721</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2011-07-20T14:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: script is producing garbage at end</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4834029#M641722</link>
      <description>&lt;P&gt;Thank you all, you have provided some more ideas for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My suspicions are with the nrpe agent on the HPUX systems. I did download the source and compile on HP using the HP compiler.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can run similar sar commands via nrpe to Linux systems without the funky output. And I can run the same command locally without the funky output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried redirecting, no joy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2011 15:03:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4834029#M641722</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2011-07-20T15:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: script is producing garbage at end</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4834071#M641723</link>
      <description>&lt;P&gt;Hi (again) Rick:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suppose we could band-aid the wound:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# check_nrpe -H hostname -c 'check_HPwait' ﻿| perl -pe 's/[^([:print:]|[:space:]]//g'﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...JRF...&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2011 15:28:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4834071#M641723</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2011-07-20T15:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: script is producing garbage at end</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4834305#M641724</link>
      <description>&lt;P&gt;&amp;gt;I did download the source and compile on HP using the HP compiler.﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then dust off your debugger and find that print at the end.&lt;/P&gt;&lt;P&gt;tusc could be used to see if that garbage is a separate write or part of a buffer.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2011 17:25:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4834305#M641724</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-07-20T17:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: script is producing garbage at end</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4836999#M641725</link>
      <description>&lt;P&gt;Hi all:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the band aid; perl, sed, tr - still there.&lt;/P&gt;&lt;P&gt;Interesting, I did find that if I nest the command in a conditional of some sort, ( if,then ) then the output is clean.&lt;/P&gt;&lt;P&gt;Example;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;!/bin/ksh&lt;/LI&gt;&lt;LI&gt;CRIT=50&lt;/LI&gt;&lt;LI&gt;WAITIO=`sar -i 1 3 | tail -1 | awk '{print $4}'`&lt;/LI&gt;&lt;LI&gt;if [ "$WAITIO" -ge "$CRIT" ]&lt;/LI&gt;&lt;LI&gt;then&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; echo "%waitio = $WAITIO | /=$WAITIO%;;$CRIT;0;100"&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; exit 2&lt;/LI&gt;&lt;LI&gt;else&lt;/LI&gt;&lt;LI&gt;&amp;nbsp; echo "%waitio = $WAITIO | \=$WAITIO%;;$CRIT;0;100"&lt;/LI&gt;&lt;LI&gt;fi&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;﻿Run the command and pipe through 'cat -etv' and all that's left is a $ sign at the end of the output, the rest of the garbage is gone. Any idea why this might be?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tusc is definitely an option I should explore. And definitely one I should have in my toolbox.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2011 14:11:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4836999#M641725</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2011-07-22T14:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: script is producing garbage at end</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4837323#M641726</link>
      <description>&lt;P&gt;&amp;gt;I did find that if I nest the command in a conditional of some sort﻿&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only difference is that exit.&amp;nbsp; Do you cover both paths and both eliminate the garbage?&lt;/P&gt;&lt;P&gt;Make sure you print out the exit status of each run or change the one of the messages.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2011 21:02:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-is-producing-garbage-at-end/m-p/4837323#M641726</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-07-22T21:02:57Z</dc:date>
    </item>
  </channel>
</rss>

