-
Notifications
You must be signed in to change notification settings - Fork 0
/
json
580 lines (580 loc) · 25.9 KB
/
json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
{
"__inputs": [
{
"name": null,
"label": null,
"description": "",
"type": "datasource",
"pluginId": "postgres",
"pluginName": "PostgreSQL"
}
],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "6.7.4"
},
{
"type": "datasource",
"id": "postgres",
"name": "PostgreSQL",
"version": "1.0.0"
},
{
"type": "panel",
"id": "table",
"name": "Table",
"version": ""
},
{
"type": "panel",
"id": "text",
"name": "Text",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"description": "The vms inventory dashboard displays an inventory list of all vms of the selected data center and cluster.",
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": null,
"iteration": 1613382996014,
"links": [],
"panels": [
{
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 21,
"title": "Description",
"type": "row"
},
{
"content": "\n###### This dashboard displays an inventory list of all virtual machines in the selected cluster.\n\n\n",
"datasource": null,
"gridPos": {
"h": 2,
"w": 24,
"x": 0,
"y": 1
},
"id": 19,
"links": [],
"mode": "markdown",
"targets": [
{
"format": "time_series",
"group": [],
"metricColumn": "none",
"rawQuery": false,
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"timeColumn": "time",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "",
"transparent": true,
"type": "text"
},
{
"datasource": null,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 3
},
"id": 17,
"title": "Virtual Machines Inventory",
"type": "row"
},
{
"columns": [],
"datasource": null,
"description": "This report displays a inventory list of all virtual machines of the selected data center and cluster.",
"fontSize": "100%",
"gridPos": {
"h": 17,
"w": 24,
"x": 0,
"y": 4
},
"id": 15,
"links": [],
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": 0,
"desc": true
},
"styles": [
{
"alias": "VM Name",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "vm_name",
"thresholds": [],
"type": "string",
"unit": "short"
},
{
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "cluster_id",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"alias": "Cluster Name",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "cluster_name",
"thresholds": [],
"type": "string",
"unit": "short"
},
{
"alias": "Cluster Delete Date",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "cluster_delete",
"thresholds": [],
"type": "hidden",
"unit": "short"
},
{
"alias": "Template Name",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "template_name",
"thresholds": [],
"type": "string",
"unit": "short",
"valueMaps": [
{
"text": "",
"value": "Blank"
}
]
},
{
"alias": "Create Date",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "create_date",
"thresholds": [],
"type": "date",
"unit": "short"
},
{
"alias": "Delete Date",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "delete_date",
"thresholds": [],
"type": "date",
"unit": "short"
},
{
"alias": "OS Version",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "os_version",
"thresholds": [],
"type": "string",
"unit": "short"
},
{
"alias": "Memory Size",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "vm_memsize",
"thresholds": [],
"type": "number",
"unit": "decgbytes"
},
{
"alias": "CPU Cores",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 0,
"mappingType": 1,
"pattern": "vm_cpucores",
"thresholds": [],
"type": "number",
"unit": "none"
},
{
"alias": "IP",
"align": "",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "vm_ip",
"preserveFormat": false,
"sanitize": false,
"thresholds": [],
"type": "string",
"unit": "short"
},
{
"alias": "Disks Size",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "vm_disk_size_mb",
"thresholds": [],
"type": "number",
"unit": "short"
},
{
"alias": "Used Disks Size",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "vm_disk_actual_size_mb",
"thresholds": [],
"type": "number",
"unit": "decgbytes"
},
{
"alias": "Interfaces",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"decimals": 2,
"mappingType": 1,
"pattern": "vm_interface_names",
"thresholds": [],
"type": "string",
"unit": "short"
}
],
"targets": [
{
"format": "table",
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "-- BR9 - This query will return for the specific data center,\n-- the latest VMs configurations, grouped by clusters.\n\nSELECT\n v4_4_configuration_history_vms.vm_name,\n v4_4_configuration_history_vms.cluster_id,\n v4_4_configuration_history_clusters.cluster_name,\n v4_4_configuration_history_vms.template_name,\n a.value AS os_version,\n v4_4_statistics_vms_resources_usage_samples.vm_ip,\n STRING_AGG (vm_interface_name, ', ') AS vm_interface_names,\n ROUND ( COALESCE ( cpu_per_socket, 0 ) * COALESCE ( number_of_sockets, 0 ), 0 ) AS vm_cpucores,\n ROUND ( CAST ( COALESCE ( memory_size_mb, 0.00 ) AS float ) :: numeric / 1024, 1 ) AS vm_memsize,\n SUM (CAST ( COALESCE ( vm_disk_size_mb, 0.00 ) AS float ) :: numeric / 1024) AS vm_disk_size_mb,\n SUM (CAST ( COALESCE ( vm_disk_actual_size_mb, 0.00 ) AS float ) :: numeric / 1024) AS vm_disk_actual_size_mb,\n \n v4_4_configuration_history_clusters.delete_date AS cluster_delete,\n CAST ( v4_4_configuration_history_vms.create_date AS date ) AS create_date,\n CAST ( v4_4_configuration_history_vms.delete_date AS date ) AS delete_date\nFROM \n v4_4_configuration_history_vms\n LEFT OUTER JOIN\n v4_4_statistics_vms_resources_usage_samples\n ON\n (\n v4_4_configuration_history_vms.vm_id =\n v4_4_statistics_vms_resources_usage_samples.vm_id\n AND v4_4_statistics_vms_resources_usage_samples.history_id\n IN\n (\n SELECT MAX (history_id)\n FROM v4_4_statistics_vms_resources_usage_samples\n GROUP BY vm_id\n )\n )\n LEFT OUTER JOIN v4_4_latest_configuration_vms_devices\n ON\n (\n v4_4_latest_configuration_vms_devices.vm_id =\n v4_4_configuration_history_vms.vm_id\n AND v4_4_latest_configuration_vms_devices.history_id \n IN \n ( \n SELECT MAX (history_id) \n FROM v4_4_latest_configuration_vms_devices \n GROUP BY device_id\n )\n )\n LEFT OUTER JOIN v4_4_latest_configuration_vms_disks\n ON\n (\n v4_4_latest_configuration_vms_disks.vm_disk_id =\n v4_4_latest_configuration_vms_devices.device_id\n )\n LEFT OUTER JOIN v4_4_statistics_vms_disks_resources_usage_samples\n ON\n (\n v4_4_statistics_vms_disks_resources_usage_samples.vm_disk_id =\n v4_4_latest_configuration_vms_disks.vm_disk_id\n AND v4_4_statistics_vms_disks_resources_usage_samples.history_id\n IN\n (\n SELECT MAX (history_id)\n FROM v4_4_statistics_vms_disks_resources_usage_samples\n GROUP BY vm_disk_id\n )\n )\n LEFT OUTER JOIN\n v4_4_latest_configuration_vms_interfaces\n ON\n (\n v4_4_latest_configuration_vms_devices.device_id =\n v4_4_latest_configuration_vms_interfaces.vm_interface_id\n )\n LEFT OUTER JOIN \n (\n SELECT enum_type, enum_key, value\n FROM enum_translator\n WHERE language_code = 'en_US' AND enum_type = 'OS_TYPE'\n )AS a\n ON \n (\n v4_4_configuration_history_vms.operating_system =\n a.enum_key AND a.enum_type = 'OS_TYPE'\n )\n LEFT OUTER JOIN v4_4_configuration_history_clusters\n ON \n (\n v4_4_configuration_history_vms.cluster_id =\n v4_4_configuration_history_clusters.cluster_id\n AND v4_4_configuration_history_clusters.history_id \n IN \n (\n SELECT MAX ( a.history_id )\n FROM v4_4_configuration_history_clusters a\n GROUP BY a.cluster_id\n )\n )\nWHERE\n -- Here we filter by the datacenter chosen by the user\n v4_4_configuration_history_vms.cluster_id \n IN \n (\n SELECT cluster_id\n FROM v4_4_configuration_history_clusters\n WHERE datacenter_id IN ($datacenter_id)\n )\n -- Here we filter by the virtual machine/s chosen by the user\n AND v4_4_configuration_history_vms.vm_id IN ($vm_id)\n -- Here we get the latest vm configurations\n AND v4_4_configuration_history_vms.history_id \n IN \n (\n SELECT MAX ( a.history_id )\n FROM v4_4_configuration_history_vms a\n GROUP BY a.vm_id\n )\n -- Here we get or remove deleted entities according to what the user chose\n -- in the \"show_deleted\" parameter.\n AND\n CASE\n WHEN '$show_deleted'='Yes'\n THEN 1=1\n WHEN '$show_deleted'='No'\n THEN v4_4_configuration_history_vms.delete_date isnull\n END\nGROUP BY \n vm_name,\n v4_4_configuration_history_vms.cluster_id,\n cluster_name,\n template_name,\n value,\n vm_ip,\n cpu_per_socket,\n number_of_sockets,\n memory_size_mb,\n v4_4_configuration_history_clusters.delete_date,\n v4_4_configuration_history_vms.create_date, \n v4_4_configuration_history_vms.delete_date\nORDER BY\n v4_4_configuration_history_vms.cluster_id,\n v4_4_configuration_history_vms.delete_date DESC",
"refId": "A",
"select": [
[
{
"params": [
"value"
],
"type": "column"
}
]
],
"timeColumn": "time",
"where": [
{
"name": "$__timeFilter",
"params": [],
"type": "macro"
}
]
}
],
"timeFrom": null,
"timeShift": null,
"title": "Virtual Machines Inventory (BR9)",
"transform": "table",
"type": "table"
}
],
"refresh": false,
"schemaVersion": 22,
"style": "dark",
"tags": [
"VM",
"Cluster",
"CPU",
"Memory",
"OS"
],
"templating": {
"list": [
{
"allValue": null,
"current": {
"selected": true,
"tags": [],
"text": "No",
"value": "No"
},
"hide": 0,
"includeAll": false,
"label": "Show Deleted Entities?",
"multi": false,
"name": "show_deleted",
"options": [
{
"selected": true,
"text": "No",
"value": "No"
},
{
"selected": false,
"text": "Yes",
"value": "Yes"
}
],
"query": "No,Yes",
"skipUrlSync": false,
"type": "custom"
},
{
"allValue": null,
"current": {},
"datasource": null,
"definition": "SELECT DISTINCT CAST ( datacenter_id AS varchar ) AS __value, CASE WHEN delete_date IS NULL \t \t THEN datacenter_name \t \tWHEN delete_date IS NOT null \t \t THEN datacenter_name || ' (Removed on ' || CAST ( CAST ( delete_date AS date ) AS varchar ) || ')' \t\tEND AS __text \t\tFROM v4_4_configuration_history_datacenters \t\tWHERE \t\t history_id \t\t\t IN \t\t\t\t( \t \t\t\t\t\tSELECT MAX ( a.history_id ) \t\t \t\t\t\t\tFROM v4_4_configuration_history_datacenters a \t\t \t\t\t\t\tGROUP BY a.datacenter_id \t \t\t\t\t) \t \t\t\tAND datacenter_id \t \t\t\t IN \t\t\t \t\t\t\t ( \t\t\t\t\t \t\t\t\t\t\tSELECT DISTINCT datacenter_id \t\t\t\t\t \t\t\t\t\t\tFROM v4_4_configuration_history_clusters \t\t\t\t\t \t\t\t\t\t\tWHERE \t\t\t\t\t \t\t\t\t\t\t cluster_id \t\t\t\t\t \t\t\t\t\t\t IN \t\t\t\t\t \t\t\t\t\t\t ( \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\tSELECT DISTINCT cluster_id \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\tFROM v4_4_configuration_history_vms \t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t) \t\t\t\t \t\t\t\t\t) \t \t\t\tAND \t \t\t\t CASE \t \t\t\t\t WHEN '$show_deleted'='Yes' \t \t\t\t\t\t THEN 1=1 \t\t \t\t\t\t\tWHEN '$show_deleted'='No' \t\t \t\t\t\t\t THEN v4_4_configuration_history_datacenters.delete_date ISNULL \t END \t\t",
"hide": 0,
"includeAll": true,
"index": -1,
"label": "Data Center",
"multi": true,
"name": "datacenter_id",
"options": [],
"query": "SELECT DISTINCT CAST ( datacenter_id AS varchar ) AS __value, CASE WHEN delete_date IS NULL \t \t THEN datacenter_name \t \tWHEN delete_date IS NOT null \t \t THEN datacenter_name || ' (Removed on ' || CAST ( CAST ( delete_date AS date ) AS varchar ) || ')' \t\tEND AS __text \t\tFROM v4_4_configuration_history_datacenters \t\tWHERE \t\t history_id \t\t\t IN \t\t\t\t( \t \t\t\t\t\tSELECT MAX ( a.history_id ) \t\t \t\t\t\t\tFROM v4_4_configuration_history_datacenters a \t\t \t\t\t\t\tGROUP BY a.datacenter_id \t \t\t\t\t) \t \t\t\tAND datacenter_id \t \t\t\t IN \t\t\t \t\t\t\t ( \t\t\t\t\t \t\t\t\t\t\tSELECT DISTINCT datacenter_id \t\t\t\t\t \t\t\t\t\t\tFROM v4_4_configuration_history_clusters \t\t\t\t\t \t\t\t\t\t\tWHERE \t\t\t\t\t \t\t\t\t\t\t cluster_id \t\t\t\t\t \t\t\t\t\t\t IN \t\t\t\t\t \t\t\t\t\t\t ( \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\tSELECT DISTINCT cluster_id \t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\tFROM v4_4_configuration_history_vms \t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t) \t\t\t\t \t\t\t\t\t) \t \t\t\tAND \t \t\t\t CASE \t \t\t\t\t WHEN '$show_deleted'='Yes' \t \t\t\t\t\t THEN 1=1 \t\t \t\t\t\t\tWHEN '$show_deleted'='No' \t\t \t\t\t\t\t THEN v4_4_configuration_history_datacenters.delete_date ISNULL \t END \t\t",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": "",
"current": {},
"datasource": null,
"definition": "SELECT DISTINCT CAST ( cluster_id AS varchar ) AS __value, \tCASE \t WHEN delete_date IS NULL \t \t\t THEN cluster_name \t \t\tWHEN delete_date IS NOT null \t \t\t THEN cluster_name || ' (Removed on ' || CAST ( CAST ( delete_date AS date ) AS varchar ) || ')' \tEND AS __text \tFROM v4_4_configuration_history_clusters \tWHERE \t history_id \t\t IN \t\t\t ( \t \t\t\t\t\tSELECT MAX ( a.history_id ) \t\t \t\t\t\t\tFROM v4_4_configuration_history_clusters a \t\t \t\t\t\t\tGROUP BY a.cluster_id \t \t\t\t\t) \t \t\tAND cluster_id \t \t\t IN \t\t\t \t\t\t ( \t\t\t\t\t \t\t\t\t\tSELECT DISTINCT cluster_id \t\t\t\t\t \t\t\t\t\tFROM v4_4_configuration_history_vms \t\t\t\t \t\t\t\t) \t \t\tAND \t \t\t CASE \t \t\t\t WHEN '$show_deleted'='Yes' \t \t\t\t\t THEN 1=1 \t\t \t\t\t\tWHEN '$show_deleted'='No' \t\t \t\t\t\t THEN v4_4_configuration_history_clusters.delete_date ISNULL \t \t\t\tEND \t\tAND datacenter_id IN ($datacenter_id) \t\t",
"hide": 0,
"includeAll": true,
"index": -1,
"label": "Cluster",
"multi": true,
"name": "cluster_id",
"options": [],
"query": "SELECT DISTINCT CAST ( cluster_id AS varchar ) AS __value, \tCASE \t WHEN delete_date IS NULL \t \t\t THEN cluster_name \t \t\tWHEN delete_date IS NOT null \t \t\t THEN cluster_name || ' (Removed on ' || CAST ( CAST ( delete_date AS date ) AS varchar ) || ')' \tEND AS __text \tFROM v4_4_configuration_history_clusters \tWHERE \t history_id \t\t IN \t\t\t ( \t \t\t\t\t\tSELECT MAX ( a.history_id ) \t\t \t\t\t\t\tFROM v4_4_configuration_history_clusters a \t\t \t\t\t\t\tGROUP BY a.cluster_id \t \t\t\t\t) \t \t\tAND cluster_id \t \t\t IN \t\t\t \t\t\t ( \t\t\t\t\t \t\t\t\t\tSELECT DISTINCT cluster_id \t\t\t\t\t \t\t\t\t\tFROM v4_4_configuration_history_vms \t\t\t\t \t\t\t\t) \t \t\tAND \t \t\t CASE \t \t\t\t WHEN '$show_deleted'='Yes' \t \t\t\t\t THEN 1=1 \t\t \t\t\t\tWHEN '$show_deleted'='No' \t\t \t\t\t\t THEN v4_4_configuration_history_clusters.delete_date ISNULL \t \t\t\tEND \t\tAND datacenter_id IN ($datacenter_id) \t\t",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"allValue": null,
"current": {},
"datasource": null,
"definition": "SELECT DISTINCT CAST ( vm_id AS varchar ) AS __value, \tCASE \t WHEN delete_date IS NULL \t \t\t THEN vm_name \t \t\tWHEN delete_date IS NOT null \t \t\t THEN vm_name || ' (Removed on ' || CAST ( CAST ( delete_date AS date ) AS varchar ) || ')' \tEND AS __text \tFROM v4_4_configuration_history_vms \tWHERE \t history_id \t\t IN \t\t\t ( \t \t\t\t\t\tSELECT MAX ( a.history_id ) \t\t \t\t\t\t\tFROM v4_4_configuration_history_vms a \t\t \t\t\t\t\tGROUP BY a.vm_id \t \t\t\t\t) \t \t\tAND \t \t\t CASE \t \t\t\t WHEN '$show_deleted'='Yes' \t \t\t\t\t THEN 1=1 \t\t \t\t\t\tWHEN '$show_deleted'='No' \t\t \t\t\t\t THEN v4_4_configuration_history_vms.delete_date ISNULL \t \t\t\tEND \t\tAND cluster_id IN ($cluster_id) \t\t",
"hide": 0,
"includeAll": true,
"index": -1,
"label": "Virtual Machine",
"multi": true,
"name": "vm_id",
"options": [],
"query": "SELECT DISTINCT CAST ( vm_id AS varchar ) AS __value, \tCASE \t WHEN delete_date IS NULL \t \t\t THEN vm_name \t \t\tWHEN delete_date IS NOT null \t \t\t THEN vm_name || ' (Removed on ' || CAST ( CAST ( delete_date AS date ) AS varchar ) || ')' \tEND AS __text \tFROM v4_4_configuration_history_vms \tWHERE \t history_id \t\t IN \t\t\t ( \t \t\t\t\t\tSELECT MAX ( a.history_id ) \t\t \t\t\t\t\tFROM v4_4_configuration_history_vms a \t\t \t\t\t\t\tGROUP BY a.vm_id \t \t\t\t\t) \t \t\tAND \t \t\t CASE \t \t\t\t WHEN '$show_deleted'='Yes' \t \t\t\t\t THEN 1=1 \t\t \t\t\t\tWHEN '$show_deleted'='No' \t\t \t\t\t\t THEN v4_4_configuration_history_vms.delete_date ISNULL \t \t\t\tEND \t\tAND cluster_id IN ($cluster_id) \t\t",
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 1,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-30d",
"to": "now"
},
"timepicker": {
"hidden": true,
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "",
"title": "Virtual Machines Inventory Dashboard",
"uid": "VirtualMachinesInventoryDashboard",
"variables": {
"list": []
},
"version": 1
}