<?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: Alerting for splunkd in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Alerting-for-splunkd/m-p/52065#M697</link>
    <description>&lt;P&gt;I don't know what sort of output you'd like with this search but this would do the job by providing a count that you can alert on (count &amp;gt; 0).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source="/opt/splunk/var/log/splunk/web_service.log" log_level="error" sourcetype="splunk_web_service"  "Splunkd daemon is not responding" | stats earliest(_time) as FirstOccurance, latest(_time) as LastOccurance count |eval FirstOccurance=strftime(FirstOccurance,"%m/%d/%Y %H:%M:%S")|eval LastOccurance=strftime(LastOccurance,"%m/%d/%Y  %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you don't have an occurrence of this in your current splunkd.log you can change the "source" part to end with a '*' and it will look in all the rotated-out logs as well as the current. Then just set the time window to go back to when you had one of these.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Feb 2014 23:52:04 GMT</pubDate>
    <dc:creator>wrangler2x</dc:creator>
    <dc:date>2014-02-19T23:52:04Z</dc:date>
    <item>
      <title>Alerting for splunkd</title>
      <link>https://community.splunk.com/t5/Alerting/Alerting-for-splunkd/m-p/52064#M696</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;I have seen the following messages in the past when using/trying to access the Splunk UI:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Splunkd daemon is not responding...&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;The splunkd daemon cannot be reached by splunkweb&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I would like to set up some alerts to inform me when the above events happen. How can this be done?&lt;BR /&gt;
Does anyone have a ready-made search query for this? Is it simply the case of building search queries that look for such phrases in the internal logs (splunkd.log)?&lt;/P&gt;

&lt;P&gt;Thanks in advance for your help.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Dec 2012 15:33:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alerting-for-splunkd/m-p/52064#M696</guid>
      <dc:creator>Ant1D</dc:creator>
      <dc:date>2012-12-03T15:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: Alerting for splunkd</title>
      <link>https://community.splunk.com/t5/Alerting/Alerting-for-splunkd/m-p/52065#M697</link>
      <description>&lt;P&gt;I don't know what sort of output you'd like with this search but this would do the job by providing a count that you can alert on (count &amp;gt; 0).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source="/opt/splunk/var/log/splunk/web_service.log" log_level="error" sourcetype="splunk_web_service"  "Splunkd daemon is not responding" | stats earliest(_time) as FirstOccurance, latest(_time) as LastOccurance count |eval FirstOccurance=strftime(FirstOccurance,"%m/%d/%Y %H:%M:%S")|eval LastOccurance=strftime(LastOccurance,"%m/%d/%Y  %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you don't have an occurrence of this in your current splunkd.log you can change the "source" part to end with a '*' and it will look in all the rotated-out logs as well as the current. Then just set the time window to go back to when you had one of these.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2014 23:52:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alerting-for-splunkd/m-p/52065#M697</guid>
      <dc:creator>wrangler2x</dc:creator>
      <dc:date>2014-02-19T23:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Alerting for splunkd</title>
      <link>https://community.splunk.com/t5/Alerting/Alerting-for-splunkd/m-p/52066#M698</link>
      <description>&lt;P&gt;Here is a simple script that test for port 8089 connectivity. It will send email alert (and restart the process if not connection):&lt;/P&gt;

&lt;P&gt;/export/home/mhassan/scripts $ cat splunkd-watchdog.sh &lt;/P&gt;

&lt;H1&gt;!/bin/bash&lt;/H1&gt;

&lt;H1&gt;splunkd-watchdog.sh&lt;/H1&gt;

&lt;H1&gt;Monitor Splunk port 8089. Restart process if no answer&lt;/H1&gt;

&lt;H1&gt;-Mohamad Hassan   2/2/215&lt;/H1&gt;

&lt;P&gt;timestamp=&lt;CODE&gt;date&lt;/CODE&gt;&lt;BR /&gt;
USER=&lt;CODE&gt;whoami&lt;/CODE&gt;&lt;BR /&gt;
WHO=&lt;CODE&gt;who -u&lt;/CODE&gt;&lt;BR /&gt;
host=&lt;CODE&gt;uname -n&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;LOGFILE="/opt/splunk/var/log/splunk-watchdog.log"&lt;BR /&gt;
PROC="splunkd"&lt;BR /&gt;
PORT="8089"&lt;BR /&gt;
ADMINS="&lt;A href="mailto:user1@domain.com"&gt;user1@domain.com&lt;/A&gt;  &lt;A href="mailto:user2@domain.com"&gt;user2@domain.com&lt;/A&gt;"&lt;BR /&gt;
TEST=&lt;CODE&gt;nc -z -w5 $HOSTNAME $PORT;echo $? &amp;lt; /dev/null&lt;/CODE&gt;&lt;/P&gt;

&lt;H1&gt;Debugging&lt;/H1&gt;

&lt;H1&gt;let TEST=0&lt;/H1&gt;

&lt;P&gt;echo $TEST&lt;/P&gt;

&lt;P&gt;if [ $TEST -eq 1 ] ;then&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    /opt/splunk/bin/splunk restart
    RESULT=`ps ax | grep -i "$PROC" | grep -v grep|grep -v watchdog`

    echo  "$timestamp $HOSTNAME: splunk-watchdog ALERT! $PROC process restarted" &amp;gt;&amp;gt; $LOGFILE

    echo -e "Splunk watchdog ALERT! Splunk port $PORT is not answering.\n\n Hostname:    $HOSTNAME\n Time:               $timestamp\n Notifying:      $ADMINS\n ACTION:       Restarting ($PROC)!\n\nCurrrent logged-in users:\n$WHO\n\nCurrent splunkd status(after restart):\n$RESULT" |mail -s "$PROC watchdog ALERT! [$HOSTNAME]"  $ADMINS

    echo "$PROC restarted!"
    echo "Email sent to: $ADMINS"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;fi&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 17:36:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alerting-for-splunkd/m-p/52066#M698</guid>
      <dc:creator>mhassan</dc:creator>
      <dc:date>2015-02-25T17:36:35Z</dc:date>
    </item>
  </channel>
</rss>

