<form script="panel_resize.js,modal.js" stylesheet="howto.css,ui_simple.css" hideEdit="True" isVisible="true" version="1.1" theme="dark">
	<label>HOWTO CPU_ALL: Generate stats and charts with Splunk Search Processing Language (SPL)</label>
	<description>This collection of request samples will help you generating your own reports, dashboards and alerts for Nmon Performance data using the native Search Processing Language</description>

	<row>
		<panel>

			<html>

				<div class="imgheader custom-modal">
					<img src="../../static/app/metricator-for-nmon/icons/dark_theme/cpu.png" alt="CPU"/>
					<h2><a data-modal-name="Help_modal">CPU Percentage Usage Statistics (click here for more information)</a></h2>
				</div>

                <!-- Modal -->
                <div class="modal custom-modal-60 fade" id="Help_modal" tabindex="-1" role="dialog" aria-labelledby="Help_modal_Label">
                    <div class="modal-dialog" role="document">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true"></span></button>
                                <div style="text-align: left;">
                                    <h4 class="modal-title" id="Help_modal_Label">Integrated Navigation:</h4>
                                </div>
                            </div>
                            <div class="modal-body">

                                <div style="text-align: center;">
                                    <img src="../../static/app/metricator-for-nmon/icons/dark_theme/cpu.png" alt="CPU"/>
                                    <h1>
                                        CPU global percentage statistics
                                        <br />
                                        (metric_name=os.unix.nmon.cpu.cpu_all.*)
                                    </h1>

                                </div>

                                <div>
                                    <br />
                                    <br />
                                    <i>The CPU_ALL monitor represents average metrics for all available logical CPUs to the system.</i>
                                    <br />
                                    <i>These metrics are common to every supported operating systems.</i>

                                </div>

                                <div style="text-align: left;">

                                    <h1>raw metrics:</h1>

                                    <div class="list">
                                        <lu>
                                            <li><b>Sys_PCT:</b> % of CPU time spent in kernel mode</li>
                                            <li><b>User_PCT:</b> % of CPU time spent in user mode</li>
                                            <li><b>Wait_PCT:</b> % of CPU time spent in waiting for resources</li>
                                        </lu>
                                    </div>

                                    <div class="list">
                                        <lu>
                                            <li><b>Idle_PCT:</b> % of CPU time free, meaning not having task to do</li>
                                            <li><b>CPUs:</b> Number of CPUs cores available to the system</li>
                                        </lu>
                                        <br />
                                    </div>

                                    <h1>calculated metrics:</h1>

                                    <div class="list">
                                        <lu>
                                            <li><b>cpu_load_percent:</b> % of CPU usage for all available cores (Sys_PCT+User_PCT+Wait_PCT)</li>
                                        </lu>
                                    </div>

                                </div>

                                <div style="text-align:left;">
                                    <h1>Related links:</h1>
                                </div>

                                <div style="text-align: center;" class="cat_title">

                                    <a target="_blank" href="search?q=%7C%20mcatalog%20values(metric_name)%20as%20metrics%20where%20%60nmon_metrics_index%60%20metric_name%3D&quot;os.unix.nmon.cpu.cpu_all.*&quot;%20host%3D&quot;*&quot;" class="tryitbtnxl">mcatalog »
                                    </a>

                                    <a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.cpu.cpu_all.*%20host%3D$host$%20by%20metric_name%2C%20host%20span%3D1m" class="tryitbtnxl">mstats raw query»
                                    </a>

                                    <a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.cpu.cpu_all.*%20host%3D$host$%20by%20metric_name%2C%20host%20span%3D1m%0A%7C%20%60def_cpu_load_percent%60" class="tryitbtnxl">mstats pre-built query »
                                    </a>

                                    <a target="_blank" href="UI_data_dictionary?&amp;form.itemfilter=CPU%20USAGE%20STATISTICS" class="tryitbtnxl">CPU Data Dictionary »
                                    </a>

                                </div>

                                <div style="text-align:left;">
                                    <h1>Related metrics:</h1>
                                </div>

                                <div style="text-align: center;" class="cat_title">

                                    <a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.cpu.cpunn.*%20host%3D$host$%20by%20metric_name%2C%20host%20span%3D1m" class="tryitbtnxl">os.unix.nmon.cpu.cpunn.* »
                                    </a>

                                    <a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.processes.top.*%20host%3D$host$%20by%20metric_name%2C%20host%2C%20dimension_Command%20span%3D1m" class="tryitbtnxl">os.unix.nmon.processes.top.* »
                                    </a>

                                    <a target="_blank" href="search?q=search%20eventtype%3Dnmon%3Aevents%20type%3DUARG" class="tryitbtnxl">UARG events »
                                    </a>

                                </div>

                            </div>

                            <div class="modal-footer">
                                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                            </div>

                        </div>
                    </div>
                </div>

			</html>

		</panel>

		<panel>
			<title>Optionally preset host and press Enter:</title>

			<input type="text" token="host" searchWhenChanged="true">
				<label>Host:</label>
				<default>*</default>
			</input>

		</panel>

	</row>

	<row>
		<panel>
			<title>Time oriented and statistics oriented charts:</title>

			<html>

				<div>
					<h2>Time Oriented Charts:</h2>
					<br />
				</div>

				<div style="text-align: left;">
					<br />
					<img src="../../static/app/metricator-for-nmon/various/mini/minichart.png" alt="minichart"/>
					<br />
					<br />
				</div>

				<div>
					<h2>Average CPU Usage in Percentage over last 24 hours using the custom span macro, in a line chart by server names</h2>
					<pre>| mstats avg(_value) as value where `nmon_metrics_index` metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT host=$host$ by metric_name, host span=1m
| `def_cpu_load_percent` | timechart `nmon_span` avg(cpu_load_percent) AS cpu_load_percent by host</pre>
				</div>

				<div>
					<div class="cat_title">
						<a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Sys_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.User_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Wait_PCT%20host%3D$host$%20by%20metric_name%2C%20host%20span%3D1m%0A%7C%20%60def_cpu_load_percent%60%20%7C%20timechart%20%60nmon_span%60%20avg(cpu_load_percent)%20AS%20cpu_load_percent%20by%20host&amp;display.page.search.tab=visualizations&amp;display.general.type=visualizations&amp;display.visualizations.charting.axisY.minimumNumber=0&amp;display.visualizations.charting.chart=line&amp;display.visualizations.charting.axisY.maximumNumber=100&amp;display.visualizations.charting.legend.placement=top&amp;earliest=-24h&amp;latest=now" class="tryitbtn-blue">Open in search »
						</a>
					</div>
					<br />
				</div>

				<div>
					<h2>Average Sys / User / Wait /Idle CPU Usage in a 100% stack area chart of a specific server over last 24 hours</h2>
					<pre>| mstats avg(_value) as value where `nmon_metrics_index` (metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Idle_PCT) host=$host$ by metric_name, host span=1m
| `def_cpu_all_cpu_load_percent_by_category` | timechart `nmon_span` avg(Sys_PCT) AS Sys_PCT, avg(User_PCT) AS User_PCT, avg(Wait_PCT) AS Wait_PCT, avg(Idle_PCT) AS Idle_PCT</pre>
				</div>

				<div>
					<div class="cat_title">
						<a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20(metric_name%3Dos.unix.nmon.cpu.cpu_all.Sys_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.User_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Wait_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Idle_PCT)%20host%3D$host$%20by%20metric_name%2C%20host%20span%3D1m%0A%7C%20%60def_cpu_all_cpu_load_percent_by_category%60%7C%20timechart%20%60nmon_span%60%20avg(Sys_PCT)%20AS%20Sys_PCT%2C%20avg(User_PCT)%20AS%20User_PCT%2C%20avg(Wait_PCT)%20AS%20Wait_PCT%2C%20avg(Idle_PCT)%20AS%20Idle_PCT&amp;earliest=-24h&amp;latest=now&amp;display.page.search.tab=visualizations&amp;display.general.type=visualizations&amp;display.visualizations.charting.chart=area&amp;display.visualizations.charting.legend.placement=top&amp;display.visualizations.charting.chart.stackMode=stacked100" class="tryitbtn-blue">Open in search »
						</a>
					</div>
					<br />
				</div>

				<div>
					<h2>Average CPU Usage in Percentage over last 30 days for Working hours Business days only (monday to friday, 08h to 19h) with auto span (custom macro span definition) in a line chart by server names</h2>
					<pre>| mstats avg(_value) as value where `nmon_metrics_index` metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT host=$host$ by metric_name, host span=1m
| `Day_BusinessDays_8h-19h`
| `def_cpu_load_percent` | timechart `nmon_span` avg(cpu_load_percent) AS cpu_load_percent by host</pre>
				</div>

				<div>
					<div class="cat_title">
						<a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Sys_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.User_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Wait_PCT%20host%3D$host$%20by%20metric_name%2C%20host%20span%3D1m%0A%7C%20%60Day_BusinessDays_8h-19h%60%0A%7C%20%60def_cpu_load_percent%60%20%7C%20timechart%20%60nmon_span%60%20avg(cpu_load_percent)%20AS%20cpu_load_percent%20by%20host&amp;display.page.search.tab=visualizations&amp;display.general.type=visualizations&amp;display.visualizations.charting.axisY.minimumNumber=0&amp;display.visualizations.charting.chart=line&amp;display.visualizations.charting.axisY.maximumNumber=100&amp;display.visualizations.charting.legend.placement=top&amp;earliest=-30d%40d&amp;latest=now" class="tryitbtn-blue">Open in search »
						</a>
					</div>
					<br />
				</div>

				<div>
					<h2>Compare Average CPU usage of yesterday versus today in a line chart of a specific server with a static span of 5 minutes (time reference of yesterday)</h2>
					<pre>| mstats avg(_value) as value where `nmon_metrics_index` metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT host=$host$ earliest="-1d@d" latest="@d" by metric_name, host span=1m
| `def_cpu_load_percent` | timechart `nmon_span` avg(cpu_load_percent) AS yesterday_cpu_load_percent
| appendcols [ | mstats avg(_value) as value where `nmon_metrics_index` metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT host=$host$ earliest="@d" latest="+1d@d" by metric_name, host span=1m
| `def_cpu_load_percent` | timechart `nmon_span` avg(cpu_load_percent) AS today_cpu_load_percent | fields - _time ]</pre>
				</div>

				<div>
					<div class="cat_title">
						<a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Sys_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.User_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Wait_PCT%20host%3D$host$%20earliest%3D&quot;-1d%40d&quot;%20latest%3D&quot;%40d&quot;%20by%20metric_name%2C%20host%20span%3D1m%0A%7C%20%60def_cpu_load_percent%60%20%7C%20timechart%20%60nmon_span%60%20avg(cpu_load_percent)%20AS%20yesterday_cpu_load_percent%0A%7C%20appendcols%20%5B%20%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Sys_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.User_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Wait_PCT%20host%3D$host$%20earliest%3D&quot;%40d&quot;%20latest%3D&quot;%2B1d%40d&quot;%20by%20metric_name%2C%20host%20span%3D1m%0A%7C%20%60def_cpu_load_percent%60%20%7C%20timechart%20%60nmon_span%60%20avg(cpu_load_percent)%20AS%20today_cpu_load_percent%20%7C%20fields%20-%20_time%20%5D&amp;display.page.search.tab=visualizations&amp;display.general.type=visualizations&amp;display.visualizations.charting.axisY.minimumNumber=0&amp;display.visualizations.charting.chart=line&amp;display.visualizations.charting.axisY.maximumNumber=100&amp;display.visualizations.charting.legend.placement=top&amp;earliest=%40d&amp;latest=now" class="tryitbtn-blue">Open in search »
						</a>
					</div>
					<br />
				</div>

				<div style="text-align: left;">
					<br />
					<img src="../../static/app/metricator-for-nmon/various/mini/single_trend.png" alt="minichart"/>
					<br />
					<br />
				</div>

				<div>
					<h2>Single trend physical memory usage in percentage over last 24 hours</h2>
					<pre>| mstats avg(_value) as value where `nmon_metrics_index` metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT host=$host$ by metric_name, host span=1m
| `def_cpu_load_percent` | timechart `nmon_span` avg(cpu_load_percent) AS avg | eval avg=round(avg, 2) | where isnum(avg)</pre>
				</div>

				<div>
					<div class="cat_title">
						<a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Sys_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.User_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Wait_PCT%20host%3D$host$%20by%20metric_name%2C%20host%20span%3D1m%0A%7C%20%60def_cpu_load_percent%60%20%7C%20timechart%20%60nmon_span%60%20avg(cpu_load_percent)%20AS%20avg%20%7C%20eval%20avg%3Dround(avg%2C%202)%20%7C%20where%20isnum(avg)&amp;display.page.search.mode=smart&amp;dispatch.sample_ratio=1&amp;display.page.search.tab=visualizations&amp;display.general.type=visualizations&amp;display.visualizations.singlevalue.trendDisplayMode=percent&amp;display.visualizations.singlevalue.useColors=1&amp;display.visualizations.singlevalue.colorBy=trend&amp;display.visualizations.singlevalue.trendColorInterpretation=inverse&amp;display.visualizations.singlevalue.numberPrecision=0.00" class="tryitbtn-blue">Open in search »
						</a>
					</div>
					<br />
				</div>

				<div>
					<h2>Stats oriented Charts:</h2>
					<br />
				</div>

				<div style="text-align: left;">
					<br />
					<img src="../../static/app/metricator-for-nmon/various/mini/minigauge.png" alt="minichart"/>
					<br />
					<br />
				</div>

				<div>
					<h2>Gauge chart of average CPU Usage in Percentage over last 24 hours</h2>
					<pre>| mstats avg(_value) as value where `nmon_metrics_index` metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT host=$host$ by metric_name, host span=1m
| `def_cpu_load_percent` | stats avg(cpu_load_percent) AS cpu_load_percent</pre>
				</div>

				<div>
					<div class="cat_title">
						<a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Sys_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.User_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Wait_PCT%20host%3D$host$*%20by%20metric_name%2C%20host%20span%3D1m%0A%7C%20%60def_cpu_load_percent%60%20%7C%20stats%20avg(cpu_load_percent)%20AS%20cpu_load_percent&amp;earliest=-24h&amp;latest=now&amp;display.page.search.tab=visualizations&amp;display.general.type=visualizations" class="tryitbtn-blue">Open in search »
						</a>
					</div>
					<br />
				</div>

				<div style="text-align: left;">
					<img src="../../static/app/metricator-for-nmon/various/mini/minicolumn.png" alt="minicolumn"/>
					<br />
					<br />
				</div>

				<div>
					<h2>Column chart of TOP 10 average CPU Usage in Percentage over last 24 hours</h2>
					<pre>| mstats avg(_value) as value where `nmon_metrics_index` metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT host=$host$ by metric_name, host span=1m
| `def_cpu_load_percent` | stats avg(cpu_load_percent) as cpu_load_percent by host | eval cpu_load_percent=round(cpu_load_percent, 2) | sort 0 - cpu_load_percent | head 10
| eval xlabel=""
| chart useother=f limit=0 values(cpu_load_percent) AS "Avg CPU %" by xlabel,host | rename xlabel AS "TOP 10 CPU % usage"</pre>
				</div>

				<div>
					<div class="cat_title">
						<a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Sys_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.User_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Wait_PCT%20host%3D$host$%20by%20metric_name%2C%20host%20span%3D1m%0A%7C%20%60def_cpu_load_percent%60%20%7C%20stats%20avg(cpu_load_percent)%20as%20cpu_load_percent%20by%20host%20%7C%20eval%20cpu_load_percent%3Dround(cpu_load_percent%2C%202)%20%7C%20sort%200%20-%20cpu_load_percent%20%7C%20head%2010%0A%7C%20eval%20xlabel%3D&quot;&quot;%0A%7C%20chart%20useother%3Df%20limit%3D0%20values(cpu_load_percent)%20AS%20&quot;Avg%20CPU%20%25&quot;%20by%20xlabel%2Chost%20%7C%20rename%20xlabel%20AS%20&quot;TOP%2010%20CPU%20%25%20usage&quot;&amp;earliest=%40y&amp;latest=now&amp;display.page.search.tab=visualizations&amp;display.general.type=visualizations&amp;display.visualizations.charting.chart=column&amp;display.visualizations.charting.legend.placement=top&amp;display.visualizations.charting.axisY.minimumNumber=0&amp;display.visualizations.charting.axisY.maximumNumber=100" class="tryitbtn-blue">Open in search »
						</a>
					</div>
					<br />
				</div>

			</html>

		</panel>
	</row>

	<row>
		<panel>
			<title>Table Statistics:</title>

			<html>

				<div style="text-align: left;">
					<br />
					<img src="../../static/app/metricator-for-nmon/various/mini/minitable.png" alt="minitable"/>
					<br />
					<br />
				</div>

				<div>
					<h2>CPU global usage and usage by category in percentage over the last 24 hours</h2>
					<pre>| mstats avg(_value) as value where `nmon_metrics_index` (metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Idle_PCT) host=$host$ by metric_name, host span=1m
| `def_cpu_all_cpu_load_percent_by_category`
| eval cpu_load_percent=(Sys_PCT+User_PCT+Wait_PCT)
| stats avg(cpu_load_percent) as cpu_load_percent, avg(Sys_PCT) as Sys_percent, avg(User_PCT) as User_percent, avg(Wait_PCT) as Wait_percent, avg(Idle_PCT) as Idle_percent, sparkline(avg(cpu_load_percent),) As sparkline by host
| foreach *_percent [ eval &lt;&lt;FIELD&gt;&gt; = round('&lt;&lt;FIELD&gt;&gt;', 3) ]
| rename *_percent AS "* (%)"</pre>
				</div>

				<div>
					<div class="cat_title">
						<a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20(metric_name%3Dos.unix.nmon.cpu.cpu_all.Sys_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.User_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Wait_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Idle_PCT)%20host%3D$host$%20by%20metric_name%2C%20host%20span%3D1m%0A%7C%20%60def_cpu_all_cpu_load_percent_by_category%60%0A%7C%20eval%20cpu_load_percent%3D(Sys_PCT%2BUser_PCT%2BWait_PCT)%0A%7C%20stats%20avg(cpu_load_percent)%20as%20cpu_load_percent%2C%20avg(Sys_PCT)%20as%20Sys_percent%2C%20avg(User_PCT)%20as%20User_percent%2C%20avg(Wait_PCT)%20as%20Wait_percent%2C%20avg(Idle_PCT)%20as%20Idle_percent%2C%20sparkline(avg(cpu_load_percent)%2C)%20As%20sparkline%20by%20host%0A%7C%20foreach%20*_percent%20%5B%20eval%20&lt;&lt;FIELD&gt;&gt;%20%3D%20round(%27&lt;&lt;FIELD&gt;&gt;%27%2C%203)%20%5D%0A%7C%20rename%20*_percent%20AS%20&quot;*%20(%25)&quot;&amp;display.page.search.tab=statistics&amp;display.general.type=statistics&amp;earliest=-24h&amp;latest=now" class="tryitbtn-blue">Open in search »
						</a>
					</div>
					<br />
				</div>

				<div>
					<h2>Min / Average / Median / Max and Average sparkline of CPU Usage in Percentage over last 24 hours ordered and sorted by frame ID, host</h2>
					<pre>| mstats avg(_value) as value where `nmon_metrics_index` (metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Idle_PCT) host=$host$ by metric_name, host span=1m
| `def_cpu_load_percent`
| stats min(cpu_load_percent) as min_cpu_load_percent, avg(cpu_load_percent) as avg_cpu_load_percent, median(cpu_load_percent) as median_cpu_load_percent, max(cpu_load_percent) as max_cpu_load_percent, sparkline(avg(cpu_load_percent),) As sparkline by host
| foreach *_percent [ eval &lt;&lt;FIELD&gt;&gt; = round('&lt;&lt;FIELD&gt;&gt;', 3) ]
| rename *_percent AS "* (%)"</pre>
				</div>

				<div>
					<div class="cat_title">
						<a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20(metric_name%3Dos.unix.nmon.cpu.cpu_all.Sys_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.User_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Wait_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Idle_PCT)%20host%3D$host$%20by%20metric_name%2C%20host%20span%3D1m%0A%7C%20%60def_cpu_load_percent%60%0A%7C%20stats%20min(cpu_load_percent)%20as%20min_cpu_load_percent%2C%20avg(cpu_load_percent)%20as%20avg_cpu_load_percent%2C%20median(cpu_load_percent)%20as%20median_cpu_load_percent%2C%20max(cpu_load_percent)%20as%20max_cpu_load_percent%2C%20sparkline(avg(cpu_load_percent)%2C)%20As%20sparkline%20by%20host%0A%7C%20foreach%20*_percent%20%5B%20eval%20&lt;&lt;FIELD&gt;&gt;%20%3D%20round(%27&lt;&lt;FIELD&gt;&gt;%27%2C%203)%20%5D%0A%7C%20rename%20*_percent%20AS%20&quot;*%20(%25)&quot;&amp;display.page.search.tab=statistics&amp;display.general.type=statistics&amp;earliest=-24h&amp;latest=now" class="tryitbtn-blue">Open in search »
						</a>
					</div>
					<br />
				</div>

			</html>

		</panel>
	</row>

	<row>
		<panel>
			<title>Alerting:</title>

			<html>

				<div style="text-align: left;">
					<br />
					<img src="../../static/app/metricator-for-nmon/various/mini/minisingle.png" alt="minisingle"/>
					<br />
					<br />
				</div>

				<div>
					<h2>Find servers having an average CPU usage higher than 90% for a minimal contiguous period of 5 minutes</h2>
					<pre>| mstats avg(_value) as value where `nmon_metrics_index` (metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT) host=$host$ by metric_name, OStype, host span=1m
| `def_cpu_load_percent`
| fields _time, host, cpu_load_percent
| where cpu_load_percent&gt;90
| stats latest(_time) as _time range(_time) as duration latest(cpu_load_percent) as latest_cpu_load_percent by host
| where (latest_cpu_load_percent&gt;=90) AND (duration &gt;= 300)
| eval "duration (hh:mm:ss)"=tostring(duration,"duration")
| fields host,_time,duration,"duration (hh:mm:ss)",latest_cpu_load_percent</pre>
				</div>

				<div>
					<div class="cat_title">
						<a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20(metric_name%3Dos.unix.nmon.cpu.cpu_all.Sys_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.User_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Wait_PCT)%20host%3D$host$%20by%20metric_name%2C%20OStype%2C%20host%20span%3D1m%0A%7C%20%60def_cpu_load_percent%60%0A%7C%20fields%20_time%2C%20host%2C%20cpu_load_percent%0A%7C%20where%20cpu_load_percent&gt;90%0A%7C%20stats%20latest(_time)%20as%20_time%20range(_time)%20as%20duration%20latest(cpu_load_percent)%20as%20latest_cpu_load_percent%20by%20host%0A%7C%20where%20(latest_cpu_load_percent&gt;%3D90)%20AND%20(duration%20&gt;%3D%20300)%0A%7C%20eval%20&quot;duration%20(hh%3Amm%3Ass)&quot;%3Dtostring(duration%2C&quot;duration&quot;)%0A%7C%20fields%20host%2C_time%2Cduration%2C&quot;duration%20(hh%3Amm%3Ass)&quot;%2Clatest_cpu_load_percent&amp;display.page.search.tab=statistics&amp;display.general.type=statistics&amp;earliest=-24h&amp;latest=now" class="tryitbtn-blue">Open in search »
						</a>
					</div>
					<br />
				</div>

				<div>
					<h2>Find servers having an average CPU usage higher than 90% for a minimal contiguous period of 5 minutes, restricted to Open hours and Business days (monday to friday, 08h to 19h)</h2>
					<pre>| mstats avg(_value) as value where `nmon_metrics_index` (metric_name=os.unix.nmon.cpu.cpu_all.Sys_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.User_PCT OR metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT) host=$host$ by metric_name, OStype, host span=1m
| `Day_BusinessDays_8h-19h`
| `def_cpu_load_percent`
| fields _time, host, cpu_load_percent
| where cpu_load_percent&gt;90
| stats latest(_time) as _time range(_time) as duration latest(cpu_load_percent) as latest_cpu_load_percent by host
| where (latest_cpu_load_percent&gt;=90) AND (duration &gt;= 300)
| eval "duration (hh:mm:ss)"=tostring(duration,"duration")
| fields host,_time,duration,"duration (hh:mm:ss)",latest_cpu_load_percent</pre>
				</div>

				<div>
					<div class="cat_title">
						<a target="_blank" href="search?q=%7C%20mstats%20avg(_value)%20as%20value%20where%20%60nmon_metrics_index%60%20(metric_name%3Dos.unix.nmon.cpu.cpu_all.Sys_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.User_PCT%20OR%20metric_name%3Dos.unix.nmon.cpu.cpu_all.Wait_PCT)%20host%3D$host$%20by%20metric_name%2C%20OStype%2C%20host%20span%3D1m%0A%7C%20%60Day_BusinessDays_8h-19h%60%0A%7C%20%60def_cpu_load_percent%60%0A%7C%20fields%20_time%2C%20host%2C%20cpu_load_percent%0A%7C%20where%20cpu_load_percent&gt;90%0A%7C%20stats%20latest(_time)%20as%20_time%20range(_time)%20as%20duration%20latest(cpu_load_percent)%20as%20latest_cpu_load_percent%20by%20host%0A%7C%20where%20(latest_cpu_load_percent&gt;%3D90)%20AND%20(duration%20&gt;%3D%20300)%0A%7C%20eval%20&quot;duration%20(hh%3Amm%3Ass)&quot;%3Dtostring(duration%2C&quot;duration&quot;)%0A%7C%20fields%20host%2C_time%2Cduration%2C&quot;duration%20(hh%3Amm%3Ass)&quot;%2Clatest_cpu_load_percent&amp;display.page.search.tab=statistics&amp;display.general.type=statistics&amp;earliest=-24h&amp;latest=now" class="tryitbtn-blue">Open in search »
						</a>
					</div>
					<br />
				</div>

			</html>

		</panel>

	</row>

</form>
