<form hideFooter="true" hideSplunkBar="false" hideAppBar="false" hideChrome="false" hideEdit="true" hideTitle="false" version="1.1" theme="dark">
    <label>Dark MONITORING</label>

    <row>
        <panel>

            <title>Select: Timerange - Auto-refresh - frameID - host</title>

            <input type="time" token="timerange">
                <label>Time range:</label>
                <default>
                    <earliest>-24h@h</earliest>
                    <latest>now</latest>
                </default>
                <change>
                    <unset token="form.refresh"></unset>
                </change>
            </input>

            <input type="dropdown" token="refresh" searchWhenChanged="true">
                <label>Auto-refresh:</label>
                <fieldForLabel>label</fieldForLabel>
                <fieldForValue>value</fieldForValue>
                <selectFirstChoice>true</selectFirstChoice>
                <search>
                    <query>| `def_auto_refresh`</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                </search>
            </input>

            <input id="frameID" type="dropdown" token="frameID" searchWhenChanged="true">
                <label>Frame IDs:</label>
                <!-- Populating Data Model Search -->
                <search base="populate">
                    <query>stats count by frameID | dedup frameID | sort 0 frameID</query>
                </search>
                <prefix>frameID=</prefix>
                <choice value="*">Any</choice>
                <initialValue>*</initialValue>
                <fieldForLabel>frameID</fieldForLabel>
                <fieldForValue>frameID</fieldForValue>
            </input>

            <input id="host" type="dropdown" token="host" searchWhenChanged="true">
                <label>Hosts Selection:</label>
                <!-- Populating Data Model Search -->
                <search base="populate">
                    <query>search $frameID$
    | stats count by host | dedup host | sort 0 host</query>
                </search>
                <prefix>host="</prefix>
                <suffix>"</suffix>
                <fieldForLabel>host</fieldForLabel>
                <fieldForValue>host</fieldForValue>
            </input>

        </panel>
    </row>


    <!-- Base Searches for PostProcessing -->

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

    <!--
    Dynamic configuration
    The following searches are being used to define various tokens using event handlers
    -->

    <!-- DF_STORAGE data availability -->

    <search>
        <query>| mcatalog values(metric_name) where `nmon_metrics_index` metric_name="os.unix.nmon.storage.df_storage.Use_pct" $host$ | stats count | where count&gt;0</query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
        <progress>
            <condition match="$job.resultCount$ == 0">
                    <set token="start_jfs_storage_search">true</set>
                    <unset token="start_df_storage_search"></unset>
            </condition>
            <condition>
                    <set token="start_df_storage_search">true</set>
                    <unset token="start_jfs_storage_search"></unset>
            </condition>
        </progress>
    </search>

    <row>
        <panel>
            <single>
                <search>
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` `def_cpu_all_os_metric_filters` $host$ by metric_name, OStype, host span=1m
| `def_all_os_cpu_load_percent`
| timechart `nmon_span` avg(cpu_load_percent) AS cpu_load_percent | where isnotnull(cpu_load_percent)</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="colorBy">trend</option>
                <option name="drilldown">all</option>
                <option name="numberPrecision">0.00</option>
                <option name="refresh.display">none</option>
                <option name="trendColorInterpretation">inverse</option>
                <option name="trendDisplayMode">percent</option>
                <option name="underLabel">CPU %</option>
                <option name="useColors">1</option>
            </single>
        </panel>
        <panel>
            <single>
                <search>
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` `def_phys_memory_all_os_metric_filters` $host$ by OStype, host, metric_name span=1m
| `def_memory_load_percent`
| timechart `nmon_span` avg(mem_used_effective_PCT) AS mem_used_effective_PCT | where isnotnull(mem_used_effective_PCT)</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="colorBy">trend</option>
                <option name="drilldown">all</option>
                <option name="numberPrecision">0.00</option>
                <option name="refresh.display">none</option>
                <option name="trendColorInterpretation">inverse</option>
                <option name="trendDisplayMode">percent</option>
                <option name="underLabel">MEMORY %</option>
                <option name="useColors">1</option>
            </single>
        </panel>
        <panel>
            <single>
                <search>
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` metric_name="os.unix.nmon.system.uptime.load_average_5min" $host$ by metric_name, host span=1m
| timechart `nmon_span` avg(value) as load_average_5min | where isnotnull(load_average_5min)</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="colorBy">trend</option>
                <option name="drilldown">all</option>
                <option name="numberPrecision">0.00</option>
                <option name="refresh.display">none</option>
                <option name="trendColorInterpretation">inverse</option>
                <option name="underLabel">5 MIN LOAD AVG</option>
                <option name="useColors">1</option>
            </single>
        </panel>
        <panel>
            <single>
                <search>
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` (metric_name=os.unix.nmon.cpu.cpu_all.Wait_PCT OR metric_name=os.unix.nmon.cpu.lpar.VP_Wait_PCT) $host$ by metric_name, OStype, host span=1m prestats=f
| rex field="metric_name" "os.unix.nmon.cpu.[^\.]*.(?&lt;metric&gt;.*)"
| eval {metric}=value
| stats values(Wait_PCT) as Wait_PCT, values(VP_Wait_PCT) as VP_Wait_PCT by _time, host
| eventstats count(eval(VP_Wait_PCT>0)) as count_lpar by host
| eval cpu_wait_percent=if(count_lpar>0, VP_Wait_PCT, Wait_PCT)
| timechart `nmon_span` avg(cpu_wait_percent) AS cpu_wait_percent | where isnotnull(cpu_wait_percent)</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="colorBy">trend</option>
                <option name="drilldown">all</option>
                <option name="numberPrecision">0.00</option>
                <option name="refresh.display">none</option>
                <option name="trendColorInterpretation">inverse</option>
                <option name="trendDisplayMode">percent</option>
                <option name="underLabel">WAIT/IO %</option>
                <option name="useColors">1</option>
            </single>
        </panel>
    </row>
    <row>
        <panel>
            <title>CPU usage</title>
            <chart>
                <search>
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` `def_cpu_all_os_metric_filters` $host$ by metric_name, OStype, host span=1m
| `def_all_os_cpu_load_percent`
| timechart `nmon_span` avg(cpu_load_percent) AS cpu_load_percent</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisLabelsY.majorUnit">25</option>
                <option name="charting.axisY.maximumNumber">101</option>
                <option name="charting.axisY.minimumNumber">0</option>
                <option name="charting.axisTitleX.visibility">collapsed</option>
                <option name="charting.axisTitleY.text">Percent</option>
                <!-- Set background color -->
                <option name="charting.backgroundColor">#292C33</option>
                <!-- Set foreground color -->
                <option name="charting.foregroundColor">#EBF5FF</option>
                <!-- Set font color (axis labels, legends) -->
                <option name="charting.fontColor">#BFBFBF</option>
                <option name="charting.chart">line</option>
                <option name="charting.legend.placement">bottom</option>
                <option name="refresh.display">none</option>
                <option name="height">280</option>
            </chart>
        </panel>
        <panel>
            <title>Load average</title>
            <chart>
                <search>
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` metric_name=os.unix.nmon.system.uptime.load_average_1min OR metric_name=os.unix.nmon.system.uptime.load_average_5min OR metric_name=os.unix.nmon.system.uptime.load_average_15min $host$ by metric_name, host span=1m
| `extract_metrics`
| eval {metric}=value
| fillnull value=0 load_average_1min load_average_5min load_average_15min
| timechart `nmon_span` avg(load_average_1min) as load_average_1min, avg(load_average_5min) as load_average_5min, avg(load_average_15min) as load_average_15min | fields _time,load_average_1min,load_average_5min,load_average_15min | fields _time,load_average_1min,load_average_5min,load_average_15min</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisTitleX.visibility">collapsed</option>
                <option name="charting.axisTitleY.text">Load average</option>
                <!-- Set background color -->
                <option name="charting.backgroundColor">#292C33</option>
                <!-- Set foreground color -->
                <option name="charting.foregroundColor">#EBF5FF</option>
                <!-- Set font color (axis labels, legends) -->
                <option name="charting.fontColor">#BFBFBF</option>
                <option name="charting.chart">line</option>
                <option name="charting.legend.placement">bottom</option>
                <option name="refresh.display">none</option>
                <option name="height">280</option>
            </chart>
        </panel>
    </row>
    <row>
        <panel>
            <title>Running processes</title>
            <chart>
                <search>
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` metric_name=os.unix.nmon.processes.proccount.nb_running_processes $host$ span=1m
| timechart `nmon_span` avg(value) as running_processes</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisTitleX.visibility">collapsed</option>
                <option name="charting.axisY.minimumNumber">0</option>
                <option name="charting.axisTitleY.text">Nb running processes</option>
                <!-- Set background color -->
                <option name="charting.backgroundColor">#292C33</option>
                <!-- Set foreground color -->
                <option name="charting.foregroundColor">#EBF5FF</option>
                <!-- Set font color (axis labels, legends) -->
                <option name="charting.fontColor">#BFBFBF</option>
                <option name="charting.chart">line</option>
                <option name="charting.legend.placement">none</option>
                <option name="refresh.display">none</option>
                <option name="height">280</option>
            </chart>
        </panel>
        <panel>
            <title>Processes CPU usage</title>
            <chart>
                <search>
                    <query>| mstats max(_value) as value where `nmon_metrics_index` metric_name="os.unix.nmon.processes.top.pct_CPU" $host$ by host, metric_name, dimension_Command dimension_PID span=1m
| stats sum(value) as pct_CPU by _time, host, dimension_Command
| appendcols [ | mstats latest(_value) as logical_cpus where `nmon_metrics_index` metric_name="os.unix.nmon.cpu.cpu_all.logical_cpus" host=GMD-LAPTOP by host ]
| appendcols [ | mstats latest(_value) as virtual_cpus where `nmon_metrics_index` metric_name="os.unix.nmon.cpu.cpu_all.virtual_cpus" host=GMD-LAPTOP by host ]
| filldown logical_cpus, virtual_cpus
| stats values(pct_CPU) as pct_CPU, values(logical_cpus) as logical_cpus, values(virtual_cpus) as virtual_cpus by _time, host, dimension_Command
| eval usage_per_core=(pct_CPU/100), smt_threads=(logical_cpus/virtual_cpus)
| eval usage_per_core=case(isnum(smt_threads) AND smt_threads>="2", usage_per_core*1.2, isnum(smt_threads) AND smt_threads>="4", usage_per_core*1.4, isnum(usage_per_core), usage_per_core)
| timechart `nmon_span` useother=f limit="20" max(usage_per_core) as "CPU Usage per core" by dimension_Command</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisTitleX.visibility">collapsed</option>
                <option name="charting.axisTitleY.text">core cpu</option>
                <!-- Set background color -->
                <option name="charting.backgroundColor">#292C33</option>
                <!-- Set foreground color -->
                <option name="charting.foregroundColor">#EBF5FF</option>
                <!-- Set font color (axis labels, legends) -->
                <option name="charting.fontColor">#BFBFBF</option>
                <option name="charting.chart">column</option>
                <option name="charting.chart.stackMode">stacked</option>
                <option name="charting.legend.placement">bottom</option>
                <option name="charting.chart.nullValueMode">0</option>
                <option name="refresh.display">none</option>
                <option name="height">280</option>
            </chart>
        </panel>
    </row>
    <row>
        <panel>
            <title>Memory usage</title>
            <chart>
                <search>
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` `def_memory_all_os_metric_filters` $host$ by OStype, host, metric_name span=1m
| `def_memory_load_percent`
| timechart `nmon_span` dedup_splitvals=t avg(mem_used_effective_PCT) AS mem_used_PCT, avg(swap_used_effective_PCT) AS swap_used_PCT</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisLabelsY.majorUnit">25</option>
                <option name="charting.axisY.maximumNumber">101</option>
                <option name="charting.axisY.minimumNumber">0</option>
                <option name="charting.axisTitleX.visibility">collapsed</option>
                <option name="charting.axisTitleY.text">Percent</option>
                <!-- Set background color -->
                <option name="charting.backgroundColor">#292C33</option>
                <!-- Set foreground color -->
                <option name="charting.foregroundColor">#EBF5FF</option>
                <!-- Set font color (axis labels, legends) -->
                <option name="charting.fontColor">#BFBFBF</option>
                <option name="charting.chart">line</option>
                <option name="charting.legend.placement">bottom</option>
                <option name="refresh.display">none</option>
                <option name="height">280</option>
            </chart>
        </panel>
        <panel>
            <title>Network traffic</title>
            <chart>
                <search>
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` metric_name=os.unix.nmon.network.net $host$ (dimension_device!="*lo*") by metric_name, host, dimension_device span=1m
| where value&gt;0
| eval traffic_type=case(match(dimension_device, ".+read.+"), "Inbound", match(dimension_device, ".+write.+"), "Outbound")
| eval value=case(traffic_type="Outbound", "-" . value, traffic_type="Inbound", value)
| timechart `nmon_span` avg(value) as value by traffic_type</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisTitleX.visibility">collapsed</option>
                <option name="charting.axisTitleY.text">KBps</option>
                <!-- Set background color -->
                <option name="charting.backgroundColor">#292C33</option>
                <!-- Set foreground color -->
                <option name="charting.foregroundColor">#EBF5FF</option>
                <!-- Set font color (axis labels, legends) -->
                <option name="charting.fontColor">#BFBFBF</option>
                <option name="charting.chart">area</option>
                <option name="charting.legend.placement">bottom</option>
                <option name="refresh.display">none</option>
                <option name="height">280</option>
            </chart>
        </panel>
    </row>
    <row>
        <panel>
            <title>File-system usage</title>
            <chart depends="$start_df_storage_search$">
                <search depends="$start_df_storage_search$">
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` metric_name="os.unix.nmon.storage.df_storage.Use_pct" $host$ dimension_mount="*" by host, dimension_mount span=1m
| timechart `nmon_span` latest(value) as storage_used_percent by dimension_mount</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisLabelsY.majorUnit">25</option>
                <option name="charting.axisY.maximumNumber">101</option>
                <option name="charting.axisY.minimumNumber">0</option>
                <option name="charting.axisTitleX.visibility">collapsed</option>
                <option name="charting.axisTitleY.text">Percent</option>
                <option name="charting.axisY.maximumNumber">101</option>
                <!-- Set background color -->
                <option name="charting.backgroundColor">#292C33</option>
                <!-- Set foreground color -->
                <option name="charting.foregroundColor">#EBF5FF</option>
                <!-- Set font color (axis labels, legends) -->
                <option name="charting.fontColor">#BFBFBF</option>
                <option name="charting.chart">line</option>
                <option name="charting.legend.placement">bottom</option>
                <option name="height">280</option>
                <option name="refresh.display">none</option>
            </chart>
            <chart depends="$start_jfs_storage_search$">
                <search depends="$start_jfs_storage_search$">
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` metric_name="os.unix.nmon.storage.jfsfile" $host$ by host, dimension_mount span=1m
| timechart `nmon_span` limit=0 useother=f latest(value) As value by dimension_mount</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisLabelsY.majorUnit">25</option>
                <option name="charting.axisY.maximumNumber">101</option>
                <option name="charting.axisY.minimumNumber">0</option>
                <option name="charting.axisTitleX.visibility">collapsed</option>
                <option name="charting.axisTitleY.text">Percent</option>
                <option name="charting.axisY.maximumNumber">101</option>
                <!-- Set background color -->
                <option name="charting.backgroundColor">#292C33</option>
                <!-- Set foreground color -->
                <option name="charting.foregroundColor">#EBF5FF</option>
                <!-- Set font color (axis labels, legends) -->
                <option name="charting.fontColor">#BFBFBF</option>
                <option name="charting.chart">line</option>
                <option name="charting.legend.placement">bottom</option>
                <option name="height">280</option>
                <option name="refresh.display">none</option>
            </chart>
        </panel>
        <panel>
            <title>Disks IOPS</title>
            <chart>
                <search>
                    <query>| mstats max(_value) as value where `nmon_metrics_index` (metric_name="os.unix.nmon.storage.dgxfer" OR metric_name="os.unix.nmon.storage.diskxfer") $host$ by host, metric_name, dimension_device span=1m
| stats sum(value) as value by _time, host, metric_name
| eval dgxfer_iops=case(match(metric_name, "dgxfer"), value), diskxfer_iops=case(match(metric_name, "diskxfer"), value)
| stats values(dgxfer_iops) as dgxfer_iops, values(diskxfer_iops) as diskxfer_iops by _time, host
| eval iops=if(isnum('dgxfer_iops'), 'dgxfer_iops', 'diskxfer_iops')
| timechart `nmon_span` avg(iops) as avg_iops</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisTitleX.visibility">collapsed</option>
                <option name="charting.axisTitleY.text">I/O per second</option>
                <!-- Set background color -->
                <option name="charting.backgroundColor">#292C33</option>
                <!-- Set foreground color -->
                <option name="charting.foregroundColor">#EBF5FF</option>
                <!-- Set font color (axis labels, legends) -->
                <option name="charting.fontColor">#BFBFBF</option>
                <option name="charting.chart">line</option>
                <option name="charting.legend.placement">bottom</option>
                <option name="refresh.display">none</option>
                <option name="height">280</option>
            </chart>
        </panel>
    </row>
</form>
