Reply

Port Capacity Delta by Device Report

[ Edited ]
Adviser
Posts: 267
1206     0
<form>
<label>Port Capacity Delta by Device</label>
<description>System-created dashboard: Please clone before editing.</description>
<fieldset submitButton="true" autoRun="true">
<input type="time" token="time">
<label>Start Time</label>
<default>
<earliest>-1w@d</earliest>
<latest>-1w@d+1d</latest>
</default>
</input>
<input type="time" token="end_time">
<label>End Time</label>
<default>
<earliest>-1d@d</earliest>
<latest>-1d@d+1d</latest>
</default>
</input> 
<input type="dropdown" token="network_view">
<label>Network View</label>
<choice value="All">All</choice>
<search>
<query>source=ib:discovery:port_capacity index=ib_discovery
| stats count by NETWORK_VIEW</query>
<earliest>$time.earliest$</earliest>
<latest>$time.latest$</latest>
</search>
<fieldForLabel>NETWORK_VIEW</fieldForLabel>
<fieldForValue>NETWORK_VIEW</fieldForValue>
<change>
<condition value="All">
<set token="network_view_str"> </set>
</condition>
<condition value="*">
<set token="network_view_str">NETWORK_VIEW="$value$"</set>
</condition>
</change>
<default>All</default>
</input>
<input type="text" token="device_name">
<label>Device Name (eg: *foo*)</label>
<default>All</default>
<change>
<condition value="All">
<set token="device_name_str"> </set>
</condition>
<condition value="*">
<set token="device_name_str">DEVICE_NAME="$value$"</set>
</condition>
</change>
</input>
</fieldset>
<row>
<panel>
<table>
<search>
<query>source=ib:discovery:port_capacity index=ib_discovery
$network_view_str$
$device_name_str$
| stats avg(TOTAL_AVAIL_COUNT) as AVG_TOTAL_AVAIL_COUNT avg(ADM_UP_OP_UP_COUNT) as AVG_ADM_UP_OP_UP_COUNT avg(ADM_UP_OP_DN_COUNT) as AVG_ADM_UP_OP_DN_COUNT by NETWORK_VIEW DEVICE_NAME
| eval DAILY_TOTAL_AVAIL_COUNT = round(AVG_TOTAL_AVAIL_COUNT)
| eval DAILY_ADM_UP_OP_UP_COUNT = round(AVG_ADM_UP_OP_UP_COUNT)
| eval DAILY_ADM_UP_OP_DN_COUNT = round(AVG_ADM_UP_OP_DN_COUNT)
| eval "Admin-Down/Operation-Down Start" = DAILY_TOTAL_AVAIL_COUNT - DAILY_ADM_UP_OP_UP_COUNT - DAILY_ADM_UP_OP_DN_COUNT
| rename DAILY_TOTAL_AVAIL_COUNT as "Total Available" DAILY_ADM_UP_OP_UP_COUNT as "Admin-Up/Operation-Up Start" DAILY_ADM_UP_OP_DN_COUNT as "Admin-Up/Operation-Down Start"
| append [ search source=ib:discovery:port_capacity index=ib_discovery
$end_time.earliest$
$end_time.latest$
$network_view_str$
$device_name_str$ 
| stats avg(TOTAL_AVAIL_COUNT) as AVG_TOTAL_AVAIL_COUNT avg(ADM_UP_OP_UP_COUNT) as AVG_ADM_UP_OP_UP_COUNT avg(ADM_UP_OP_DN_COUNT) as AVG_ADM_UP_OP_DN_COUNT by NETWORK_VIEW DEVICE_NAME
| eval DAILY_TOTAL_AVAIL_COUNT = round(AVG_TOTAL_AVAIL_COUNT)
| eval DAILY_ADM_UP_OP_UP_COUNT = round(AVG_ADM_UP_OP_UP_COUNT)
| eval DAILY_ADM_UP_OP_DN_COUNT = round(AVG_ADM_UP_OP_DN_COUNT)
| eval "Admin-Down/Operation-Down End" = DAILY_TOTAL_AVAIL_COUNT - DAILY_ADM_UP_OP_UP_COUNT - DAILY_ADM_UP_OP_DN_COUNT
| rename DAILY_TOTAL_AVAIL_COUNT as "Total Available" DAILY_ADM_UP_OP_UP_COUNT as "Admin-Up/Operation-Up End" DAILY_ADM_UP_OP_DN_COUNT as "Admin-Up/Operation-Down End" ]
| selfjoin keepsingle=true NETWORK_VIEW DEVICE_NAME
| rename DEVICE_NAME as "Device Name" NETWORK_VIEW as "Network View" 
| table "Device Name" "Admin-Up/Operation-Up Start" "Admin-Up/Operation-Up End" "Admin-Down/Operation-Down Start" "Admin-Down/Operation-Down End" "Admin-Up/Operation-Down Start" "Admin-Up/Operation-Down End" "Total Available" "Network View"
| sort +str("Device Name") +str("Network View")</query>
<earliest>$time.earliest$</earliest>
<latest>$time.latest$</latest>
</search>
<option name="wrap">true</option>
<option name="rowNumbers">true</option>
<option name="dataOverlayMode">none</option>
<option name="drilldown">none</option>
<option name="count">10</option>
</table>
</panel>
</row>
</form>
If you appreciate my efforts, please give me a kudo ↓ or Accept as solution to help others find it faster.
Showing results for 
Search instead for 
Do you mean 

Recommended for You