-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigMgr_AlertRules.json
More file actions
1582 lines (1582 loc) · 127 KB
/
ConfigMgr_AlertRules.json
File metadata and controls
1582 lines (1582 loc) · 127 KB
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
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"LogAnalyticsWorkspace": {
"defaultValue": "",
"type": "String"
},
"ConfigMgrResourceGroupName": {
"defaultValue": "",
"type": "String"
},
"CMGResourceGroupName": {
"defaultValue": "",
"type": "String"
},
"Location": {
"defaultValue": "",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG - High Request Processing Time",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG - High Request Processing Time",
"description": "The request processing time for the CMG node is over threshold (CMGService.log).",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG Service Health\nConfigMgr_Logs_CL\n| extend Computer=tostring(split(_ResourceId, \"/\")[8])\n| extend FileName=tostring(split(FilePath, \"\\\\\")[-1])\n| where FileName contains \"CMGService.log\"\n| where RawData contains \"Summary - \"\n| project TimeGenerated, Computer, FileName, RawData, FilePath\n| parse RawData with * \"TotalRequestCount: \" TotalRequestCount: int \" TotalRequestSize: \" TotalRequestSizeBytes: int *\n| parse RawData with * \"TotalResponseCount: \" TotalResponseCount: int \" TotalResponseSize: \" TotalResponseSizeBytes: int *\n| parse RawData with * \"AverageElapsedTime: \" AverageElapsedTime_ms: int *\n| parse RawData with * \"ProcessingRate: \" ProcessingRate_RequestsPerSecond: real *\n| parse RawData with * \"$$<CMGService><\" DateTimeString: string \".\" *\n| project\n TimeGenerated,\n DateTimeString,\n Computer,\n FileName,\n FilePath,\n TotalRequestCount,\n TotalRequestSizeBytes,\n TotalResponseCount,\n TotalResponseSizeBytes,\n AverageElapsedTime_ms,\n ProcessingRate_RequestsPerSecond\n| extend CMGNode=tostring(split(FileName, \"-\")[2])\n| summarize\n RequestCount=round(sum(TotalRequestCount), 0),\n round(ResponseCount=sum(TotalResponseCount), 0),\n round(RequestSizeBytes=sum(TotalRequestSizeBytes), 0),\n round(ResponseSizeBytes=sum(TotalResponseSizeBytes), 0),\n round(AverageElapsedTime_ms=avg(AverageElapsedTime_ms), 0),\n round(ProcessingRate_RequestsPerSecond=avg(ProcessingRate_RequestsPerSecond), 0)\n by bin(TimeGenerated, 1m), CMGNode, Computer, FileName, FilePath\n| summarize arg_max(TimeGenerated, *) by CMGNode\n| extend TimeFromNow = now() - TimeGenerated\n| extend LastSummaryMinutes = toint(TimeFromNow / 1m)\n//Response count should be no less than 30% of request count\n| extend ResponseCountThreshold = RequestCount * 0.7\n| project\n CMGNode,\n LastSummaryMinutes,\n RequestCount,\n ResponseCount,\n AverageElapsedTime_ms,\n ResponseCountThreshold,\n Computer,\n FileName,\n FilePath\n| extend Health = iff(LastSummaryMinutes > 15 or RequestCount == 0 or ResponseCount < ResponseCountThreshold or AverageElapsedTime_ms > 300000, 1, 0)\n| join kind=leftouter\n (\n Heartbeat\n | distinct _ResourceId, Computer\n //| extend Computer=tostring(split(_ResourceId,\"/\")[8])\n | extend CMGNode = tolower(Computer)\n //| extend CMGNode_ResourceId = tolower(_ResourceId)\n | project CMGNode, _ResourceId\n )\n on CMGNode\n| join kind=leftouter\n (\n Heartbeat\n | distinct _ResourceId, Computer\n | extend Computer=tostring(split(_ResourceId, \"/\")[8])\n | extend Computer = tolower(Computer)\n | extend LogComputer_ResourceId = tolower(_ResourceId)\n | project Computer, LogComputer_ResourceId\n )\n on Computer\n| extend LogComputer = Computer\n| project-away CMGNode1, Computer1, Computer\n| extend AverageElapsedTime_minutes = round(AverageElapsedTime_ms / 60000, 0)\n//| where AverageElapsedTime_minutes > 5\n\n",
"timeAggregation": "Total",
"metricMeasureColumn": "AverageElapsedTime_minutes",
"dimensions": [
{
"name": "CMGNode",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FileName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FilePath",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "LogComputer",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "GreaterThan",
"threshold": 5,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG - Low Response Count",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG - Low Response Count",
"description": "The response count for the CMG node is less than 50% of the request count (CMGService.log).",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG Service Health\nConfigMgr_Logs_CL\n| extend Computer=tostring(split(_ResourceId, \"/\")[8])\n| extend FileName=tostring(split(FilePath, \"\\\\\")[-1])\n| where FileName contains \"CMGService.log\"\n| where RawData contains \"Summary - \"\n| project TimeGenerated, Computer, FileName, RawData, FilePath\n| parse RawData with * \"TotalRequestCount: \" TotalRequestCount: int \" TotalRequestSize: \" TotalRequestSizeBytes: int *\n| parse RawData with * \"TotalResponseCount: \" TotalResponseCount: int \" TotalResponseSize: \" TotalResponseSizeBytes: int *\n| parse RawData with * \"AverageElapsedTime: \" AverageElapsedTime_ms: int *\n| parse RawData with * \"ProcessingRate: \" ProcessingRate_RequestsPerSecond: real *\n| parse RawData with * \"$$<CMGService><\" DateTimeString: string \".\" *\n| project\n TimeGenerated,\n DateTimeString,\n Computer,\n FileName,\n FilePath,\n TotalRequestCount,\n TotalRequestSizeBytes,\n TotalResponseCount,\n TotalResponseSizeBytes,\n AverageElapsedTime_ms,\n ProcessingRate_RequestsPerSecond\n| extend CMGNode=tostring(split(FileName, \"-\")[2])\n| summarize\n RequestCount=round(sum(TotalRequestCount), 0),\n round(ResponseCount=sum(TotalResponseCount), 0),\n round(RequestSizeBytes=sum(TotalRequestSizeBytes), 0),\n round(ResponseSizeBytes=sum(TotalResponseSizeBytes), 0),\n round(AverageElapsedTime_ms=avg(AverageElapsedTime_ms), 0),\n round(ProcessingRate_RequestsPerSecond=avg(ProcessingRate_RequestsPerSecond), 0)\n by bin(TimeGenerated, 1m), CMGNode, Computer, FileName, FilePath\n| summarize arg_max(TimeGenerated, *) by CMGNode\n| extend TimeFromNow = now() - TimeGenerated\n| extend LastSummaryMinutes = toint(TimeFromNow / 1m)\n//Response count should be no less than 30% of request count\n| extend ResponseCountThreshold = RequestCount * 0.7\n| extend ResponsePercentage = round((ResponseCount/RequestCount)*100,1)\n| project\n CMGNode,\n LastSummaryMinutes,\n RequestCount,\n ResponseCount,\n AverageElapsedTime_ms,\n ResponseCountThreshold,\n ResponsePercentage,\n Computer,\n FileName,\n FilePath\n| extend Health = iff(LastSummaryMinutes > 15 or RequestCount == 0 or ResponseCount < ResponseCountThreshold or AverageElapsedTime_ms > 300000, 1, 0)\n| join kind=leftouter\n (\n Heartbeat\n | distinct _ResourceId, Computer\n //| extend Computer=tostring(split(_ResourceId,\"/\")[8])\n | extend CMGNode = tolower(Computer)\n //| extend CMGNode_ResourceId = tolower(_ResourceId)\n | project CMGNode, _ResourceId\n )\n on CMGNode\n| join kind=leftouter\n (\n Heartbeat\n | distinct _ResourceId, Computer\n | extend Computer=tostring(split(_ResourceId, \"/\")[8])\n | extend Computer = tolower(Computer)\n | extend LogComputer_ResourceId = tolower(_ResourceId)\n | project Computer, LogComputer_ResourceId\n )\n on Computer\n| extend LogComputer = Computer\n| project-away CMGNode1, Computer1, Computer\n",
"timeAggregation": "Total",
"metricMeasureColumn": "ResponsePercentage",
"dimensions": [
{
"name": "CMGNode",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FileName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FilePath",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "LogComputer",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "LessThan",
"threshold": 50,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG - No Requests",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG - No Requests",
"description": "The request count for the CMG node is zero (from CMGService.log)",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG Service Health\nConfigMgr_Logs_CL\n| extend Computer=tostring(split(_ResourceId, \"/\")[8])\n| extend FileName=tostring(split(FilePath, \"\\\\\")[-1])\n| where FileName contains \"CMGService.log\"\n| where RawData contains \"Summary - \"\n| project TimeGenerated, Computer, FileName, RawData, FilePath\n| parse RawData with * \"TotalRequestCount: \" TotalRequestCount: int \" TotalRequestSize: \" TotalRequestSizeBytes: int *\n| parse RawData with * \"TotalResponseCount: \" TotalResponseCount: int \" TotalResponseSize: \" TotalResponseSizeBytes: int *\n| parse RawData with * \"AverageElapsedTime: \" AverageElapsedTime_ms: int *\n| parse RawData with * \"ProcessingRate: \" ProcessingRate_RequestsPerSecond: real *\n| parse RawData with * \"$$<CMGService><\" DateTimeString: string \".\" *\n| project\n TimeGenerated,\n DateTimeString,\n Computer,\n FileName,\n FilePath,\n TotalRequestCount,\n TotalRequestSizeBytes,\n TotalResponseCount,\n TotalResponseSizeBytes,\n AverageElapsedTime_ms,\n ProcessingRate_RequestsPerSecond\n| extend CMGNode=tostring(split(FileName, \"-\")[2])\n| summarize\n RequestCount=round(sum(TotalRequestCount), 0),\n round(ResponseCount=sum(TotalResponseCount), 0),\n round(RequestSizeBytes=sum(TotalRequestSizeBytes), 0),\n round(ResponseSizeBytes=sum(TotalResponseSizeBytes), 0),\n round(AverageElapsedTime_ms=avg(AverageElapsedTime_ms), 0),\n round(ProcessingRate_RequestsPerSecond=avg(ProcessingRate_RequestsPerSecond), 0)\n by bin(TimeGenerated, 1m), CMGNode, Computer, FileName, FilePath\n| summarize arg_max(TimeGenerated, *) by CMGNode\n| extend TimeFromNow = now() - TimeGenerated\n| extend LastSummaryMinutes = toint(TimeFromNow / 1m)\n//Response count should be no less than 30% of request count\n| extend ResponseCountThreshold = RequestCount * 0.7\n| project\n CMGNode,\n LastSummaryMinutes,\n RequestCount,\n ResponseCount,\n AverageElapsedTime_ms,\n ResponseCountThreshold,\n Computer,\n FileName,\n FilePath\n| extend Health = iff(LastSummaryMinutes > 15 or RequestCount == 0 or ResponseCount < ResponseCountThreshold or AverageElapsedTime_ms > 300000, 1, 0)\n| join kind=leftouter\n (\n Heartbeat\n | distinct _ResourceId, Computer\n //| extend Computer=tostring(split(_ResourceId,\"/\")[8])\n | extend CMGNode = tolower(Computer)\n //| extend CMGNode_ResourceId = tolower(_ResourceId)\n | project CMGNode, _ResourceId\n )\n on CMGNode\n| join kind=leftouter\n (\n Heartbeat\n | distinct _ResourceId, Computer\n | extend Computer=tostring(split(_ResourceId, \"/\")[8])\n | extend Computer = tolower(Computer)\n | extend LogComputer_ResourceId = tolower(_ResourceId)\n | project Computer, LogComputer_ResourceId\n )\n on Computer\n| extend LogComputer = Computer\n| project-away CMGNode1, Computer1, Computer\n//| where RequestCount == 0\n\n",
"timeAggregation": "Total",
"metricMeasureColumn": "RequestCount",
"dimensions": [
{
"name": "CMGNode",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FileName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FilePath",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "LogComputer",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "Equal",
"threshold": 0,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG - Scale Set Instance Issue",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG - Scale Set Instance Issue",
"description": "The CMG Scale Set instance is either not running or not provisioned, based on the most recent entry for it in the CloudMgr.log file. See the alert details for additional information.",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG VM Scale Set Health\nConfigMgr_Logs_CL\n| extend Computer=tostring(split(_ResourceId,\"/\")[8])\n| extend FileName=tostring(split(FilePath,\"\\\\\")[-1])\n| where FileName == \"CloudMgr.log\"\n| where RawData contains \"VMSS\" and RawData contains \"vmPowerState\"\n| extend VMSSName = extract(\"VMSS (.*?) instance\", 1, RawData)\n| extend VMSSInstance = extract(\"<name type=\\\"string\\\">(.*?)</name>\", 1, RawData)\n| extend PowerState = extract(\"vmPowerState is: PowerState/(.*?) \", 1, RawData)\n| extend ProvisioningState = extract(\"provisioning state: ProvisioningState/(.*?)~~\", 1, RawData)\n| summarize arg_max(TimeGenerated,*) by VMSSName,VMSSInstance,Computer,FileName,FilePath\n| extend PowerState = strcat(toupper(substring(PowerState, 0, 1)), tolower(substring(PowerState, 1)))\n| extend ProvisioningState = strcat(toupper(substring(ProvisioningState, 0, 1)), tolower(substring(ProvisioningState, 1)))\n| extend VMSSName = toupper(VMSSName)\n| extend VMSSInstance = toupper(VMSSInstance)\n| extend TimeFromNow = now() - TimeGenerated\n| extend LastStatusUpdateMinutes = toint(TimeFromNow / 1m)\n| project VMSSName,VMSSInstance,LastStatusUpdateMinutes,PowerState,ProvisioningState,Computer,FileName,FilePath\n//| extend Health = iff(LastStatusUpdateMinutes > 15 or PowerState !=\"Running\" or ProvisioningState !=\"Succeeded\",1,0)\n| extend Health = iff(PowerState !=\"Running\" or ProvisioningState !=\"Succeeded\",1,0)\n| join kind=leftouter\n(\nHeartbeat\n| where ResourceType =~ \"virtualMachineScaleSets\"\n| distinct Computer,_ResourceId\n| extend VMSSName = toupper(split(_ResourceId,\"/\")[8])\n| extend VMSSResourceID = tostring(split(_ResourceId, \"/virtualmachines/\")[0])\n| distinct VMSSName,VMSSResourceID\n) on VMSSName\n| project-away VMSSName1\n",
"timeAggregation": "Total",
"metricMeasureColumn": "Health",
"dimensions": [
{
"name": "VMSSName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "VMSSInstance",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "PowerState",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "ProvisioningState",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FileName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FilePath",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "VMSSResourceID",
"operator": "GreaterThan",
"threshold": 0,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG - Scale Set status not written to CloudMgr.log",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG - Scale Set status not written to CloudMgr.log",
"description": "The site server has not written the CMG Scale Set status to the CloudMgr.log file in over 15 minutes.",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG VM Scale Set Health\nConfigMgr_Logs_CL\n| extend Computer=tostring(split(_ResourceId,\"/\")[8])\n| extend FileName=tostring(split(FilePath,\"\\\\\")[-1])\n| where FileName == \"CloudMgr.log\"\n| where RawData contains \"VMSS\" and RawData contains \"vmPowerState\"\n| extend VMSSName = extract(\"VMSS (.*?) instance\", 1, RawData)\n| extend VMSSInstance = extract(\"<name type=\\\"string\\\">(.*?)</name>\", 1, RawData)\n| extend PowerState = extract(\"vmPowerState is: PowerState/(.*?) \", 1, RawData)\n| extend ProvisioningState = extract(\"provisioning state: ProvisioningState/(.*?)~~\", 1, RawData)\n| summarize arg_max(TimeGenerated,*) by _ResourceId,VMSSName\n| extend TimeFromNow = now() - TimeGenerated\n| extend LastStatusUpdateMinutes = toint(TimeFromNow / 1m)\n| project Computer,VMSSName, FilePath,FileName,LastStatusUpdateMinutes,_ResourceId\n",
"timeAggregation": "Total",
"metricMeasureColumn": "LastStatusUpdateMinutes",
"dimensions": [
{
"name": "Computer",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "VMSSName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FilePath",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FileName",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "GreaterThan",
"threshold": 15,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG - Service Status not written to CMGService.log",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG - Service Status not written to CMGService.log",
"description": "The CMG service status has not been written to the CMGService.log file in over 15 minutes,",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG Service Health\nConfigMgr_Logs_CL\n| extend Computer=tostring(split(_ResourceId, \"/\")[8])\n| extend FileName=tostring(split(FilePath, \"\\\\\")[-1])\n| where FileName contains \"CMGService.log\"\n| where RawData contains \"Summary - \"\n| project TimeGenerated, Computer, FileName, RawData, FilePath\n| parse RawData with * \"TotalRequestCount: \" TotalRequestCount: int \" TotalRequestSize: \" TotalRequestSizeBytes: int *\n| parse RawData with * \"TotalResponseCount: \" TotalResponseCount: int \" TotalResponseSize: \" TotalResponseSizeBytes: int *\n| parse RawData with * \"AverageElapsedTime: \" AverageElapsedTime_ms: int *\n| parse RawData with * \"ProcessingRate: \" ProcessingRate_RequestsPerSecond: real *\n| parse RawData with * \"$$<CMGService><\" DateTimeString: string \".\" *\n| project\n TimeGenerated,\n DateTimeString,\n Computer,\n FileName,\n FilePath,\n TotalRequestCount,\n TotalRequestSizeBytes,\n TotalResponseCount,\n TotalResponseSizeBytes,\n AverageElapsedTime_ms,\n ProcessingRate_RequestsPerSecond\n| extend CMGNode=tostring(split(FileName, \"-\")[2])\n| summarize\n RequestCount=round(sum(TotalRequestCount), 0),\n round(ResponseCount=sum(TotalResponseCount), 0),\n round(RequestSizeBytes=sum(TotalRequestSizeBytes), 0),\n round(ResponseSizeBytes=sum(TotalResponseSizeBytes), 0),\n round(AverageElapsedTime_ms=avg(AverageElapsedTime_ms), 0),\n round(ProcessingRate_RequestsPerSecond=avg(ProcessingRate_RequestsPerSecond), 0)\n by bin(TimeGenerated, 1m), CMGNode, Computer, FileName, FilePath\n| summarize arg_max(TimeGenerated, *) by CMGNode\n| extend TimeFromNow = now() - TimeGenerated\n| extend LastSummaryMinutes = toint(TimeFromNow / 1m)\n| extend LastSummaryTime_UTC = tostring(TimeGenerated)\n//Response count should be no less than 30% of request count\n| extend ResponseCountThreshold = RequestCount * 0.7\n| project\n CMGNode,\n LastSummaryTime_UTC,\n LastSummaryMinutes,\n RequestCount,\n ResponseCount,\n AverageElapsedTime_ms,\n ResponseCountThreshold,\n Computer,\n FileName,\n FilePath\n| extend Health = iff(LastSummaryMinutes > 15 or RequestCount == 0 or ResponseCount < ResponseCountThreshold or AverageElapsedTime_ms > 300000, 1, 0)\n| join kind=leftouter\n (\n Heartbeat\n | distinct _ResourceId, Computer\n //| extend Computer=tostring(split(_ResourceId,\"/\")[8])\n | extend CMGNode = tolower(Computer)\n //| extend CMGNode_ResourceId = tolower(_ResourceId)\n | project CMGNode, _ResourceId\n )\n on CMGNode\n| join kind=leftouter\n (\n Heartbeat\n | distinct _ResourceId, Computer\n | extend Computer=tostring(split(_ResourceId, \"/\")[8])\n | extend Computer = tolower(Computer)\n | extend LogComputer_ResourceId = tolower(_ResourceId)\n | project Computer, LogComputer_ResourceId\n )\n on Computer\n| extend LogComputer = Computer\n| project-away CMGNode1, Computer1, Computer\n//| where LastSummaryMinutes > 15\n\n",
"timeAggregation": "Total",
"metricMeasureColumn": "LastSummaryMinutes",
"dimensions": [
{
"name": "CMGNode",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "LastSummaryTime_UTC",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FileName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FilePath",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "LogComputer",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "GreaterThan",
"threshold": 15,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG Connection Point - CMG Connection Test Not Running",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG Connection Point - CMG Connection Test Not Running",
"description": "The connection test to the CMG has not run in over 5 minutes",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG Connection Tests Health\nNWConnectionMonitorTestResult \n| where TestGroupName == \"MECM-CMG-Connection\"\n| summarize LastConnectionTest=arg_max(TimeGenerated, *) by SourceName, DestinationPort\n| extend SourceName = tostring(split(SourceName, \"(\")[0])\n| extend TimeFromNow = now() - LastConnectionTest\n| extend LastConnectionTestMinutes = toint(TimeFromNow / 1m)\n| extend LastConnectionTest_UTC = tostring(LastConnectionTest)\n| extend Failed = strcat(ChecksFailed, \"/\", ChecksTotal)\n| project\n Source=tolower(SourceName),\n Port=DestinationPort,\n DestinationName,\n DestinationAddress,\n LastConnectionTest_UTC,\n LastConnectionTestMinutes,\n Result=TestResult,\n ChecksFailed,\n Failed,\n MaxRTT=round(MaxRoundTripTimeMs, 0),\n AvgRTT=round(AvgRoundTripTimeMs, 0)\n| order by Source asc, Port asc\n| extend Health = iff(LastConnectionTestMinutes > 5 or Result != \"Pass\" or ChecksFailed > 3 or AvgRTT > 100, 1, 0)\n| join kind=leftouter \n (\n Heartbeat\n | distinct _ResourceId, Computer\n | extend Computer=tostring(split(_ResourceId, \"/\")[8])\n | extend Computer = tolower(Computer)\n | project Computer, _ResourceId\n )\n on $left.Source == $right.Computer\n//| where LastConnectionTestMinutes > 5\n\n",
"timeAggregation": "Total",
"metricMeasureColumn": "LastConnectionTestMinutes",
"dimensions": [
{
"name": "Port",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "DestinationName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "DestinationAddress",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "LastConnectionTest_UTC",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "GreaterThan",
"threshold": 10,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG Connection Point - CMG Connection Tests Failed",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG Connection Point - CMG Connection Tests Failed",
"description": "The connection test to the CMG has failures",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG Connection Tests Health\nNWConnectionMonitorTestResult \n| where TestGroupName == \"MECM-CMG-Connection\"\n| summarize LastConnectionTest=arg_max(TimeGenerated, *) by SourceName, DestinationPort\n| extend SourceName = tostring(split(SourceName, \"(\")[0])\n| extend TimeFromNow = now() - LastConnectionTest\n| extend LastConnectionTestMinutes = toint(TimeFromNow / 1m)\n| extend LastConnectionTest_UTC = tostring(LastConnectionTest)\n| extend Failed = strcat(ChecksFailed, \"/\", ChecksTotal)\n| project\n Source=tolower(SourceName),\n Port=DestinationPort,\n LastConnectionTest_UTC,\n LastConnectionTestMinutes,\n Result=TestResult,\n ChecksFailed,\n Failed,\n MaxRTT=round(MaxRoundTripTimeMs, 0),\n AvgRTT=round(AvgRoundTripTimeMs, 0)\n| order by Source asc, Port asc\n| extend Health = iff(LastConnectionTestMinutes > 5 or Result != \"Pass\" or ChecksFailed > 3 or AvgRTT > 100, 1, 0)\n| join kind=leftouter \n (\n Heartbeat\n | distinct _ResourceId, Computer\n | extend Computer=tostring(split(_ResourceId, \"/\")[8])\n | extend Computer = tolower(Computer)\n | project Computer, _ResourceId\n )\n on $left.Source == $right.Computer\n//| where ChecksFailed > 3\n\n",
"timeAggregation": "Total",
"metricMeasureColumn": "ChecksFailed",
"dimensions": [
{
"name": "Port",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "LastConnectionTest_UTC",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "Failed",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "GreaterThan",
"threshold": 3,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG Connection Point - CMG Connection Tests have high rount-trip-time",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG Connection Point - CMG Connection Tests have high rount-trip-time",
"description": "The connection test to the CMG has a RTT over 100ms.",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG Connection Tests Health\nNWConnectionMonitorTestResult \n| where TestGroupName == \"MECM-CMG-Connection\"\n| summarize LastConnectionTest=arg_max(TimeGenerated, *) by SourceName, DestinationPort\n| extend SourceName = tostring(split(SourceName, \"(\")[0])\n| extend TimeFromNow = now() - LastConnectionTest\n| extend LastConnectionTestMinutes = toint(TimeFromNow / 1m)\n| extend LastConnectionTest_UTC = tostring(LastConnectionTest)\n| extend Failed = strcat(ChecksFailed, \"/\", ChecksTotal)\n| project\n Source=tolower(SourceName),\n Port=DestinationPort,\n LastConnectionTest_UTC,\n LastConnectionTestMinutes,\n Result=TestResult,\n ChecksFailed,\n Failed,\n MaxRTT=round(MaxRoundTripTimeMs, 0),\n AvgRTT=round(AvgRoundTripTimeMs, 0)\n| order by Source asc, Port asc\n| extend Health = iff(LastConnectionTestMinutes > 5 or Result != \"Pass\" or ChecksFailed > 3 or AvgRTT > 100, 1, 0)\n| join kind=leftouter \n (\n Heartbeat\n | distinct _ResourceId, Computer\n | extend Computer=tostring(split(_ResourceId, \"/\")[8])\n | extend Computer = tolower(Computer)\n | project Computer, _ResourceId\n )\n on $left.Source == $right.Computer\n//| where AvgRTT > 100\n\n",
"timeAggregation": "Average",
"metricMeasureColumn": "AvgRTT",
"dimensions": [
{
"name": "Port",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "LastConnectionTest_UTC",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "GreaterThan",
"threshold": 100,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG Connection Point - Failed Requests Exceeded Threshold",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG Connection Point - Failed Requests Exceeded Threshold",
"description": "The CMG Connection Point failed requests is more than 25% of total requests (SMS_CLOUD_PROXYCONNECTOR.log).",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG Connection Point Requests Health\nConfigMgr_Logs_CL\n| extend Computer=tostring(split(_ResourceId, \"/\")[8])\n| extend FileName=tostring(split(FilePath, \"\\\\\")[-1])\n| project TimeGenerated, Computer, FileName, FilePath, RawData\n| where FileName == \"SMS_CLOUD_PROXYCONNECTOR.log\"\n| where RawData contains \"ReportTrafficData - state message to send:\"\n| parse RawData with * 'ServerName=\"' ServerName '\"' * 'StartTime=\"' StartTime '\"' * 'EndTime=\"' EndTime '\"' * 'MaxConcurrentRequests=\"' MaxConcurrentRequests '\"' * '<EndPoints>' EndPoints '</EndPoints>' *\n| extend EndPoints = split(EndPoints, '~~')\n| mv-expand EndPoints\n| parse EndPoints with * 'Name=\"' Endpoint '\"' * 'ProxyServer=\"' ProxyServer '\"' * 'TargetHost=\"' TargetHost '\"' * 'TotalRequests=\"' TotalRequests '\"' * 'TotalRequestsWithBearerToken=\"' TotalRequestsWithBearerToken '\"' * 'MaxConcurrentRequests=\"' MaxConcurrentRequests '\"' * 'TotalRequestBytes=\"' TotalRequestBytes '\"' * 'TotalResponseBytes=\"' TotalResponseBytes '\"' * 'FailedRequests=\"' FailedRequests '\"' *\n| extend\n TotalRequests=toint(TotalRequests),\n TotalRequestsWithBearerToken=toint(TotalRequestsWithBearerToken),\n MaxConcurrentRequests=toint(MaxConcurrentRequests),\n TotalRequestBytes=toint(TotalRequestBytes),\n TotalResponseBytes=toint(TotalResponseBytes),\n FailedRequests=toint(FailedRequests)\n| project\n TimeGenerated,\n ServerName,\n StartTime,\n EndTime,\n Endpoint,\n ProxyServer,\n TargetHost,\n TotalRequests,\n TotalRequestsWithBearerToken,\n MaxConcurrentRequests,\n TotalRequestBytes,\n TotalResponseBytes,\n FailedRequests,\n FileName,\n FilePath\n| where isnotempty(Endpoint)\n| extend Target_NB=tostring(split(TargetHost, \".\")[0])\n| extend TargetHost_Endpoint = strcat(Target_NB, \": \", Endpoint)\n| summarize TotalRequests = sum(TotalRequests), FailedRequests=sum(FailedRequests) by TimeGenerated, Target_NB, FileName, FilePath\n| summarize arg_max(TimeGenerated, *) by Target_NB, FileName, FilePath\n| project TimeGenerated, Target_NB, TotalRequests, FailedRequests, FileName, FilePath\n| extend FailedRequestsThreshold = round(TotalRequests * 0.2, 0)\n| extend FailedRequestPercentage = round((toreal(FailedRequests)/toreal(TotalRequests))*100),0\n| extend TimeFromNow = now() - TimeGenerated\n| extend LastStatusUpdateMinutes = toint(TimeFromNow / 1m)\n| extend LastStatusUpdate_UTC = TimeGenerated\n| project\n Target_NB,\n LastStatusUpdateMinutes,\n LastStatusUpdate_UTC,\n TotalRequests,\n FailedRequests,\n FailedRequestsThreshold,\n FailedRequestPercentage,\n FileName,\n FilePath\n| extend Health = iff(LastStatusUpdateMinutes > 15 or TotalRequests == 0 or FailedRequests > FailedRequestsThreshold, 1, 0)\n| extend Computer = Target_NB\n| join kind=leftouter \n (\n Heartbeat\n | distinct _ResourceId, Computer\n | extend Computer=tostring(split(_ResourceId, \"/\")[8])\n | extend Computer = tolower(Computer)\n | project Computer, _ResourceId\n )\n on Computer\n| project\n Computer,\n tostring(LastStatusUpdate_UTC),\n LastStatusUpdateMinutes,\n TotalRequests,\n FailedRequests,\n FailedRequestsThreshold,\n FailedRequestPercentage,\n Health,\n _ResourceId,\n FileName,\n FilePath\n\n",
"timeAggregation": "Total",
"metricMeasureColumn": "FailedRequestPercentage",
"dimensions": [
{
"name": "Computer",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FileName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FilePath",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "GreaterThan",
"threshold": 25,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG Connection Point - Less than 10 Web Socket Connections",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG Connection Point - Less than 10 Web Socket Connections",
"description": "The CMG Connection Point has less than 10 Web Socket Connections to the CMG.",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG Connection Point Web Socket Connections Health\nConfigMgr_Logs_CL\n| extend Computer=tostring(split(_ResourceId, \"/\")[8])\n| extend FileName=tostring(split(FilePath, \"\\\\\")[-1])\n| project TimeGenerated, Computer, FileName, FilePath, RawData\n| where FileName == \"SMS_CLOUD_PROXYCONNECTOR.log\"\n| where RawData contains \"WebSocket connections established with proxy server\"\n//| summarize arg_max(TimeGenerated,*) by Computer\n| parse RawData with * 'There are ' WebSocketConnections ' WebSocket connections' * 'proxy server ' CMGName \":\" Port \"~~\" *\n| summarize arg_max(TimeGenerated, *) by Computer, CMGName, FileName, FilePath, Port\n| extend CMGName = tostring(split(CMGName, \".\")[0])\n| extend TimeFromNow = now() - TimeGenerated\n| extend LastStatusUpdateMinutes = toint(TimeFromNow / 1m)\n| extend LastStatusUpdate_UTC = tostring(TimeGenerated)\n| project\n Computer,\n CMGName,\n Port,\n LastStatusUpdate_UTC,\n LastStatusUpdateMinutes,\n WebSocketConnections,\n FileName,\n FilePath\n| extend Health = iff(LastStatusUpdateMinutes > 10 or WebSocketConnections != 10, 1, 0)\n| join kind=leftouter \n (\n Heartbeat\n | distinct _ResourceId, Computer\n | extend Computer=tostring(split(_ResourceId, \"/\")[8])\n | extend Computer = tolower(Computer)\n | project Computer, _ResourceId\n )\n on Computer\n| extend WebSocketConnections=toint(WebSocketConnections)\n//| where WebSocketConnections != 10\n\n",
"timeAggregation": "Total",
"metricMeasureColumn": "WebSocketConnections",
"dimensions": [
{
"name": "Computer",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "CMGName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "Port",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FileName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FilePath",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "LessThan",
"threshold": 10,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG Connection Point - No requests",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG Connection Point - No requests",
"description": "The CMG Connection Point is not receiving requests (SMS_CLOUD_PROXYCONNECTOR.log).",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG Connection Point Requests Health\nConfigMgr_Logs_CL\n| extend Computer=tostring(split(_ResourceId, \"/\")[8])\n| extend FileName=tostring(split(FilePath, \"\\\\\")[-1])\n| project TimeGenerated, Computer, FileName, FilePath, RawData\n| where FileName == \"SMS_CLOUD_PROXYCONNECTOR.log\"\n| where RawData contains \"ReportTrafficData - state message to send:\"\n| parse RawData with * 'ServerName=\"' ServerName '\"' * 'StartTime=\"' StartTime '\"' * 'EndTime=\"' EndTime '\"' * 'MaxConcurrentRequests=\"' MaxConcurrentRequests '\"' * '<EndPoints>' EndPoints '</EndPoints>' *\n| extend EndPoints = split(EndPoints, '~~')\n| mv-expand EndPoints\n| parse EndPoints with * 'Name=\"' Endpoint '\"' * 'ProxyServer=\"' ProxyServer '\"' * 'TargetHost=\"' TargetHost '\"' * 'TotalRequests=\"' TotalRequests '\"' * 'TotalRequestsWithBearerToken=\"' TotalRequestsWithBearerToken '\"' * 'MaxConcurrentRequests=\"' MaxConcurrentRequests '\"' * 'TotalRequestBytes=\"' TotalRequestBytes '\"' * 'TotalResponseBytes=\"' TotalResponseBytes '\"' * 'FailedRequests=\"' FailedRequests '\"' *\n| extend\n TotalRequests=toint(TotalRequests),\n TotalRequestsWithBearerToken=toint(TotalRequestsWithBearerToken),\n MaxConcurrentRequests=toint(MaxConcurrentRequests),\n TotalRequestBytes=toint(TotalRequestBytes),\n TotalResponseBytes=toint(TotalResponseBytes),\n FailedRequests=toint(FailedRequests)\n| project\n TimeGenerated,\n ServerName,\n StartTime,\n EndTime,\n Endpoint,\n ProxyServer,\n TargetHost,\n TotalRequests,\n TotalRequestsWithBearerToken,\n MaxConcurrentRequests,\n TotalRequestBytes,\n TotalResponseBytes,\n FailedRequests,\n FileName,\n FilePath\n| where isnotempty(Endpoint)\n| extend Target_NB=tostring(split(TargetHost, \".\")[0])\n| extend TargetHost_Endpoint = strcat(Target_NB, \": \", Endpoint)\n| summarize TotalRequests = sum(TotalRequests), FailedRequests=sum(FailedRequests) by TimeGenerated, Target_NB, FileName, FilePath\n| summarize arg_max(TimeGenerated, *) by Target_NB, FileName, FilePath\n| project TimeGenerated, Target_NB, TotalRequests, FailedRequests, FileName, FilePath\n| extend FailedRequestsThreshold = round(TotalRequests * 0.2, 0)\n| extend TimeFromNow = now() - TimeGenerated\n| extend LastStatusUpdateMinutes = toint(TimeFromNow / 1m)\n| extend LastStatusUpdate_UTC = TimeGenerated\n| project\n Target_NB,\n LastStatusUpdateMinutes,\n LastStatusUpdate_UTC,\n TotalRequests,\n FailedRequests,\n FailedRequestsThreshold,\n FileName,\n FilePath\n| extend Health = iff(LastStatusUpdateMinutes > 15 or TotalRequests == 0 or FailedRequests > FailedRequestsThreshold, 1, 0)\n| extend Computer = Target_NB\n| join kind=leftouter \n (\n Heartbeat\n | distinct _ResourceId, Computer\n | extend Computer=tostring(split(_ResourceId, \"/\")[8])\n | extend Computer = tolower(Computer)\n | project Computer, _ResourceId\n )\n on Computer\n| project\n Computer,\n tostring(LastStatusUpdate_UTC),\n LastStatusUpdateMinutes,\n TotalRequests,\n FailedRequests,\n FailedRequestsThreshold,\n Health,\n _ResourceId,\n FileName,\n FilePath\n//| where TotalRequests == 0\n\n",
"timeAggregation": "Total",
"metricMeasureColumn": "TotalRequests",
"dimensions": [
{
"name": "Computer",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FileName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FilePath",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "Equal",
"threshold": 0,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG Connection Point - Status not written to SMS_CLOUD_PROXYCONNECTOR.log",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG Connection Point - Status not written to SMS_CLOUD_PROXYCONNECTOR.log",
"description": "The CMG Connection Point status has not been written to the SMS_CLOUD_PROXYCONNECTOR.log file in over 15 minutes.",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG Connection Point Requests Health\nConfigMgr_Logs_CL\n| extend Computer=tostring(split(_ResourceId, \"/\")[8])\n| extend FileName=tostring(split(FilePath, \"\\\\\")[-1])\n| project TimeGenerated, Computer, FileName, FilePath, RawData\n| where FileName == \"SMS_CLOUD_PROXYCONNECTOR.log\"\n| where RawData contains \"ReportTrafficData - state message to send:\"\n| parse RawData with * 'ServerName=\"' ServerName '\"' * 'StartTime=\"' StartTime '\"' * 'EndTime=\"' EndTime '\"' * 'MaxConcurrentRequests=\"' MaxConcurrentRequests '\"' * '<EndPoints>' EndPoints '</EndPoints>' *\n| extend EndPoints = split(EndPoints, '~~')\n| mv-expand EndPoints\n| parse EndPoints with * 'Name=\"' Endpoint '\"' * 'ProxyServer=\"' ProxyServer '\"' * 'TargetHost=\"' TargetHost '\"' * 'TotalRequests=\"' TotalRequests '\"' * 'TotalRequestsWithBearerToken=\"' TotalRequestsWithBearerToken '\"' * 'MaxConcurrentRequests=\"' MaxConcurrentRequests '\"' * 'TotalRequestBytes=\"' TotalRequestBytes '\"' * 'TotalResponseBytes=\"' TotalResponseBytes '\"' * 'FailedRequests=\"' FailedRequests '\"' *\n| extend\n TotalRequests=toint(TotalRequests),\n TotalRequestsWithBearerToken=toint(TotalRequestsWithBearerToken),\n MaxConcurrentRequests=toint(MaxConcurrentRequests),\n TotalRequestBytes=toint(TotalRequestBytes),\n TotalResponseBytes=toint(TotalResponseBytes),\n FailedRequests=toint(FailedRequests)\n| project\n TimeGenerated,\n ServerName,\n StartTime,\n EndTime,\n Endpoint,\n ProxyServer,\n TargetHost,\n TotalRequests,\n TotalRequestsWithBearerToken,\n MaxConcurrentRequests,\n TotalRequestBytes,\n TotalResponseBytes,\n FailedRequests,\n FileName,\n FilePath\n| where isnotempty(Endpoint)\n| extend Target_NB=tostring(split(TargetHost, \".\")[0])\n| extend TargetHost_Endpoint = strcat(Target_NB, \": \", Endpoint)\n| summarize TotalRequests = sum(TotalRequests), FailedRequests=sum(FailedRequests) by TimeGenerated, Target_NB, FileName, FilePath\n| summarize arg_max(TimeGenerated, *) by Target_NB, FileName, FilePath\n| project TimeGenerated, Target_NB, TotalRequests, FailedRequests, FileName, FilePath\n| extend FailedRequestsThreshold = round(TotalRequests * 0.2, 0)\n| extend TimeFromNow = now() - TimeGenerated\n| extend LastStatusUpdateMinutes = toint(TimeFromNow / 1m)\n| extend LastStatusUpdate_UTC = TimeGenerated\n| project\n Target_NB,\n LastStatusUpdateMinutes,\n LastStatusUpdate_UTC,\n TotalRequests,\n FailedRequests,\n FailedRequestsThreshold,\n FileName,\n FilePath\n| extend Health = iff(LastStatusUpdateMinutes > 15 or TotalRequests == 0 or FailedRequests > FailedRequestsThreshold, 1, 0)\n| extend Computer = Target_NB\n| join kind=leftouter \n (\n Heartbeat\n | distinct _ResourceId, Computer\n | extend Computer=tostring(split(_ResourceId, \"/\")[8])\n | extend Computer = tolower(Computer)\n | project Computer, _ResourceId\n )\n on Computer\n| project\n Computer,\n tostring(LastStatusUpdate_UTC),\n LastStatusUpdateMinutes,\n TotalRequests,\n FailedRequests,\n FailedRequestsThreshold,\n Health,\n _ResourceId,\n FileName,\n FilePath\n//| where LastStatusUpdateMinutes > 15\n\n",
"timeAggregation": "Total",
"metricMeasureColumn": "LastStatusUpdateMinutes",
"dimensions": [
{
"name": "Computer",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "LastStatusUpdate_UTC",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FileName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FilePath",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "GreaterThan",
"threshold": 15,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - CMG Connection Point - Web Socket Status not written to SMS_CLOUD_PROXYCONNECTOR.log",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - CMG Connection Point - Web Socket Status not written to SMS_CLOUD_PROXYCONNECTOR.log",
"description": "The CMG Connection Point Web Socket status has not been written to the SMS_CLOUD_PROXYCONNECTOR.log file in over 10 minutes.",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "//CMG Connection Point Web Socket Connections Health\nConfigMgr_Logs_CL\n| extend Computer=tostring(split(_ResourceId, \"/\")[8])\n| extend FileName=tostring(split(FilePath, \"\\\\\")[-1])\n| project TimeGenerated, Computer, FileName, FilePath, RawData\n| where FileName == \"SMS_CLOUD_PROXYCONNECTOR.log\"\n| where RawData contains \"WebSocket connections established with proxy server\"\n//| summarize arg_max(TimeGenerated,*) by Computer\n| parse RawData with * 'There are ' WebSocketConnections ' WebSocket connections' * 'proxy server ' CMGName \":\" Port \"~~\" *\n| summarize arg_max(TimeGenerated, *) by Computer, CMGName, FileName, FilePath//,Port\n| extend CMGName = tostring(split(CMGName, \".\")[0])\n| extend TimeFromNow = now() - TimeGenerated\n| extend LastStatusUpdateMinutes = toint(TimeFromNow / 1m)\n| extend LastStatusUpdate_UTC = tostring(TimeGenerated)\n| project\n Computer,\n CMGName,\n Port,\n LastStatusUpdate_UTC,\n LastStatusUpdateMinutes,\n WebSocketConnections,\n FileName,\n FilePath\n| extend Health = iff(LastStatusUpdateMinutes > 10 or WebSocketConnections != 10, 1, 0)\n| join kind=leftouter \n (\n Heartbeat\n | distinct _ResourceId, Computer\n | extend Computer=tostring(split(_ResourceId, \"/\")[8])\n | extend Computer = tolower(Computer)\n | project Computer, _ResourceId\n )\n on Computer\n//| where LastStatusUpdateMinutes > 10\n\n",
"timeAggregation": "Total",
"metricMeasureColumn": "LastStatusUpdateMinutes",
"dimensions": [
{
"name": "Computer",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "CMGName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "Port",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "LastStatusUpdate_UTC",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FileName",
"operator": "Include",
"values": [
"*"
]
},
{
"name": "FilePath",
"operator": "Include",
"values": [
"*"
]
}
],
"resourceIdColumn": "_ResourceId",
"operator": "GreaterThan",
"threshold": 10,
"failingPeriods": {
"numberOfEvaluationPeriods": 1,
"minFailingPeriodsToAlert": 1
}
}
]
},
"autoMitigate": true
}
},
{
"type": "microsoft.insights/scheduledqueryrules",
"apiVersion": "2023-03-15-preview",
"name": "ConfigMgr - Management Point - No Connected Clients",
"location": "[parameters('Location')]",
"properties": {
"displayName": "ConfigMgr - Management Point - No Connected Clients",
"description": "No clients are connected to the Management Point. The SMS Notification Server\\Total online clients counter has been 0 for 15 minutes.",
"severity": 1,
"enabled": true,
"evaluationFrequency": "PT5M",
"scopes": [
"[parameters('LogAnalyticsWorkspace')]"
],
"targetResourceTypes": [
"Microsoft.OperationalInsights/workspaces"
],
"windowSize": "P1D",
"criteria": {
"allOf": [
{
"query": "[concat('let ResourceGroup = \"',parameters('ConfigMgrResourceGroupName'),'\";\nPerf\n| where _ResourceId contains ResourceGroup\n| where ObjectName == \"SMS Notification Server\" and CounterName == \"Total online clients\"\n| summarize AvgClients = avg(CounterValue) by bin(TimeGenerated, 15m), Computer, _ResourceId\n| summarize LastCount = arg_max(TimeGenerated, *) by Computer, _ResourceId\n//| where AvgClients == 0\n\n')]",
"timeAggregation": "Average",
"metricMeasureColumn": "AvgClients",
"dimensions": [
{
"name": "Computer",
"operator": "Include",
"values": [
"*"
]
}