<form stylesheet="standard.css,ui_simple.css,panel_decoration.css" script="autodiscover.js" isVisible="true" version="1.1" theme="dark">
    <label>NMON AIX Baseline Analysis</label>
    <description>Analyse main system key metrics against the baseline to determine derivation anomalies</description>

    <fieldset autoRun="false" submitButton="false">

        <input type="time" token="timerange" searchWhenChanged="true">
            <label>Time Range:</label>
            <default>
                <earliest>@d</earliest>
                <latest>+1d@d</latest>
            </default>
        </input>

        <input type="dropdown" token="osfilter" searchWhenChanged="true">
            <label>Filter OS Type:</label>
            <default>AIX</default>
            <choice value="*">Any OS</choice>
            <choice value="AIX">AIX</choice>
            <choice value="Linux">Linux</choice>
            <choice value="Solaris">Solaris</choice>
            <prefix>OStype="</prefix>
            <suffix>"</suffix>
        </input>

        <input type="multiselect" token="frameID" searchWhenChanged="true">
            <label>frameID Selection:</label>
            <search base="populate_servers">
                <query>stats count by frameID | fields frameID | dedup frameID | sort 0 frameID</query>
            </search>
            <initialValue>*</initialValue>
            <valuePrefix>frameID="</valuePrefix>
            <valueSuffix>"</valueSuffix>
            <delimiter> OR </delimiter>
            <fieldForLabel>frameID</fieldForLabel>
            <fieldForValue>frameID</fieldForValue>
            <choice value="*">Any</choice>
        </input>

        <input type="text" token="host-prefilter" searchWhenChanged="true">
            <label>Optional: Filter hosts populating</label>
            <default>*</default>
        </input>

        <input id="host" type="dropdown" token="host" searchWhenChanged="true">
            <label>hosts Selection:</label>
            <search base="populate_servers">
                <query>search $frameID$ $host-prefilter$ | stats count by host | dedup host | sort 0 host</query>
            </search>
            <fieldForLabel>host</fieldForLabel>
            <fieldForValue>host</fieldForValue>
        </input>

    </fieldset>

    <!--
    base search for main dropdown populating for Servers
    -->

    <search id="populate_servers">
        <query>| mcatalog values(metric_name) where `nmon_metrics_index` metric_name="os.unix.nmon.cpu.cpu_all.logical_cpus" $osfilter$ by host
| `mapping_frameID`
| stats count by frameID, host | sort 0 host</query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
    </search>

    <!-- Help the user -->

    <row rejects="$host$">
        <panel>
            <html>
                <div class="red_help_user">
                    <p>- - - - - - - - - - ACTION REQUIRED: please select your server name(s) in the host selector above - - - - - - - - - -</p>
                </div>
            </html>
        </panel>
    </row>

    <!-- Information panel -->

    <row rejects="$host$">
        <panel>
            <html>

                <div class="imgheader">
                    <img src="../../static/app/metricator-for-nmon/icons/dark_theme/info.png" alt="Info"/>
                    <h4>Objectives of the baseline: Using system key metrics with an historical analysis to determine expected system resources usage</h4>
                </div>

                <div class="list">
                    <lu>
                        <li><b>Days of week analysis:</b> Evaluate the metric usage against days of week, eg: compare monday values against each available mondays stored within the baseline collection</li>
                        <li><b>Time span accuracy:</b> Each baseline data points represents the average value of each historical value points evaluated with a per 5 minutes accuracy at the lower level</li>
                        <li><b>Future charting:</b> Baseline macros are able to chart in the future if you choose adapted time ranges, by default the period starts at beginning of day and ends at midnight, allowing charting in the future</li>
                        <li><b>Reliability:</b> The baseline data gets better and more accurate over time, several months of data are required to get good results. The More stable your servers are (eg. Production servers), the more reliable will be the baseline data</li>
                        <li><b>Customizing baseline evaluation:</b> The evaluation of the baseline can easily be customized to exclude specific periods from the evaluation to improve baseline accuracy, such as bank holiday, identified Disaster Recovery Tests or Exercises, ask your Splunk admin</li>
                    </lu>
                </div>

            </html>
        </panel>
    </row>

    <row>
        <panel id="settings">
            <title>Settings</title>
            <input type="dropdown" token="baseline" searchWhenChanged="true">
                <label>Type of Baseline:</label>
                <default>full</default>
                <choice value="simple">Simple baseline</choice>
                <choice value="full">Full baseline (lower/predicted/upper)</choice>
            </input>
            <input type="dropdown" token="baselinemode" searchWhenChanged="true">
                <label>Charting the future:</label>
                <default>_future</default>
                <choice value="_future">True</choice>
                <choice value="">False</choice>
            </input>
            <input type="dropdown" token="statsmode" searchWhenChanged="true">
                <label>Stats mode:</label>
                <default>avg</default>
                <choice value="max">Max</choice>
                <choice value="avg">Avg</choice>
            </input>            
            <input type="dropdown" token="chart" searchWhenChanged="true">
                <label>Type of chart:</label>
                <default>line</default>
                <choice value="area">Area</choice>
                <choice value="line">Line</choice>
                <choice value="column">Column</choice>
                <choice value="bar">Bar</choice>
            </input>
            <input type="dropdown" token="charting.chart.nullValueMode" searchWhenChanged="true">
                <label>Missing Data:</label>
                <default>connect</default>
                <choice value="gaps">Gaps</choice>
                <choice value="connect">Connect</choice>
                <choice value="zero">Zero</choice>
            </input>
            <input type="dropdown" token="charting.legend.placement" searchWhenChanged="true">
                <label>Legend placement:</label>
                <default>bottom</default>
                <choice value="bottom">Bottom</choice>
                <choice value="top">Top</choice>
                <choice value="left">left</choice>
                <choice value="right">right</choice>
                <choice value="none">none</choice>
            </input>
        </panel>
    </row>
    <row>
        <panel id="cpu1">
            <title>Virtual CPUs Usage vs baseline</title>
            <chart>
                <search>
                    <query>| `nmon_vp_usage_$baseline$_baseline$baselinemode$($host$,$statsmode$)`</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                </search>
                <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
                <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
                <option name="charting.axisTitleX.visibility">visible</option>
                <option name="charting.axisTitleY.visibility">visible</option>
                <option name="charting.axisTitleY2.visibility">visible</option>
                <option name="charting.axisX.scale">linear</option>
                <option name="charting.axisY.scale">linear</option>
                <option name="charting.axisY2.enabled">false</option>
                <option name="charting.axisY2.scale">inherit</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.bubbleMaximumSize">50</option>
                <option name="charting.chart.bubbleMinimumSize">10</option>
                <option name="charting.chart.bubbleSizeBy">area</option>
                <option name="charting.chart.nullValueMode">$charting.chart.nullValueMode$</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">default</option>
                <option name="charting.chart.style">shiny</option>
                <option name="charting.drilldown">all</option>
                <option name="charting.layout.splitSeries">0</option>
                <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
                <option name="charting.legend.placement">$charting.legend.placement$</option>
                <option name="charting.axisTitleY.text">virtual CPUs</option>
                <option name="height">450</option>
                <option name="charting.fieldColors">{"baseline_avg_vp_usage": 0xF69D1F,"vp_usage": 0x259FF8,"entitled": 0x00e600,"virtualCPUs":0xE60000}</option>
                <option name="charting.chart.overlayFields">baseline_avg_vp_usage, entitled, virtualCPUs</option>
                <drilldown target="search">
                    <link>search?earliest=$earliest$&amp;latest=$latest$&amp;q=%7C%20%60nmon_vp_usage_$baseline$_baseline$baselinemode$($host$,$statsmode$)%60&amp;display.page.search.tab=visualizations&amp;display.general.type=visualizations&amp;display.visualizations.charting.chart.overlayFields=baseline_avg_vp_usage&amp;display.visualizations.charting.chart.overlayFields=entitled&amp;display.visualizations.charting.chart.overlayFields=virtualCPUs</link>
                </drilldown>
            </chart>
        </panel>
    </row>
    <row>
        <panel id="cpu2">
            <title>Shared Pool CPUs Usage vs baseline</title>
            <chart>
                <search>
                    <query>| `nmon_pool_usage_$baseline$_baseline$baselinemode$($host$,$statsmode$)`</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                </search>
                <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
                <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
                <option name="charting.axisTitleX.visibility">visible</option>
                <option name="charting.axisTitleY.visibility">visible</option>
                <option name="charting.axisTitleY2.visibility">visible</option>
                <option name="charting.axisX.scale">linear</option>
                <option name="charting.axisY.scale">linear</option>
                <option name="charting.axisY2.enabled">false</option>
                <option name="charting.axisY2.scale">inherit</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.bubbleMaximumSize">50</option>
                <option name="charting.chart.bubbleMinimumSize">10</option>
                <option name="charting.chart.bubbleSizeBy">area</option>
                <option name="charting.chart.nullValueMode">$charting.chart.nullValueMode$</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">default</option>
                <option name="charting.chart.style">shiny</option>
                <option name="charting.drilldown">all</option>
                <option name="charting.layout.splitSeries">0</option>
                <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
                <option name="charting.legend.placement">$charting.legend.placement$</option>
                <option name="charting.axisTitleY.text">virtual CPUs</option>
                <option name="height">450</option>
                <option name="charting.fieldColors">{"baseline_avg_pool_usage": 0xF69D1F,"pool_usage": 0x259FF8,"poolCPUs":0xE60000}</option>
                <option name="charting.chart.overlayFields">baseline_avg_pool_usage, poolCPUs</option>
                <drilldown target="search">
                    <link>search?earliest=$earliest$&amp;latest=$latest$&amp;q=%7C%20%60nmon_pool_usage_$baseline$_baseline$baselinemode$($host$,$statsmode$)%60&amp;display.page.search.tab=visualizations&amp;display.general.type=visualizations&amp;display.visualizations.charting.chart.overlayFields=baseline_avg_pool_usage&amp;display.visualizations.charting.chart.overlayFields=poolCPUs</link>
                </drilldown>
            </chart>
        </panel>
    </row>
    <row>
        <panel id="mem1">
            <title>Real Memory Percentage Usage vs baseline</title>
            <input type="checkbox" token="realmem_scale" searchWhenChanged="true">
                <label></label>
                <initialValue>0</initialValue>
                <choice value="0">Starts scale at 0 %</choice>
            </input>
            <input type="checkbox" token="realmem_scaleend" searchWhenChanged="true">
                <label></label>
                <initialValue>100</initialValue>
                <choice value="100">Ends scale at 100 %</choice>
            </input>
            <chart>
                <search>
                    <query>| `nmon_real_mem_$baseline$_baseline$baselinemode$($host$,$statsmode$)`</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                </search>
                <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
                <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
                <option name="charting.axisTitleX.visibility">visible</option>
                <option name="charting.axisTitleY.visibility">visible</option>
                <option name="charting.axisTitleY2.visibility">visible</option>
                <option name="charting.axisX.scale">linear</option>
                <option name="charting.axisY.scale">linear</option>
                <option name="charting.axisY2.enabled">false</option>
                <option name="charting.axisY2.scale">inherit</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.bubbleMaximumSize">50</option>
                <option name="charting.chart.bubbleMinimumSize">10</option>
                <option name="charting.chart.bubbleSizeBy">area</option>
                <option name="charting.chart.nullValueMode">$charting.chart.nullValueMode$</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">default</option>
                <option name="charting.chart.style">shiny</option>
                <option name="charting.drilldown">all</option>
                <option name="charting.layout.splitSeries">0</option>
                <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
                <option name="charting.legend.placement">$charting.legend.placement$</option>
                <option name="charting.axisTitleY.text">% Real Mem</option>
                <option name="height">450</option>
                <option name="charting.fieldColors">{"baseline_avg_real_mem": 0xF69D1F,"avg_real_mem": 0x259FF8}</option>
                <option name="charting.chart.overlayFields">baseline_avg_real_mem</option>
                <option name="charting.axisY.minimumNumber">$realmem_scale$</option>
                <option name="charting.axisY.maximumNumber">$realmem_scaleend$</option>
                <drilldown target="search">
                    <link>search?earliest=$earliest$&amp;latest=$latest$&amp;q=%7C%20%60nmon_real_mem_$baseline$_baseline$baselinemode$($host$,$statsmode$)%60&amp;display.page.search.tab=visualizations&amp;display.general.type=visualizations&amp;display.visualizations.charting.chart.overlayFields=baseline_avg_real_mem</link>
                </drilldown>
            </chart>
        </panel>
    </row>
    <row>
        <panel id="mem2">
            <title>Virtual Memory Percentage Usage vs baseline</title>
            <input type="checkbox" token="virtualmem_scalestart" searchWhenChanged="true">
                <label></label>
                <initialValue>0</initialValue>
                <choice value="0">Starts scale at 0 %</choice>
            </input>
            <input type="checkbox" token="virtualmem_scaleend" searchWhenChanged="true">
                <label></label>
                <choice value="100">Ends scale at 100 %</choice>
            </input>
            <chart>
                <search>
                    <query>| `nmon_virtual_mem_$baseline$_baseline$baselinemode$($host$,$statsmode$)`</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                </search>
                <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
                <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
                <option name="charting.axisTitleX.visibility">visible</option>
                <option name="charting.axisTitleY.visibility">visible</option>
                <option name="charting.axisTitleY2.visibility">visible</option>
                <option name="charting.axisX.scale">linear</option>
                <option name="charting.axisY.scale">linear</option>
                <option name="charting.axisY2.enabled">false</option>
                <option name="charting.axisY2.scale">inherit</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.bubbleMaximumSize">50</option>
                <option name="charting.chart.bubbleMinimumSize">10</option>
                <option name="charting.chart.bubbleSizeBy">area</option>
                <option name="charting.chart.nullValueMode">$charting.chart.nullValueMode$</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">default</option>
                <option name="charting.chart.style">shiny</option>
                <option name="charting.drilldown">all</option>
                <option name="charting.layout.splitSeries">0</option>
                <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
                <option name="charting.legend.placement">$charting.legend.placement$</option>
                <option name="charting.axisTitleY.text">% Virtual Mem</option>
                <option name="height">450</option>
                <option name="charting.fieldColors">{"baseline_avg_virtual_mem": 0xF69D1F,"avg_virtual_mem": 0x259FF8}</option>
                <option name="charting.chart.overlayFields">baseline_avg_virtual_mem</option>
                <option name="charting.axisY.minimumNumber">$virtualmem_scalestart$</option>
                <option name="charting.axisY.maximumNumber">$virtualmem_scaleend$</option>
                <drilldown target="search">
                    <link>search?earliest=$earliest$&amp;latest=$latest$&amp;q=%7C%20%60nmon_virtual_mem_$baseline$_baseline$baselinemode$($host$,$statsmode$)%60&amp;display.page.search.tab=visualizations&amp;display.general.type=visualizations&amp;display.visualizations.charting.chart.overlayFields=baseline_avg_virtual_mem</link>
                </drilldown>
            </chart>
        </panel>
    </row>
    <row>
        <panel id="disk">
            <title>Number of I/O per sec vs baseline</title>
            <input type="checkbox" token="iopsmem_scale" searchWhenChanged="true">
                <label></label>
                <initialValue>0</initialValue>
                <choice value="0">Starts scale at 0 I/O per sec</choice>
            </input>
            <chart>
                <search>
                    <query>| `nmon_iops_$baseline$_baseline$baselinemode$($host$,$statsmode$)`</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                </search>
                <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
                <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
                <option name="charting.axisTitleX.visibility">visible</option>
                <option name="charting.axisTitleY.visibility">visible</option>
                <option name="charting.axisTitleY2.visibility">visible</option>
                <option name="charting.axisX.scale">linear</option>
                <option name="charting.axisY.scale">linear</option>
                <option name="charting.axisY2.enabled">false</option>
                <option name="charting.axisY2.scale">inherit</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.bubbleMaximumSize">50</option>
                <option name="charting.chart.bubbleMinimumSize">10</option>
                <option name="charting.chart.bubbleSizeBy">area</option>
                <option name="charting.chart.nullValueMode">$charting.chart.nullValueMode$</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">default</option>
                <option name="charting.chart.style">shiny</option>
                <option name="charting.drilldown">all</option>
                <option name="charting.layout.splitSeries">0</option>
                <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
                <option name="charting.legend.placement">$charting.legend.placement$</option>
                <option name="charting.axisTitleY.text">Nbr I/O per sec</option>
                <option name="height">450</option>
                <option name="charting.fieldColors">{"baseline_disk_iops": 0xF69D1F,"disk_iops": 0x259FF8}</option>
                <option name="charting.chart.overlayFields">baseline_disk_iops</option>
                <option name="charting.axisY.minimumNumber">$iopsmem_scale$</option>
                <drilldown target="search">
                    <link>search?earliest=$earliest$&amp;latest=$latest$&amp;q=%7C%20%60nmon_iops_$baseline$_baseline$baselinemode$($host$,$statsmode$)%60&amp;display.page.search.tab=visualizations&amp;display.general.type=visualizations&amp;display.visualizations.charting.chart.overlayFields=baseline_disk_iops</link>
                </drilldown>
            </chart>
        </panel>
    </row>
</form>
