<?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: Nagios script output issue in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680190#M658664</link>
    <description>Hi Allan:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; and the output line says "Application is" and not even "Application is ERROR" or "Application is FATAL".&lt;BR /&gt;&lt;BR /&gt;Then your 'STATUS' variable is empty.  That is, there was no match (or the 'curl' returned nothing).&lt;BR /&gt;&lt;BR /&gt;As an aside you can eliminate the extra process (the 'grep') and let 'awk' to all the work:&lt;BR /&gt;&lt;BR /&gt;# STATUS=`curl -s $URL|awk -F\" '/summary/ {print $2}'`&lt;BR /&gt;&lt;BR /&gt;...which is better written without the backticks but as $( ... ) like:&lt;BR /&gt;&lt;BR /&gt;# STATUS=$(curl -s $URL|awk -F\" '/summary/ {print $2}')&lt;BR /&gt;&lt;BR /&gt;Lastly, you have a large number of questions with unassigned points (166 of 285 responses). It would be appreciated if you could evaluate the help you received.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/pageList.do?userId=CA1505975&amp;amp;listType=unassigned&amp;amp;forumId=1" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/pageList.do?userId=CA1505975&amp;amp;listType=unassigned&amp;amp;forumId=1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
    <pubDate>Fri, 27 Aug 2010 10:56:15 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2010-08-27T10:56:15Z</dc:date>
    <item>
      <title>Nagios script output issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680187#M658661</link>
      <description>Hi Folks,&lt;BR /&gt;&lt;BR /&gt;Nagios is acting a little weird for me, I have this external script which I hooked into Nagios, it merely does a curl/wget on a URL and returns the status based on string in the content/output. Initially for 2-3 hrs the script returns the right status and Nagios reports correctly i.e. OK, WARN, ERROR based on the exit from the script. After 2-3 hrs output which was (and should be) OK or WARN starts returning CRITICAL and the output line says "Application is" and not even "Application is ERROR" or "Application is FATAL".&lt;BR /&gt;&lt;BR /&gt;There is nothing in the logs to suggest what could be the problem. Have you experienced this before and let me know the corrective action. I am running Nagios on Mac OSX.&lt;BR /&gt;&lt;BR /&gt;Here is the script for the curious -&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;&lt;BR /&gt;read URL &amp;lt; "$1"&lt;BR /&gt;&lt;BR /&gt;STATUS=`curl -s $URL |grep summary|awk -F\" '{print $2}'`&lt;BR /&gt;echo "Application is $STATUS"&lt;BR /&gt;echo "curl $URL"&lt;BR /&gt;&lt;BR /&gt;case $STATUS in&lt;BR /&gt;OK)&lt;BR /&gt;   exit 0&lt;BR /&gt;   ;;&lt;BR /&gt;WARN)&lt;BR /&gt;  exit 1&lt;BR /&gt;  ;;&lt;BR /&gt;ERROR)&lt;BR /&gt;  exit 2&lt;BR /&gt;  ;;&lt;BR /&gt;FATAL)&lt;BR /&gt;  exit 2&lt;BR /&gt;  ;;&lt;BR /&gt;*)&lt;BR /&gt;  exit 2&lt;BR /&gt;  ;;&lt;BR /&gt;esac&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Allan.</description>
      <pubDate>Fri, 27 Aug 2010 04:27:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680187#M658661</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-08-27T04:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Nagios script output issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680188#M658662</link>
      <description>If output says "Critical", it means exit code 2. In your script exit code 2 is when you receive "Fatal" or any other value (*) than "Ok", "Error" or "Critical". &lt;BR /&gt;I suggest you change exit code for * to 3 ("Unknown") and carefully inspect possible outputs from &lt;BR /&gt;curl -s $URL |grep summary|awk -F\" '{print $2} - it probably starts to return nothing or something you're not expecting at some point.</description>
      <pubDate>Fri, 27 Aug 2010 04:55:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680188#M658662</guid>
      <dc:creator>Modris Bremze</dc:creator>
      <dc:date>2010-08-27T04:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Nagios script output issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680189#M658663</link>
      <description>Got a little mistake there - Critical status in your script is for Fatal, Error and any value other than Warn or Ok. Sorry.</description>
      <pubDate>Fri, 27 Aug 2010 04:57:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680189#M658663</guid>
      <dc:creator>Modris Bremze</dc:creator>
      <dc:date>2010-08-27T04:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Nagios script output issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680190#M658664</link>
      <description>Hi Allan:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; and the output line says "Application is" and not even "Application is ERROR" or "Application is FATAL".&lt;BR /&gt;&lt;BR /&gt;Then your 'STATUS' variable is empty.  That is, there was no match (or the 'curl' returned nothing).&lt;BR /&gt;&lt;BR /&gt;As an aside you can eliminate the extra process (the 'grep') and let 'awk' to all the work:&lt;BR /&gt;&lt;BR /&gt;# STATUS=`curl -s $URL|awk -F\" '/summary/ {print $2}'`&lt;BR /&gt;&lt;BR /&gt;...which is better written without the backticks but as $( ... ) like:&lt;BR /&gt;&lt;BR /&gt;# STATUS=$(curl -s $URL|awk -F\" '/summary/ {print $2}')&lt;BR /&gt;&lt;BR /&gt;Lastly, you have a large number of questions with unassigned points (166 of 285 responses). It would be appreciated if you could evaluate the help you received.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/service/forums/pageList.do?userId=CA1505975&amp;amp;listType=unassigned&amp;amp;forumId=1" target="_blank"&gt;http://forums.itrc.hp.com/service/forums/pageList.do?userId=CA1505975&amp;amp;listType=unassigned&amp;amp;forumId=1&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Aug 2010 10:56:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680190#M658664</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-08-27T10:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Nagios script output issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680191#M658665</link>
      <description>Thanks for your answers, &lt;BR /&gt;&lt;BR /&gt;When I run the script from commandline I get the correct status (Warn or OK) but those still return CRITICAL.&lt;BR /&gt;&lt;BR /&gt;I would try what JRF suggested.&lt;BR /&gt;&lt;BR /&gt;JRF, would assign points surely over the weekend.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan</description>
      <pubDate>Fri, 27 Aug 2010 14:31:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680191#M658665</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-08-27T14:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Nagios script output issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680192#M658666</link>
      <description>Hi (again) Allan:&lt;BR /&gt;&lt;BR /&gt;I would run 'curl' with the '-o file' option to redirect its STDOUT into a file.  Then, examine the return code from 'curl'.  If that indicates success, then parse the output file as you require.&lt;BR /&gt;&lt;BR /&gt;This is what I was eluding to when I said "(or the 'curl' returned nothing)".&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Aug 2010 15:34:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680192#M658666</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-08-27T15:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Nagios script output issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680193#M658667</link>
      <description>Hey JRF,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply. I am first trying the solution without the grep. As the failure happens in 2-3 hrs. I would wait and watch.&lt;BR /&gt;&lt;BR /&gt;I am thinking of avoiding the output to file in order to minimize the handling of files.&lt;BR /&gt;&lt;BR /&gt;Lets see how it goes.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
      <pubDate>Fri, 27 Aug 2010 16:46:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680193#M658667</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-08-27T16:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Nagios script output issue</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680194#M658668</link>
      <description>Folks, &lt;BR /&gt;&lt;BR /&gt;I switched to "check_http" plugin (official nagios plugin) but that also has same problem.&lt;BR /&gt;&lt;BR /&gt;Initially when I start nagios then the status on the Nagios Web interface is  same as the one returned from commandline.&lt;BR /&gt;&lt;BR /&gt;After some time the status becomes critical but is not as same as the commandline. Command line returns the correct status of OK instead of what the Nagios web interface shows as "CRITICAL"&lt;BR /&gt;&lt;BR /&gt;Result from commandline(&amp;amp; browser) -&lt;BR /&gt;./check_http -H xyz.com -p 2222 -u /abc -t 3&lt;BR /&gt;OK&lt;BR /&gt;&lt;BR /&gt;Result from Nagios Interface - &lt;BR /&gt;nodename nor servname provided, or not known&lt;BR /&gt;HTTP CRITICAL - Unable to open TCP socket&lt;BR /&gt;&lt;BR /&gt;I am thinking that this has something to do with Nagios as the box is behaving just fine based on the commandline result(and verified on the URL through the browser).&lt;BR /&gt;&lt;BR /&gt;Please help!&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Allan.</description>
      <pubDate>Mon, 30 Aug 2010 00:06:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/nagios-script-output-issue/m-p/4680194#M658668</guid>
      <dc:creator>Allanm</dc:creator>
      <dc:date>2010-08-30T00:06:58Z</dc:date>
    </item>
  </channel>
</rss>

