<form stylesheet="ui_simple.css,panel_decoration.css,table_data_bar.css" script="table_data_bar.js,modal.js" isVisible="true" version="1.1" theme="dark">
    <label>UI STORAGE, utilization statistics of file systems</label>
    <description>User Interface for file systems related statistics (DF_STORAGE, DF_INODES)</description>

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

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

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

        <input type="dropdown" token="datasource" searchWhenChanged="true">
            <label>Metric collection:</label>
            <default>DF_STORAGE</default>
            <choice value="DF_STORAGE">DF_STORAGE (volume usage statistics)</choice>
            <choice value="JFSFILE">JFSFILE (volume pct only usage statistics)</choice>
            <choice value="DF_INODES">DF_INODES (volume inodes usage statistics)</choice>
            <change>
                <condition value="DF_STORAGE">
                        <set token="metric_name">os.unix.nmon.storage.df_storage</set>
                        <set token="start_df_storage_search">true</set>
                        <unset token="start_jfsfile_storage_search"></unset>
                        <unset token="start_df_inodes_search"></unset>
                </condition>
                <condition value="JFSFILE">
                        <set token="metric_name">os.unix.nmon.storage.jfsfile</set>
                        <set token="start_jfsfile_storage_search">true</set>
                        <unset token="start_df_storage_search"></unset>
                        <unset token="start_df_inodes_search"></unset>
                </condition>
                <condition value="DF_INODES">
                        <set token="metric_name">os.unix.nmon.storage.df_inodes</set>
                        <set token="start_df_inodes_search">true</set>
                        <unset token="start_df_storage_search"></unset>
                        <unset token="start_jfsfile_storage_search"></unset>
                </condition>
            </change>
        </input>

        <input id="frameID" type="multiselect" 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>
            <valuePrefix>frameID=</valuePrefix>
            <delimiter> OR </delimiter>
            <choice value="*">Any</choice>
            <initialValue>*</initialValue>
            <fieldForLabel>frameID</fieldForLabel>
            <fieldForValue>frameID</fieldForValue>
        </input>

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

		<input id="host" type="multiselect" token="host" searchWhenChanged="true">
		    <label>Hosts Selection:</label>
		    <!-- Populating Data Model Search -->
		    <search base="populate">
		        <query>search $frameID$ host=$host-prefilter$
	| stats count by host | dedup host | sort 0 host</query>
		    </search>
		    <valuePrefix>host="</valuePrefix>
		    <valueSuffix>"</valueSuffix>
		    <delimiter> OR </delimiter>
		    <choice value="*">ALL Hosts</choice>
		    <fieldForLabel>host</fieldForLabel>
		    <fieldForValue>host</fieldForValue>
		    <change>
		        <condition>
		            <unset token="form.host_query_input"></unset>
		        </condition>
		    </change>
		</input>

		<!-- hidden form that handles the advanced definition of hosts selection -->

		<input id="host_query_input" type="dropdown" token="host_query" searchWhenChanged="true" depends="$hidden_form$">
		    <label>Hosts Selection:</label>
		    <search base="populate">
		        <query>search $host$ $frameID$
	| stats values(host) as host
	| format | fields - host | rename search as host</query>
		    </search>
		    <selectFirstChoice>true</selectFirstChoice>
		    <fieldForLabel>host</fieldForLabel>
		    <fieldForValue>host</fieldForValue>
		</input>

        <input type="multiselect" token="mount" searchWhenChanged="true">
            <label>mount Selection:</label>
            <!-- Populating Data Model Search -->
            <search base="populate">
                <query>search $frameID$ $host$
| stats count by dimension_mount | dedup dimension_mount | sort 0 dimension_mount</query>
            </search>
            <valuePrefix>dimension_mount="</valuePrefix>
            <valueSuffix>"</valueSuffix>
            <delimiter> OR </delimiter>
            <initialValue>*</initialValue>
            <choice value="*">ALL</choice>
            <fieldForLabel>dimension_mount</fieldForLabel>
            <fieldForValue>dimension_mount</fieldForValue>
        </input>

        <input type="text" token="fsfilter" searchWhenChanged="true">
            <label>Filter FileSystems by pattern:</label>
            <default>*</default>
            <prefix>dimension_mount="</prefix>
            <suffix>"</suffix>
        </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>

    </fieldset>

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

    <!-- 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>

    <!-- Help the user -->

    <row depends="$host$" rejects="$mount$">
        <panel>
            <html>
                <div class="red_help_user">
                    <p> - - - - - - - - - - ACTION REQUIRED: please select associated devices to be analysed in the device selector above - - - - - - - - - -</p>
                </div>
            </html>
        </panel>
    </row>

    <!-- ################################ -->

    <!-- Information panel -->

    <row>
        <panel>
            <html>

                <div class="imgheader custom-modal">
                    <img src="../../static/app/metricator-for-nmon/icons/dark_theme/info.png" alt="Info"/>
                    <h4><a data-modal-name="Help_modal">Help, information and related links for file systems statistics</a></h4>
                </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/drive.png" alt="drive"/>
                                    <h1>STORAGE - File systems utilisation statistics (os.unix.nmon.storage.df_storage*/df_storage*/jfsfile)</h1>
                                </div>

                                <div>
                                    <h1>DF_STORAGE - raw metrics and dimensions:</h1>

                                    External collection which runs the Unix "df -k" command in POSIX mode and is available for all operating systems, the following fields and statistics are available:

                                    <br />
                                    <div class="list">
                                        <lu>
                                            <li><b>dimension_filesystem:</b> logical name of the device associated with the file system</li>
                                            <li><b>dimension_mount:</b> mount point of the file system</li>
                                            <li><b>blocks:</b> size of the file system in KB</li>
                                        </lu>
                                    </div>

                                    <div class="list">
                                        <lu>
                                            <li><b>Used:</b> volume used the file system in KB</li>
                                            <li><b>Use_pct:</b> volume used on the file system in percentage</li>
                                            <li><b>Available:</b> volume free on the file system in KB</li>
                                        </lu>
                                    </div>

                                    <h1>DF_INODES - raw metrics and dimensions:</h1>

                                    External collection which runs the Unix "df -i" command in POSIX mode and is available for all operating systems, the following fields and statistics are available:

                                    <br />
                                    <div class="list">
                                        <lu>
                                            <li><b>dimension_filesystem:</b> logical name of the device associated with the file system</li>
                                            <li><b>dimension_mount:</b> mount point of the file system</li>
                                            <li><b>Inodes:</b> number of inodes of the file system (Linux only)</li>
                                        </lu>
                                    </div>

                                    <div class="list">
                                        <lu>
                                            <li><b>IFree:</b> number of free inodes on the file system in KB (Linux only)</li>
                                            <li><b>IUsed:</b> number of used inodes the file system in KB</li>
                                            <li><b>IUse_pct:</b> inodes used on the file system in percentage</li>
                                        </lu>
                                    </div>

                                    <h1>JFSFILE - raw metrics and dimensions:</h1>

                                    <div class="list">
                                        <lu>
                                            <li><b>dimension_mount:</b> mount point of the file system</li>
                                            <li><b>value:</b> number of inodes of the file system (Linux only)</li>
                                        </lu>
                                    </div>

                                    <br />

                                </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%20values(dimension_mount)%20as%20dimension_mount%20values(dimension_filesystem)%20as%20dimension_filesystem%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.storage.df_storage*%20host%3D*" class="tryitbtnxl">mcatalog df_storage »
                                    </a>

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

                                    <a target="_blank" href="search?q=%7C%20mcatalog%20values(metric_name)%20as%20metrics%20values(dimension_mount)%20as%20dimension_mount%20values(dimension_filesystem)%20as%20dimension_filesystem%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.storage.df_inodes*%20host%3D*" class="tryitbtnxl">mcatalog df_inodes »
                                    </a>

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

                                    <a target="_blank" href="search?q=%7C%20mcatalog%20values(metric_name)%20as%20metrics%20values(dimension_mount)%20as%20dimension_mount%20where%20%60nmon_metrics_index%60%20metric_name%3Dos.unix.nmon.storage.jfsfile%20host%3D*" class="tryitbtnxl">mcatalog jfsfile »
                                    </a>

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

                                    <a target="_blank" href="Howto_DISK_spl" class="tryitbtnxl">HOWTO Interface for disks»
                                    </a>

                                    <a target="_blank" href="UI_data_dictionary?&amp;form.itemfilter=FILESYSTEMS%20STATISTICS" class="tryitbtnxl">filesystems Data Dictionary »
                                    </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>
    </row>

    <!-- Base Searches for PostProcessing -->

    <search id="populate">
        <query>| mcatalog values(metric_name) where `nmon_metrics_index` metric_name=$metric_name$* $osfilter$ by host, dimension_mount
| `mapping_frameID`
| stats count by frameID, host, dimension_mount | sort 0 host</query>
        <earliest>$timerange.earliest$</earliest>
        <latest>$timerange.latest$</latest>
    </search>

    <row>
        <panel>

            <input type="dropdown" token="table_count">
                <label>Nb table lines:</label>
                <choice value="10">10</choice>
                <choice value="50">50</choice>
                <choice value="100">100</choice>
                <default>10</default>
            </input>

            <input type="dropdown" token="df_storage_monitor_unit" depends="$start_df_storage_search$">
                <label>Unit:</label>
                <choice value="MB">MB</choice>
                <choice value="GB">GB</choice>
                <choice value="TB">TB</choice>
                <default>GB</default>
                <change>
                    <condition value="MB">
                        <set token="df_storage_unit_math">/1024</set>
                        <set token="df_storage_unit_legend">MB</set>
                    </condition>
                    <condition value="GB">
                        <set token="df_storage_unit_math">/1024/1024</set>
                        <set token="df_storage_unit_legend">GB</set>
                    </condition>
                    <condition value="TB">
                        <set token="df_storage_unit_math">/1024/1024/1024</set>
                        <set token="df_storage_unit_legend">TB</set>
                    </condition>
                </change>
            </input>

            <input type="dropdown" token="df_storage_monitor_add_global_stats" depends="$start_df_storage_search$">
                <label>Append global stats:</label>
                <choice value="true">true</choice>
                <choice value="false">false</choice>
                <default>true</default>
                <change>
                    <condition value="true">
                        <set token="df_storage_monitor_add_global_stats_tk">where like(mount, &quot;%&quot;)</set>
                    </condition>
                    <condition value="false">
                        <set token="df_storage_monitor_add_global_stats_tk">where NOT like(mount, &quot;*** TOTAL GB / AVERAGE % ****&quot;)</set>
                    </condition>
                </change>
            </input>

            <table id="tablebar" depends="$start_df_storage_search$">
                <title>Latest known values within the period for the following file systems:</title>
                <search depends="$start_df_storage_search$">
                    <query>| mstats latest(_value) as value where `nmon_metrics_index` metric_name=os.unix.nmon.storage.df_storage.Available OR metric_name=os.unix.nmon.storage.df_storage.Use_pct OR metric_name=os.unix.nmon.storage.df_storage.Used OR metric_name=os.unix.nmon.storage.df_storage.blocks host=$host-prefilter$ $host_query$ $mount$ $fsfilter$ by host, metric_name, dimension_mount
| eval Available=case(metric_name=="os.unix.nmon.storage.df_storage.Available", value), Use_pct=case(metric_name=="os.unix.nmon.storage.df_storage.Use_pct", value), Used=case(metric_name=="os.unix.nmon.storage.df_storage.Used", value), blocks=case(metric_name=="os.unix.nmon.storage.df_storage.blocks", value)
| stats last(Available) as Available, last(Use_pct) as Use_pct, last(Used) as Used, last(blocks) as blocks by host, dimension_mount
| rename dimension_mount as mount
| eval storage_free=blocks-Used, storage_free_percent=(100-Use_pct)
| rename Use_pct as storage_used_percent, blocks as storage, Used as storage_used, Available as storage_free
| foreach storage, storage_free, storage_used [ eval &lt;&lt;FIELD&gt;&gt; = round('&lt;&lt;FIELD&gt;&gt;'$df_storage_unit_math$, 2) ]
| foreach storage*percent [ eval &lt;&lt;FIELD&gt;&gt; = round('&lt;&lt;FIELD&gt;&gt;', 2) ]
| rename storage as "storage ($df_storage_unit_legend$)", storage_free as "storage free ($df_storage_unit_legend$)", storage_used as "storage used ($df_storage_unit_legend$)", storage_free_percent as "storage free (%)", storage_used_percent as "storage used (%)"
| eval UsedPct=if(isnum('storage used (%)'), 'storage used (%)', 0 )
| fields host, mount, "storage ($df_storage_unit_legend$)", "storage free ($df_storage_unit_legend$)", "storage used ($df_storage_unit_legend$)", "storage free (%)", "storage used (%)", UsedPct
| appendpipe [ stats sum("storage ($df_storage_unit_legend$)") as "storage ($df_storage_unit_legend$)", sum("storage free ($df_storage_unit_legend$)") as "storage free ($df_storage_unit_legend$)", sum("storage used ($df_storage_unit_legend$)") as "storage used ($df_storage_unit_legend$)" ]
| eval "storage free (%)" = if(isnull('storage free (%)'), (('storage free ($df_storage_unit_legend$)'/'storage ($df_storage_unit_legend$)')*100), 'storage free (%)'), "storage used (%)" = if(isnull('storage used (%)'), (('storage used ($df_storage_unit_legend$)'/'storage ($df_storage_unit_legend$)')*100), 'storage used (%)'), UsedPct = if(isnull(UsedPct), 'storage used (%)', UsedPct)
| fillnull value="*** TOTAL $df_storage_unit_legend$ / AVERAGE % ****" mount
| foreach storage*%* UsedPct [ eval &lt;&lt;FIELD&gt;&gt; = round('&lt;&lt;FIELD&gt;&gt;', 2) ] | $df_storage_monitor_add_global_stats_tk$</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="wrap">true</option>
                <option name="rowNumbers">false</option>
                <option name="dataOverlayMode">none</option>
                <option name="drilldown">cell</option>
                <option name="count">$table_count$</option>
                <option name="refresh.display">none</option>
                <option name="percentagesRow">false</option>
                <format type="color" field="storage used (%)">
                    <colorPalette type="minMidMax" maxColor="#31A35F" minColor="#353535"></colorPalette>
                    <scale type="minMidMax"></scale>
                </format>
            </table>

            <table id="tablebar1" depends="$start_jfsfile_storage_search$">
                <title></title>
                <search depends="$start_jfsfile_storage_search$">
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` metric_name="os.unix.nmon.storage.jfsfile" host=$host-prefilter$ $host_query$ $mount$ $fsfilter$ by host, dimension_mount span=1m
| stats max(value) AS max_value, avg(value) AS avg_value, min(value) AS min_value, latest(value) AS UsedPct by host, dimension_mount
| sort limit=0 dimension_mount | rename dimension_mount AS "Mount point"
| eval value=round(value,2)
| fields host, "Mount point", max_value, avg_value, min_value, UsedPct | eval avg_value=round(avg_value,2)
| rename max_value AS "Max value in period (%)", avg_value AS "Average value in period (%)", min_value AS "Min value in Period (%)"</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="wrap">true</option>
                <option name="rowNumbers">false</option>
                <option name="dataOverlayMode">none</option>
                <option name="drilldown">cell</option>
                <option name="count">$table_count$</option>
                <option name="refresh.display">none</option>
                <option name="percentagesRow">false</option>
                <format type="color" field="max_value">
                    <colorPalette type="minMidMax" maxColor="#31A35F" minColor="#353535"></colorPalette>
                    <scale type="minMidMax"></scale>
                </format>
                <format type="color" field="avg_value">
                    <colorPalette type="minMidMax" maxColor="#31A35F" minColor="#353535"></colorPalette>
                    <scale type="minMidMax"></scale>
                </format>
                <format type="color" field="min_value">
                    <colorPalette type="minMidMax" maxColor="#31A35F" minColor="#353535"></colorPalette>
                    <scale type="minMidMax"></scale>
                </format>
            </table>

            <table id="tablebar2" depends="$start_df_inodes_search$">
                <title>Latest known values within the period for the following file systems:</title>
                <search depends="$start_df_inodes_search$">
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` metric_name=os.unix.nmon.storage.df_inodes.IFree OR metric_name=os.unix.nmon.storage.df_inodes.IUse_pct OR metric_name=os.unix.nmon.storage.df_inodes.IUsed OR metric_name=os.unix.nmon.storage.df_inodes.Inodes host=$host-prefilter$ $host_query$ $mount$ $fsfilter$ by host, metric_name, dimension_mount span=1m
| `extract_metrics("Inodes IFree IUse_pct IUsed IUse_pct")`
| stats values(Inodes) as Inodes values(IFree) as IFree, values(IUsed) as IUsed, values(IUse_pct) as IUse_pct by _time, host, dimension_mount
| fillnull value=0 IUse_pct
| stats latest(Inodes) as "storage_inodes (Inodes)" latest(IFree) as "storage_free_inodes (IFree)", latest(IUsed) as "storage_used_inodes (Used)", latest(IUse_pct) as "storage_used_inodes_percent (IUse_pct)" by host, dimension_mount
| eval UsedPct=if(isnum('storage_used_inodes_percent (IUse_pct)'), 'storage_used_inodes_percent (IUse_pct)', 0 )</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="wrap">true</option>
                <option name="rowNumbers">false</option>
                <option name="dataOverlayMode">none</option>
                <option name="drilldown">cell</option>
                <option name="count">$table_count$</option>
                <option name="refresh.display">none</option>
                <option name="percentagesRow">false</option>
                <format type="color" field="storage inodes used (%)">
                    <colorPalette type="minMidMax" maxColor="#31A35F" minColor="#353535"></colorPalette>
                    <scale type="minMidMax"></scale>
                </format>
            </table>

        </panel>
    </row>

    <row>
        <panel id="settings">
            <title>Charting parameters</title>
            <input type="dropdown" token="chart" searchWhenChanged="true">
                <label>Select a 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>gaps</default>
                <choice value="gaps">Gaps</choice>
                <choice value="connect">Connect</choice>
                <choice value="zero">Zero</choice>
            </input>
            <input type="dropdown" token="chart.stackingmode" searchWhenChanged="true">
                <label>Select a stacking mode:</label>
                <default>unstacked</default>
                <choice value="stacked">stacked (lines excluded)</choice>
                <choice value="stacked100">100% stacked (lines excluded)</choice>
                <choice value="unstacked">unstacked</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>
            <input type="dropdown" token="span" searchWhenChanged="true">
                <label>Span:</label>
                <default>`nmon_span`</default>
                <choice value="`nmon_span`">auto</choice>
                <choice value="span=1m">1 minute</choice>
                <choice value="span=2m">2 minutes</choice>
                <choice value="span=3m">3 minutes</choice>
                <choice value="span=4m">4 minutes</choice>
                <choice value="span=5m">5 minutes</choice>
                <choice value="span=10m">10 minutes</choice>
                <choice value="span=15m">15 minutes</choice>
                <choice value="span=30m">30 minutes</choice>
                <choice value="span=1h">1 hour</choice>
                <choice value="span=2h">2 hours</choice>
                <choice value="span=12h">12 hours</choice>
                <choice value="span=4h">4 hours</choice>
                <choice value="span=1d">1 day</choice>
                <choice value="span=2d">2 days</choice>
                <choice value="span=1w">7 days</choice>
                <choice value="span=1mon">1 month</choice>
            </input>
        </panel>
    </row>

    <row depends="$start_df_storage_search$">
        <panel>
            <title>File systems utilization evolution over time</title>

            <input type="dropdown" token="chart_df_storage_monitor">
                <label>Monitor:</label>
                <choice value="storage">storage (volume size)</choice>
                <choice value="storage_free">storage_free (volume free)</choice>
                <choice value="storage_used">storage_used (volume used)</choice>
                <choice value="storage_free_percent">storage_free_percent (%)</choice>
                <choice value="storage_used_percent">storage_used_percent (%)</choice>
                <default>storage_used_percent</default>
                <change>
                    <condition value="storage">
                        <set token="chart_df_storage_metric_name">metric_name=os.unix.nmon.storage.df_storage.blocks</set>
                        <unset token="form.chart_df_storage_monitor_unit"></unset>
                        <set token="chart_df_storage_show_unit">true</set>
                        <unset token="chart_df_storage_monitor_max_chart"></unset>
                    </condition>
                    <condition value="storage_free">
                        <set token="chart_df_storage_metric_name">metric_name=os.unix.nmon.storage.df_storage.Available</set>
                        <unset token="form.chart_df_storage_monitor_unit"></unset>
                        <set token="chart_df_storage_show_unit">true</set>
                        <unset token="chart_df_storage_monitor_max_chart"></unset>
                    </condition>
                    <condition value="storage_used">
                        <set token="chart_df_storage_metric_name">metric_name=os.unix.nmon.storage.df_storage.Used</set>
                        <unset token="form.chart_df_storage_monitor_unit"></unset>
                        <set token="chart_df_storage_show_unit">true</set>
                        <unset token="chart_df_storage_monitor_max_chart"></unset>
                    </condition>
                    <condition value="storage_free_percent">
                        <set token="chart_df_storage_metric_name">metric_name=os.unix.nmon.storage.df_storage.Use_pct</set>
                        <set token="chart_df_storage_unit">%</set>
                        <unset token="chart_df_storage_show_unit"></unset>
                        <set token="chart_df_storage_monitor_max_chart">101</set>
                        <set token="chart_df_storage_unit_legend">pct</set>
                    </condition>
                    <condition value="storage_used_percent">
                        <set token="chart_df_storage_metric_name">metric_name=os.unix.nmon.storage.df_storage.Use_pct</set>
                        <set token="form.chart_df_storage_monitor_unit">pct</set>
                        <set token="chart_df_storage_monitor_max_chart">101</set>
                        <unset token="chart_df_storage_show_unit"></unset>
                        <set token="chart_df_storage_unit_legend">pct</set>
                    </condition>
                </change>
            </input>

            <input type="dropdown" token="chart_df_storage_monitor_unit" depends="$chart_df_storage_show_unit$">
                <label>Unit:</label>
                <choice value="MB">MB</choice>
                <choice value="GB">GB</choice>
                <choice value="TB">TB</choice>
                <default>GB</default>
                <change>
                    <condition value="MB">
                        <set token="chart_df_storage_unit_math">value</set>
                        <set token="chart_df_storage_unit_legend">MB</set>
                    </condition>
                    <condition value="GB">
                        <set token="chart_df_storage_unit_math">value/1024</set>
                        <set token="chart_df_storage_unit_legend">GB</set>
                    </condition>
                    <condition value="TB">
                        <set token="chart_df_storage_unit_math">value/1024/1204</set>
                        <set token="chart_df_storage_unit_legend">TB</set>
                    </condition>
                    <condition value="pct">
                        <set token="chart_df_storage_unit_math">value</set>
                        <set token="chart_df_storage_unit_legend">pct</set>
                    </condition>
                </change>
            </input>

            <input type="multiselect" token="mount" searchWhenChanged="true">
                <label>mount Selection:</label>
                <!-- Populating Data Model Search -->
                <search base="populate">
                    <query>search $frameID$ $host$
    | stats count by dimension_mount | dedup dimension_mount | sort 0 dimension_mount</query>
                </search>
                <valuePrefix>dimension_mount="</valuePrefix>
                <valueSuffix>"</valueSuffix>
                <delimiter> OR </delimiter>
                <initialValue>*</initialValue>
                <choice value="*">ALL</choice>
                <fieldForLabel>dimension_mount</fieldForLabel>
                <fieldForValue>dimension_mount</fieldForValue>
            </input>

            <input type="text" token="fsfilter" searchWhenChanged="true">
                <label>Filter FileSystems by pattern:</label>
                <default>*</default>
                <prefix>dimension_mount="</prefix>
                <suffix>"</suffix>
            </input>

            <chart>
                <search depends="$start_df_storage_search$">
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` $chart_df_storage_metric_name$ host=$host-prefilter$ $host_query$ $mount$ $fsfilter$ by host, metric_name, dimension_mount span=1m
| eval Available=case(metric_name=="os.unix.nmon.storage.df_storage.Available", value), Use_pct=case(metric_name=="os.unix.nmon.storage.df_storage.Use_pct", value), Used=case(metric_name=="os.unix.nmon.storage.df_storage.Used", value), blocks=case(metric_name=="os.unix.nmon.storage.df_storage.blocks", value)
| eval storage_free=blocks-Used, storage_free_percent=(100-Use_pct)
| rename Use_pct as storage_used_percent, blocks as storage, Used as storage_used, Available as storage_free
| foreach storage, storage_free, storage_used [ eval &lt;&lt;FIELD&gt;&gt; = round('&lt;&lt;FIELD&gt;&gt;'/1024, 2) ]
| stats latest(storage*) as "storage*" by _time, dimension_mount, host
| eval value=$chart_df_storage_monitor$
| eval value=$chart_df_storage_unit_math$
| eval key = host . ":" . dimension_mount
| timechart $span$ latest(value) as $chart_df_storage_monitor$ by key</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisNone</option>
                <option name="charting.axisLabelsX.majorLabelStyle.rotation">0</option>
                <option name="charting.axisTitleX.visibility">collapsed</option>
                <option name="charting.axisTitleY.text">$chart_df_storage_unit_legend$</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">0</option>
                <option name="charting.axisY2.scale">inherit</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.nullValueMode">$charting.chart.nullValueMode$</option>
                <option name="charting.chart.showDataLabels">none</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">$chart.stackingmode$</option>
                <option name="charting.chart.style">shiny</option>
                <option name="charting.drilldown">none</option>
                <option name="charting.layout.splitSeries">0</option>
                <option name="charting.layout.splitSeries.allowIndependentYRanges">0</option>
                <option name="charting.legend.labelStyle.overflowMode">ellipsisMiddle</option>
                <option name="charting.legend.placement">bottom</option>
                <option name="height">500</option>
                <option name="charting.axisY.minimumNumber">0</option>
                <option name="charting.axisY.maximumNumber">$df_storage_monitor_max_chart$</option>
            </chart>
        </panel>

    </row>

    <row depends="$start_jfsfile_storage_search$">
        <panel>
            <title>File systems utilization evolution over time</title>

            <input type="multiselect" token="mount" searchWhenChanged="true">
                <label>mount Selection:</label>
                <!-- Populating Data Model Search -->
                <search base="populate">
                    <query>search $frameID$ $host$
    | stats count by dimension_mount | dedup dimension_mount | sort 0 dimension_mount</query>
                </search>
                <valuePrefix>dimension_mount="</valuePrefix>
                <valueSuffix>"</valueSuffix>
                <delimiter> OR </delimiter>
                <initialValue>*</initialValue>
                <choice value="*">ALL</choice>
                <fieldForLabel>dimension_mount</fieldForLabel>
                <fieldForValue>dimension_mount</fieldForValue>
            </input>

            <input type="text" token="fsfilter" searchWhenChanged="true">
                <label>Filter FileSystems by pattern:</label>
                <default>*</default>
                <prefix>dimension_mount="</prefix>
                <suffix>"</suffix>
            </input>

            <chart>
                <search depends="$start_jfsfile_storage_search$">
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` metric_name="os.unix.nmon.storage.jfsfile" host=$host-prefilter$ $host_query$ $mount$ $fsfilter$ by host, dimension_mount span=1m
| eval key = host . ":" . dimension_mount
| timechart $span$ limit=0 useother=f latest(value) As value by key</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisTitleX.visibility">visible</option>
                <option name="charting.axisTitleY.visibility">visible</option>
                <option name="charting.axisX.scale">linear</option>
                <option name="charting.axisY.scale">linear</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.nullValueMode">connect</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">$chart.stackingmode$</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="height">500</option>
                <option name="charting.axisTitleX.text">Time</option>
                <option name="charting.axisTitleY.text">% Used</option>
                <option name="charting.axisY.minimumNumber">0</option>
                <option name="charting.axisY.maximumNumber">100</option>
                <option name="refresh.display">none</option>
            </chart>
        </panel>
    </row>

    <row depends="$start_df_inodes_search$">
        <panel>
            <title>File systems utilization evolution over time</title>

            <input type="multiselect" token="mount" searchWhenChanged="true">
                <label>mount Selection:</label>
                <!-- Populating Data Model Search -->
                <search base="populate">
                    <query>search $frameID$ $host$
    | stats count by dimension_mount | dedup dimension_mount | sort 0 dimension_mount</query>
                </search>
                <valuePrefix>dimension_mount="</valuePrefix>
                <valueSuffix>"</valueSuffix>
                <delimiter> OR </delimiter>
                <initialValue>*</initialValue>
                <choice value="*">ALL</choice>
                <fieldForLabel>dimension_mount</fieldForLabel>
                <fieldForValue>dimension_mount</fieldForValue>
            </input>

            <input type="text" token="fsfilter" searchWhenChanged="true">
                <label>Filter FileSystems by pattern:</label>
                <default>*</default>
                <prefix>dimension_mount="</prefix>
                <suffix>"</suffix>
            </input>

            <chart>
                <search depends="$start_df_inodes_search$">
                    <query>| mstats avg(_value) as value where `nmon_metrics_index` metric_name="os.unix.nmon.storage.df_inodes.IUse_pct" host=$host-prefilter$ $host_query$ $mount$ $fsfilter$ by host, dimension_mount span=1m
| eval key = host . ":" . dimension_mount
| timechart $span$ limit=0 useother=f latest(value) As value by key</query>
                    <earliest>$timerange.earliest$</earliest>
                    <latest>$timerange.latest$</latest>
                    <refresh>$refresh$</refresh>
                    <refreshType>delay</refreshType>
                </search>
                <option name="charting.axisTitleX.visibility">visible</option>
                <option name="charting.axisTitleY.visibility">visible</option>
                <option name="charting.axisX.scale">linear</option>
                <option name="charting.axisY.scale">linear</option>
                <option name="charting.chart">$chart$</option>
                <option name="charting.chart.nullValueMode">connect</option>
                <option name="charting.chart.sliceCollapsingThreshold">0.01</option>
                <option name="charting.chart.stackMode">$chart.stackingmode$</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="height">500</option>
                <option name="charting.axisTitleX.text">Time</option>
                <option name="charting.axisTitleY.text">% Used</option>
                <option name="charting.axisY.minimumNumber">0</option>
                <option name="charting.axisY.maximumNumber">100</option>
                <option name="refresh.display">none</option>
            </chart>

        </panel>
    </row>

</form>
