<?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: Can any one help me with a shell script which checks a Splunk user's process? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397090#M94095</link>
    <description>&lt;P&gt;@shivanandbm ,&lt;/P&gt;

&lt;P&gt;Simple way is to check the process&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/bin/bash

if [[ $(ps -u Splunk |grep splunkd|grep -v grep|wc -l) -lt 1 ]]
then
        echo "Splunk is not running, sending an email"
else
        echo "Splunk is running"
fi
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;BR /&gt;
If the user who runs the script has execution permission for bin/splunk, then you can use &lt;CODE&gt;$SPLUNK_HOME/bin/splunk status&lt;/CODE&gt; and check for the message&lt;/P&gt;</description>
    <pubDate>Wed, 03 Oct 2018 18:33:01 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2018-10-03T18:33:01Z</dc:date>
    <item>
      <title>Can any one help me with a shell script which checks a Splunk user's process?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397087#M94092</link>
      <description>&lt;P&gt;Can any one help me with a shell script which checks a Splunk user's process? If it is not running with Splunk user, we should get an email alert. Our Splunk is running on linux platform&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 12:06:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397087#M94092</guid>
      <dc:creator>shivanandbm</dc:creator>
      <dc:date>2018-10-02T12:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me with a shell script which checks a Splunk user's process?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397088#M94093</link>
      <description>&lt;P&gt;Hi @shivanandbm,&lt;/P&gt;

&lt;P&gt;If you are running &lt;CODE&gt;Splunk_TA_nix&lt;/CODE&gt; add-on on all your linux servers in that case you can use ps.sh script (sourcetype=ps) to check &lt;CODE&gt;-p_8089_restart&lt;/CODE&gt; process with username and accordingly you can create schedule search on Splunk based on your requirement to send email alert.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 12:50:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397088#M94093</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-10-02T12:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me with a shell script which checks a Splunk user's process?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397089#M94094</link>
      <description>&lt;P&gt;no we are not using that addon. we are thinking it to monitor from the platform itself&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 06:29:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397089#M94094</guid>
      <dc:creator>shivanandbm</dc:creator>
      <dc:date>2018-10-03T06:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me with a shell script which checks a Splunk user's process?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397090#M94095</link>
      <description>&lt;P&gt;@shivanandbm ,&lt;/P&gt;

&lt;P&gt;Simple way is to check the process&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#!/bin/bash

if [[ $(ps -u Splunk |grep splunkd|grep -v grep|wc -l) -lt 1 ]]
then
        echo "Splunk is not running, sending an email"
else
        echo "Splunk is running"
fi
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;BR /&gt;
If the user who runs the script has execution permission for bin/splunk, then you can use &lt;CODE&gt;$SPLUNK_HOME/bin/splunk status&lt;/CODE&gt; and check for the message&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 18:33:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397090#M94095</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-03T18:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me with a shell script which checks a Splunk user's process?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397091#M94096</link>
      <description>&lt;P&gt;i want to check  the user associated with splunk process.it should run with splunk user. there are many cases splunk has been started with root user.we came to know after several days when all the report generation have been failed.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Oct 2018 07:21:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397091#M94096</guid>
      <dc:creator>shivanandbm</dc:creator>
      <dc:date>2018-10-04T07:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can any one help me with a shell script which checks a Splunk user's process?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397092#M94097</link>
      <description>&lt;P&gt;&lt;CODE&gt;ps -u Splunk&lt;/CODE&gt; gives you only the processes running with user "Splunk". Try it!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Oct 2018 20:57:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-any-one-help-me-with-a-shell-script-which-checks-a-Splunk/m-p/397092#M94097</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-10-05T20:57:40Z</dc:date>
    </item>
  </channel>
</rss>

