Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
258 changes: 258 additions & 0 deletions Workbooks/Virtual Machines/Availability/server availability.workbook
Original file line number Diff line number Diff line change
@@ -0,0 +1,258 @@
{
"version": "Notebook/1.0",
"items": [
{
"type": 1,
"content": {
"json": "# Server Availability\r\n\r\n\r\n<hr>"
},
"name": "text - 2"
},
{
"type": 9,
"content": {
"version": "KqlParameterItem/1.0",
"crossComponentResources": [
"{Subscription}"
],
"parameters": [
{
"id": "ff24505c-2099-43a4-a8a3-3456bed78eb5",
"version": "KqlParameterItem/1.0",
"name": "TimeRange",
"type": 4,
"isRequired": true,
"value": {
"durationMs": 604800000
},
"typeSettings": {
"selectableValues": [
{
"durationMs": 3600000
},
{
"durationMs": 14400000
},
{
"durationMs": 43200000
},
{
"durationMs": 86400000
},
{
"durationMs": 172800000
},
{
"durationMs": 259200000
},
{
"durationMs": 604800000
},
{
"durationMs": 1209600000
},
{
"durationMs": 2419200000
},
{
"durationMs": 2592000000
},
{
"durationMs": 5184000000
},
{
"durationMs": 7776000000
}
]
}
},
{
"id": "bfe50469-7469-4c4d-a33e-0edbb43546c4",
"version": "KqlParameterItem/1.0",
"name": "Subscription",
"type": 6,
"isRequired": true,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"value": [
"/subscriptions/64f9887b-aa93-4bc9-a8d7-56033998b7b1"
],
"typeSettings": {
"additionalResourceOptions": [
"value::all"
],
"includeAll": true
}
},
{
"id": "fb861784-4609-49f2-9f58-427fcc547677",
"version": "KqlParameterItem/1.0",
"name": "Workspace",
"type": 5,
"isRequired": true,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "where type =~ 'microsoft.operationalinsights/workspaces'\r\n| order by name asc\r\n| summarize Selected = makelist(id, 10), All = makelist(id, 1000)\r\n| mvexpand All limit 200\r\n| project value = tostring(All), label = tostring(All), selected = iff(Selected contains All, true, false)",
"crossComponentResources": [
"{Subscription}"
],
"typeSettings": {
"resourceTypeFilter": {
"microsoft.operationalinsights/workspaces": true
},
"additionalResourceOptions": [
"value::all"
]
},
"timeContext": {
"durationMs": 0
},
"timeContextFromParameter": "TimeRange",
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources"
},
{
"id": "b2627475-cef7-4e91-97b9-b70bf00164e6",
"version": "KqlParameterItem/1.0",
"name": "Servers",
"type": 2,
"isRequired": true,
"multiSelect": true,
"quote": "'",
"delimiter": ",",
"query": "Heartbeat\r\n| distinct Computer\r\n| order by Computer asc",
"crossComponentResources": [
"{Workspace}"
],
"value": [
"adVM.Cloudwise.co.za",
"ULabDC.ulab.local"
],
"typeSettings": {
"additionalResourceOptions": [
"value::all"
]
},
"timeContext": {
"durationMs": 0
},
"timeContextFromParameter": "TimeRange",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces"
}
],
"style": "pills",
"queryType": 1,
"resourceType": "microsoft.resourcegraph/resources"
},
"name": "parameters - 1"
},
{
"type": 1,
"content": {
"json": "### This Workbook calculates availability of VM's based on the specified time period."
},
"name": "text - 3"
},
{
"type": 3,
"content": {
"version": "KqlItem/1.0",
"query": "let timeRangeStart = {TimeRange:start};\r\nlet timeRangeEnd = {TimeRange:end};\r\nHeartbeat\r\n| where TimeGenerated > timeRangeStart and TimeGenerated < timeRangeEnd and Computer in ({Servers})\r\n| summarize heartbeat_per_hour=count() by bin_at(TimeGenerated, 1h, timeRangeStart), Computer\r\n| extend available_per_hour=iff(heartbeat_per_hour>0, true, false)\r\n| summarize total_available_hours=countif(available_per_hour==true) by Computer \r\n| extend total_number_of_buckets=round((timeRangeEnd-timeRangeStart)/1h)\r\n| extend availability_rate=total_available_hours*100/total_number_of_buckets\r\n| order by availability_rate asc",
"size": 0,
"timeContext": {
"durationMs": 0
},
"timeContextFromParameter": "TimeRange",
"exportToExcelOptions": "visible",
"queryType": 0,
"resourceType": "microsoft.operationalinsights/workspaces",
"crossComponentResources": [
"{Workspace}"
],
"gridSettings": {
"formatters": [
{
"columnMatch": "Computer",
"formatter": 0,
"formatOptions": {
"showIcon": true
}
},
{
"columnMatch": "total_available_hours",
"formatter": 0,
"formatOptions": {
"showIcon": true
}
},
{
"columnMatch": "total_number_of_buckets",
"formatter": 0,
"formatOptions": {
"showIcon": true
}
},
{
"columnMatch": "availability_rate",
"formatter": 3,
"formatOptions": {
"min": 0,
"max": 100,
"palette": "redGreen",
"showIcon": true
},
"numberFormat": {
"unit": 1,
"options": {
"style": "decimal"
}
}
},
{
"columnMatch": "number_of_buckets",
"formatter": 0,
"formatOptions": {
"showIcon": true
}
}
],
"sortBy": [
{
"itemKey": "$gen_bar_availability_rate_3",
"sortOrder": 1
}
],
"labelSettings": [
{
"columnId": "Computer"
},
{
"columnId": "total_available_hours",
"label": "Total Available Hours"
},
{
"columnId": "total_number_of_buckets",
"label": "Total Hours"
},
{
"columnId": "availability_rate",
"label": "Availability %"
}
]
},
"sortBy": [
{
"itemKey": "$gen_bar_availability_rate_3",
"sortOrder": 1
}
]
},
"name": "query - 0"
}
],
"styleSettings": {},
"$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"
}
8 changes: 8 additions & 0 deletions Workbooks/Virtual Machines/Availability/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/settings.json",
"name":"Availability",
"author": "Microsoft",
"galleries": [
{ "type": "workbook", "resourceType": "Azure Monitor", "categoryKey": "azureMonitorVirtualMachines", "order": 300 }
]
}