<?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: How to create and trigger an alert if the CPU usage is constantly 100% for the past 10 minutes? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231656#M4330</link>
    <description>&lt;P&gt;Hi @akash5333,&lt;BR /&gt;
Try creating a real-time alert with rolling time window triggering. This will let you monitor for conditions that occur within a particular time window (in this case, CPU usage in a 10 minute span).&lt;/P&gt;

&lt;P&gt;See &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/Alert/Definerolling-windowalerts"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.3/Alert/Definerolling-windowalerts&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
    <pubDate>Fri, 04 Mar 2016 01:38:13 GMT</pubDate>
    <dc:creator>frobinson_splun</dc:creator>
    <dc:date>2016-03-04T01:38:13Z</dc:date>
    <item>
      <title>How to create and trigger an alert if the CPU usage is constantly 100% for the past 10 minutes?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231655#M4329</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;We have both Windows and Linux environments. We want to set up an alert to send an email if the CPU usage of a particular process is constantly 100% during past 10 minutes.  Below is the search I have for the CPU usage:&lt;/P&gt;

&lt;P&gt;Linux:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=yyyy index=* COMMAND=java USER=xxxxxx | timechart span=10m limit=0 avg(pctCPU) as "% of CPU Usage"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Windows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* host=zzzz sourcetype="Perfmon:CPU" source="Perfmon:CPU" counter="% Processor Time" | timechart span=10m limit=0 avg(Value) as "% of CPU Usage"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Mar 2016 01:19:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231655#M4329</guid>
      <dc:creator>akash5333</dc:creator>
      <dc:date>2016-03-04T01:19:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create and trigger an alert if the CPU usage is constantly 100% for the past 10 minutes?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231656#M4330</link>
      <description>&lt;P&gt;Hi @akash5333,&lt;BR /&gt;
Try creating a real-time alert with rolling time window triggering. This will let you monitor for conditions that occur within a particular time window (in this case, CPU usage in a 10 minute span).&lt;/P&gt;

&lt;P&gt;See &lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/Alert/Definerolling-windowalerts"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.3/Alert/Definerolling-windowalerts&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 01:38:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231656#M4330</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2016-03-04T01:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to create and trigger an alert if the CPU usage is constantly 100% for the past 10 minutes?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231657#M4331</link>
      <description>&lt;P&gt;You can use a real-time alert with a rolling window of 10 minutes with the following search:&lt;/P&gt;

&lt;P&gt;Linux:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=yyyy index=* COMMAND=java USER=xxxxxx | stats avg(pctCPU) as CPUUsage | where CPUUsage = 100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Windows: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* host=zzzz sourcetype="Perfmon:CPU" source="Perfmon:CPU" counter="% Processor Time" | stats avg(value) as CPUUsage | where CPUUsage = 100
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;These searches create a result when the avg is at 100, which can only be the case if it has been at a constant 100%. &lt;BR /&gt;
You then can use the "Per-Result" trigger of the real time alert which triggers if the search returns results.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 09:22:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231657#M4331</guid>
      <dc:creator>JMichaelis</dc:creator>
      <dc:date>2016-03-04T09:22:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to create and trigger an alert if the CPU usage is constantly 100% for the past 10 minutes?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231658#M4332</link>
      <description>&lt;P&gt;Hi @frobinson,&lt;/P&gt;

&lt;P&gt;Here are my output of my query in the span of 10 minutes,  I have set an rolling alert to send email if CPUusage is more than 10 but I never received the alert.  Please let me know where I am going wrong.&lt;/P&gt;

&lt;P&gt;2016-03-04 09:50:00 &lt;BR /&gt;
1.9&lt;BR /&gt;
13.6&lt;BR /&gt;
27.3&lt;BR /&gt;
3.0&lt;BR /&gt;
54.6&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 18:08:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231658#M4332</guid>
      <dc:creator>akash5333</dc:creator>
      <dc:date>2016-03-04T18:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to create and trigger an alert if the CPU usage is constantly 100% for the past 10 minutes?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231659#M4333</link>
      <description>&lt;P&gt;Hi @akash5333,&lt;BR /&gt;
What are your trigger conditions? Are you throttling the alert at all?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 18:50:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231659#M4333</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2016-03-04T18:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create and trigger an alert if the CPU usage is constantly 100% for the past 10 minutes?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231660#M4334</link>
      <description>&lt;P&gt;Hi @frobinson,&lt;/P&gt;

&lt;P&gt;Yes I have set the throttle for 10 seconds.  Here is trigger condition.&lt;/P&gt;

&lt;P&gt;Realtime Alert - search pctCPU&amp;gt;10 - in 10 seconds&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 18:56:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231660#M4334</guid>
      <dc:creator>akash5333</dc:creator>
      <dc:date>2016-03-04T18:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create and trigger an alert if the CPU usage is constantly 100% for the past 10 minutes?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231661#M4335</link>
      <description>&lt;P&gt;Thanks--taking a look and I'll get back to you soon!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 19:15:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231661#M4335</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2016-03-04T19:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create and trigger an alert if the CPU usage is constantly 100% for the past 10 minutes?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231662#M4336</link>
      <description>&lt;P&gt;Hi @akash5333,&lt;BR /&gt;
I'm not sure which query you are using. Is it one of the original queries you posted or the suggested queries in this post? I think there may be a couple problems with the trigger condition. It sounds like your query renames the average CPU percentage but your trigger condition is checking a field in the original event data.&lt;/P&gt;

&lt;P&gt;Keep in mind that a custom trigger condition is a secondary search applied to your base query's results. So you might need to double-check the query result fields to make sure you are using the right fields in the trigger condition.&lt;/P&gt;

&lt;P&gt;Also, I'm not sure that the "pctCPU&amp;gt;10" and "in 10 seconds" part of the condition match the alert scenario you mentioned at first. This might be something to double-check too.&lt;/P&gt;

&lt;P&gt;Have you tried the suggested queries from @JMichaelis? They might match the scenario you want more closely.&lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 20:13:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-create-and-trigger-an-alert-if-the-CPU-usage-is/m-p/231662#M4336</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2016-03-04T20:13:59Z</dc:date>
    </item>
  </channel>
</rss>

