<?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: Error msg=&amp;quot;A script exited abnormally&amp;quot; status=&amp;quot;exited with code 1&amp;quot; in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193093#M19854</link>
    <description>&lt;P&gt;This is the error. &lt;BR /&gt;
msg="A script exited abnormally" input="./bin/rlog.sh" stanza="default" status="exited with code 1"&lt;/P&gt;

&lt;P&gt;I thought the solution you provided will make these messages go away. &lt;BR /&gt;
But since the rlog.sh is scheduled to kick-off every hour, these messages/error appear houlry on the Splunk search web User Interface.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Feb 2016 20:30:08 GMT</pubDate>
    <dc:creator>vsingla1</dc:creator>
    <dc:date>2016-02-12T20:30:08Z</dc:date>
    <item>
      <title>Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193088#M19849</link>
      <description>&lt;P&gt;On &lt;EM&gt;Nix system, still getting script errors AFTER doing chmod u+x  for Splunk User on the Splunk_TA_Nix/bin/&lt;/EM&gt;.sh files&lt;/P&gt;

&lt;P&gt;msg="A script exited abnormally" input="./bin/cpu.sh" stanza="default" status="exited with code 1"&lt;BR /&gt;
msg="A script exited abnormally" input="./bin/lsof.sh" stanza="default" status="exited with code 1"&lt;BR /&gt;
msg="A script exited abnormally" input="./bin/rlog.sh" stanza="default" status="exited with code 1"&lt;BR /&gt;
msg="A script exited abnormally" input="./bin/protocol.sh" stanza="default" status="exited with code 1"&lt;BR /&gt;
msg="A script exited abnormally" input="./bin/bandwidth.sh" stanza="default" status="exited with code 1"&lt;BR /&gt;
msg="A script exited abnormally" input="./bin/hardware.sh" stanza="default" status="exited with code 1"&lt;BR /&gt;
msg="A script exited abnormally" input="./bin/sshdChecker.sh" stanza="default" status="exited with code 1"&lt;BR /&gt;
msg="A script exited abnormally" input="./bin/iostat.sh" stanza="default" status="exited with code 1"&lt;BR /&gt;
msg="A script exited abnormally" input="./bin/vmstat.sh" stanza="default" status="exited with code 1"&lt;BR /&gt;
msg="A script exited abnormally" input="./bin/interfaces.sh" stanza="default" status="exited with code 1"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:23:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193088#M19849</guid>
      <dc:creator>mcronkrite</dc:creator>
      <dc:date>2020-09-28T17:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193089#M19850</link>
      <description>&lt;P&gt;First off, doing a "chmod +x" makes the scripts executable which explain why this started showing up.  (If these files are not executable, then Splunk cannot run them.  Most often this is a packaging bug.)&lt;/P&gt;

&lt;P&gt;So I just tracked down the error with &lt;CODE&gt;rlog.sh&lt;/CODE&gt;.   The following line is to blame:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;awk -v START=$SEEK -v OUTPUT=$SEEK_FILE 'NR&amp;gt;START { print } END { print NR &amp;gt; OUTPUT }' $AUDIT_FILE | tee $TEE_DEST | /sbin/ausearch -i 2&amp;gt;/dev/null | grep -v "^----"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is that &lt;CODE&gt;grep&lt;/CODE&gt; will return a non-zero error message when it doesn't find what it's looking for.   So in a normal case (on an active system), if new new events have been written to &lt;CODE&gt;/var/log/audit/audit.log&lt;/CODE&gt;, then the line "---" will be written by &lt;CODE&gt;ausearch&lt;/CODE&gt; and then &lt;CODE&gt;grep&lt;/CODE&gt; will be happily remove it.  (exit code 0).  However, if there are no new events in &lt;CODE&gt;audit.log&lt;/CODE&gt; then grep will be grumpy because it didn't have any work to do and exit with code 1.  Since this is last line in the script to be executed, the script exits  with grep's exit code, which is 1. Hence the error message you're seeing.&lt;/P&gt;

&lt;P&gt;So the reality is, we don't care about grep's happiness, so a real simple solution is to just always report success by explicitly returning 0.  That can be done like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;awk -v START=$SEEK -v OUTPUT=$SEEK_FILE 'NR&amp;gt;START { print } END { print NR &amp;gt; OUTPUT }' $AUDIT_FILE | tee $TEE_DEST | /sbin/ausearch -i 2&amp;gt;/dev/null | grep -v "^----"
exit 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure what's happening in &lt;CODE&gt;sshdChecker.sh&lt;/CODE&gt;, and it's certainly conceivable that you're hitting a different issue with &lt;CODE&gt;rlog.sh&lt;/CODE&gt; but you really just have to dig in to the shell script to see what's going on.  Of  course if you don't need the input, just disable it and the annoying error will go away.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;A slightly more efficent option would be to not even execute the command unless new content was added to the audit.log file.  This can be done by adding the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;if [ $FILE_LINES -eq $SEEK ] ; then
    # No new events in audit.log
    exit 0
fi
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Nov 2014 18:14:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193089#M19850</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2014-11-25T18:14:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193090#M19851</link>
      <description>&lt;P&gt;Thank you for this.  I had just dove deep enough to find that error and was scratching my head as to where the "division by zero" error was coming from.&lt;/P&gt;

&lt;P&gt;No longer seeing the error.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Oct 2015 17:56:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193090#M19851</guid>
      <dc:creator>jgoddard</dc:creator>
      <dc:date>2015-10-09T17:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193091#M19852</link>
      <description>&lt;P&gt;Hi Lowell,&lt;BR /&gt;
I am facing the issue but the solution you provided is not working.&lt;BR /&gt;
I tried both the solutions:&lt;BR /&gt;
 1. Adding the IF loop that checks if new content was updated in the audit.log&lt;BR /&gt;
 2. Explicitly setting the exit code for AWK to zero.&lt;/P&gt;

&lt;P&gt;None of them works and the script still shows the same error. Do you recommend anything else? I am running Splunk 6.2.3&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 19:16:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193091#M19852</guid>
      <dc:creator>vsingla1</dc:creator>
      <dc:date>2015-12-29T19:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193092#M19853</link>
      <description>&lt;P&gt;What error are you seeing?   What happens if you run the script manually?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 23:11:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193092#M19853</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2016-01-05T23:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193093#M19854</link>
      <description>&lt;P&gt;This is the error. &lt;BR /&gt;
msg="A script exited abnormally" input="./bin/rlog.sh" stanza="default" status="exited with code 1"&lt;/P&gt;

&lt;P&gt;I thought the solution you provided will make these messages go away. &lt;BR /&gt;
But since the rlog.sh is scheduled to kick-off every hour, these messages/error appear houlry on the Splunk search web User Interface.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2016 20:30:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193093#M19854</guid>
      <dc:creator>vsingla1</dc:creator>
      <dc:date>2016-02-12T20:30:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193094#M19855</link>
      <description>&lt;P&gt;Please try running the script from the command line (shell/terminal) manually and report back what the response is.  If it doesn't run correctly from the command line, it's not going to work from Splunk either.  I suspect that is the problem, but need more detail.  Try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;cd /opt/splunk/etc/apps/Splunk_TA_nix/bin/
./rlog.sh &amp;gt; /dev/null
echo "returncode=$?"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Feb 2016 23:39:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193094#M19855</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2016-02-12T23:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193095#M19856</link>
      <description>&lt;P&gt;I ran the script and returncode=1&lt;/P&gt;</description>
      <pubDate>Mon, 15 Feb 2016 18:08:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193095#M19856</guid>
      <dc:creator>vsingla1</dc:creator>
      <dc:date>2016-02-15T18:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193096#M19857</link>
      <description>&lt;P&gt;So turns out that if you run the scripts directly you can find out what the actually error is. &lt;BR /&gt;
In my case the system was a new Centos 7 build and didn't have the following commands installed, &lt;BR /&gt;
sar, netstat, etc etc.&lt;/P&gt;

&lt;P&gt;The way to find it is by running this for each of the scripts not working. &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;bash -x ../bin/vmstat.sh &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 30 Mar 2016 17:16:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193096#M19857</guid>
      <dc:creator>mcronkrite</dc:creator>
      <dc:date>2016-03-30T17:16:15Z</dc:date>
    </item>
    <item>
      <title>Re: Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193097#M19858</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;On my Ubuntu i had to install SAR with : &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;apt install sysstat&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Vince&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2016 17:28:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193097#M19858</guid>
      <dc:creator>vince2010091</dc:creator>
      <dc:date>2016-11-09T17:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193098#M19859</link>
      <description>&lt;P&gt;This is still a valid fix with version 6.0.0 -- thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jul 2018 15:12:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193098#M19859</guid>
      <dc:creator>salbro</dc:creator>
      <dc:date>2018-07-13T15:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193099#M19860</link>
      <description>&lt;P&gt;If it helps, I've built upon this topic with the &lt;A href="https://answers.splunk.com/answers/716045/what-are-best-practices-for-deploying-the-splunk-a.html"&gt;What are best practices for deploying the Splunk Add-on for Unix and Linux in a distributed environment?&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 20:23:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193099#M19860</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2019-01-16T20:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Error msg="A script exited abnormally" status="exited with code 1"</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193100#M19861</link>
      <description>&lt;P&gt;rlog.sh&lt;BR /&gt;
Lowell's file check for rlog.sh works well I believe, still testing.  &lt;/P&gt;

&lt;P&gt;sshdchecker&lt;BR /&gt;
I had an error for sshdChecker.sh and in reviewing it I determined that if you are running Splunk as non-root user (best practice) it probably does not have read access on the sshd_config file so it errors out.  Make sure the splunk service account has read access to the sshd_config file.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:04:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/Error-msg-quot-A-script-exited-abnormally-quot-status-quot/m-p/193100#M19861</guid>
      <dc:creator>jeburkes76</dc:creator>
      <dc:date>2020-09-29T23:04:47Z</dc:date>
    </item>
  </channel>
</rss>

