@oneuptime/common 12.0.34 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/DatabaseModels/GlobalConfig.ts +12 -12
- package/Models/DatabaseModels/InventoryItem.ts +44 -1
- package/Models/DatabaseModels/NetworkDevice.ts +126 -0
- package/Server/EnvironmentConfig.ts +47 -16
- package/Server/Infrastructure/Postgres/SchemaMigrations/1791700000000-AddMacAddressToNetworkDevice.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +2 -0
- package/Server/Infrastructure/Redis.ts +8 -8
- package/Server/Infrastructure/Status.ts +10 -4
- package/Server/Services/DatabaseService.ts +65 -13
- package/Server/Services/InventoryItemService.ts +31 -1
- package/Server/Services/MonitorTemplateService.ts +140 -19
- package/Server/Services/NetworkDeviceAutoImportRuleEngineService.ts +349 -41
- package/Server/Services/NetworkDeviceDiscoveryScanService.ts +87 -2
- package/Server/Services/NetworkDeviceService.ts +69 -0
- package/Server/Services/UserNotificationRuleService.ts +76 -25
- package/Server/Types/Database/Permissions/ReadPermission.ts +45 -5
- package/Server/Types/Database/QueryUtil.ts +56 -0
- package/Server/Types/Markdown.ts +93 -1
- package/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.ts +82 -17
- package/Server/Utils/EmailRollup/EmailRollupFlushRunner.ts +10 -1
- package/Server/Utils/EmailRollup/EmailRollupRenderer.ts +2 -2
- package/Server/Utils/Monitor/Criteria/CompareCriteria.ts +82 -35
- package/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts +31 -5
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +202 -37
- package/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.ts +82 -9
- package/Server/Utils/Monitor/MonitorCriteriaMessageBuilder.ts +16 -7
- package/Server/Utils/Monitor/MonitorCriteriaMessageFormatter.ts +29 -17
- package/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.ts +107 -48
- package/Server/Utils/Monitor/NetworkDeviceMacLearningUtil.ts +158 -0
- package/Server/Utils/Monitor/NetworkInventoryUtil.ts +27 -0
- package/Server/Utils/Telemetry/EntityRegistry.ts +11 -1
- package/Server/Utils/Telemetry/TelemetryEntity.ts +83 -9
- package/Tests/App/Dashboard/AddNeighborToMonitoringModal.test.tsx +32 -0
- package/Tests/App/Dashboard/AdoptedDeviceDrawer.test.tsx +374 -0
- package/Tests/App/Dashboard/DashboardLabelVariables.test.tsx +580 -0
- package/Tests/App/Dashboard/DashboardMonitorLabelVariable.test.tsx +438 -0
- package/Tests/App/Dashboard/DashboardVariableAllContract.test.tsx +5 -2
- package/Tests/App/Dashboard/DeviceAttachmentCard.test.tsx +273 -0
- package/Tests/App/Dashboard/DiscoveryReviewInventoryRefresh.test.tsx +505 -0
- package/Tests/App/Dashboard/EntityDetailPanel.test.tsx +163 -0
- package/Tests/App/Dashboard/InfrastructureExplorer.test.tsx +401 -0
- package/Tests/App/Dashboard/InfrastructureGraph.test.tsx +232 -0
- package/Tests/App/Dashboard/InventoryItems.test.tsx +201 -0
- package/Tests/App/Dashboard/InventoryTypeAndStatusFacets.test.tsx +798 -0
- package/Tests/App/Dashboard/NetworkTopologyLiveView.test.tsx +320 -0
- package/Tests/App/Dashboard/NetworkTopologyToolbar.test.tsx +275 -0
- package/Tests/App/Dashboard/OnCallCalendarFeedEmptyState.test.tsx +975 -0
- package/Tests/App/Dashboard/OnCallCalendarFeedPlanGate.test.tsx +63 -0
- package/Tests/App/Dashboard/ServiceMapGraph.test.tsx +626 -0
- package/Tests/App/Dashboard/TopologyDataLoading.test.tsx +348 -0
- package/Tests/App/Dashboard/TopologyPageNavigation.test.tsx +331 -0
- package/Tests/App/Dashboard/UserSettingsEmailPreferences.test.tsx +603 -0
- package/Tests/App/Dashboard/UserSettingsNotificationSettings.test.tsx +324 -0
- package/Tests/App/PublicDashboard/DashboardVariableSelector.test.tsx +13 -4
- package/Tests/App/StatusPage/StatusPageOidcOrigin.test.tsx +223 -0
- package/Tests/Models/InventoryItemStatus.test.ts +147 -0
- package/Tests/Models/NetworkDeviceMacAddressColumn.test.ts +294 -0
- package/Tests/Server/API/DashboardPublicResourceListAPI.test.ts +129 -0
- package/Tests/Server/EnvironmentConfigValkey.test.ts +227 -0
- package/Tests/Server/Infrastructure/Postgres/AddMacAddressToNetworkDeviceMigration.test.ts +365 -0
- package/Tests/Server/Infrastructure/Postgres/CustomFieldValueMappingMigration.test.ts +62 -23
- package/Tests/Server/Infrastructure/ValkeyDeploymentConfig.test.ts +265 -0
- package/Tests/Server/Middleware/HttpMetricsMiddleware.test.ts +382 -0
- package/Tests/Server/Middleware/SCIMAuthorization.test.ts +525 -0
- package/Tests/Server/Services/DatabaseServiceAggregateBy.test.ts +291 -56
- package/Tests/Server/Services/DatabaseServiceSortTiebreaker.test.ts +151 -0
- package/Tests/Server/Services/InventoryItemManualCreate.test.ts +105 -0
- package/Tests/Server/Services/InventoryItemPromotionGate.test.ts +178 -0
- package/Tests/Server/Services/MonitorTemplateServiceCustomFieldSync.test.ts +502 -0
- package/Tests/Server/Services/NetworkDeviceAutoImportRuleEngineService.test.ts +1133 -81
- package/Tests/Server/Services/NetworkDeviceDiscoveryScanRegistration.test.ts +520 -0
- package/Tests/Server/Services/NetworkDeviceMacAddressNormalization.test.ts +572 -0
- package/Tests/Server/Types/Database/InventoryStatusPostgres.test.ts +368 -0
- package/Tests/Server/Types/Database/Permissions/ReadBlockPermission.test.ts +261 -14
- package/Tests/Server/Types/Database/QueryUtilIncludesAnyOfGroups.test.ts +169 -0
- package/Tests/Server/Types/Database/QueryUtilIncludesAnyOfGroupsPostgres.test.ts +297 -0
- package/Tests/Server/Types/Markdown.test.ts +194 -1
- package/Tests/Server/Types/Workflow/Components/IncomingWebhookUtils.test.ts +279 -0
- package/Tests/Server/Types/Workflow/Components/TextToJson.test.ts +212 -0
- package/Tests/Server/Utils/CustomField/CustomFieldMappingRegistry.test.ts +436 -0
- package/Tests/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.test.ts +214 -0
- package/Tests/Server/Utils/EmailRollup/EmailRollupFlushRunnerBehaviour.test.ts +1 -1
- package/Tests/Server/Utils/EmailRollup/EmailRollupRenderer.test.ts +10 -3
- package/Tests/Server/Utils/EventLoop.test.ts +359 -0
- package/Tests/Server/Utils/JsonWebToken.test.ts +30 -0
- package/Tests/Server/Utils/Monitor/Criteria/CompareCriteria.test.ts +242 -0
- package/Tests/Server/Utils/Monitor/Criteria/CompareCriteriaAggregation.test.ts +13 -7
- package/Tests/Server/Utils/Monitor/Criteria/DatabaseMonitorCriteria.test.ts +29 -0
- package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.test.ts +30 -6
- package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteriaAnomalyUnits.test.ts +246 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEmailEvalLogAgreement.test.ts +280 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluator.test.ts +224 -10
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorMetricUnits.test.ts +570 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaExpectationBuilderUnits.test.ts +30 -5
- package/Tests/Server/Utils/Monitor/MonitorCriteriaMessageBuilderUnits.test.ts +68 -21
- package/Tests/Server/Utils/Monitor/MonitorCriteriaObservationBuilderUnits.test.ts +36 -19
- package/Tests/Server/Utils/Monitor/NetworkDeviceMacLearningUtil.test.ts +573 -0
- package/Tests/Server/Utils/Monitor/NetworkInventoryUtil.test.ts +317 -0
- package/Tests/Server/Utils/Telemetry/ContextSpanProcessor.test.ts +281 -0
- package/Tests/Server/Utils/Telemetry/InventoryDuplicateIdentity.test.ts +316 -0
- package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +111 -8
- package/Tests/Types/Database/IncludesAnyOfGroups.test.ts +106 -0
- package/Tests/Types/JSONFunctions.test.ts +40 -0
- package/Tests/Types/NetworkAutomation/AutoImportRunMerge.test.ts +235 -0
- package/Tests/Types/NetworkAutomation/RuleRunResult.test.ts +66 -0
- package/Tests/Types/NetworkAutomation/RuleRunResultDescribe.test.ts +309 -1
- package/Tests/Types/Telemetry/InventoryLiveness.test.ts +99 -0
- package/Tests/UI/Components/CustomFields/CustomFieldsDetail.test.tsx +160 -0
- package/Tests/UI/ReactRouterSingletonBuild.test.ts +133 -0
- package/Tests/UI/Rum/ReplayHeader.test.tsx +10 -2
- package/Tests/UI/Rum/ReplayPlayerChrome.test.tsx +514 -0
- package/Tests/UI/Rum/ReplayTimeFormat.test.ts +94 -0
- package/Tests/UI/Rum/ReplayUi.test.tsx +559 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +5 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +1 -0
- package/Tests/Utils/Dashboard/Components/DashboardMonitorListComponent.test.ts +11 -1
- package/Tests/Utils/Dashboard/LabelVariable.test.ts +257 -0
- package/Tests/Utils/Dashboard/VariableUrlState.test.ts +144 -14
- package/Tests/Utils/MetricUnitUtil.test.ts +81 -0
- package/Tests/Utils/Monitor/DeviceMacLearningUtil.test.ts +497 -0
- package/Tests/Utils/Monitor/MetricValueFormatter.test.ts +546 -0
- package/Tests/Utils/Monitor/MonitorTemplateCustomFieldUtil.test.ts +218 -0
- package/Tests/Utils/Monitor/NetworkTopologyEndpointAdoption.test.ts +1755 -0
- package/Tests/Utils/NetworkAutomation/AutoImportRunChain.test.ts +320 -0
- package/Types/BaseDatabase/IncludesAnyOfGroups.ts +77 -0
- package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +1 -0
- package/Types/Dashboard/DashboardComponents/DashboardMonitorListComponent.ts +1 -0
- package/Types/Dashboard/DashboardVariable.ts +8 -0
- package/Types/JSON.ts +4 -0
- package/Types/JSONFunctions.ts +16 -0
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +13 -0
- package/Types/NetworkAutomation/RuleRunResult.ts +402 -13
- package/Types/SerializableObjectDictionary.ts +4 -0
- package/Types/Telemetry/InventoryLiveness.ts +56 -0
- package/UI/Components/CSVFileUpload/CSVFileUpload.tsx +9 -2
- package/UI/Components/CustomFields/CustomFieldsDetail.tsx +46 -21
- package/UI/Components/Dashboard/DashboardVariableControl.tsx +285 -0
- package/UI/esbuild-config.js +6 -0
- package/Utils/Dashboard/Components/DashboardMonitorListComponent.ts +12 -1
- package/Utils/Dashboard/LabelVariable.ts +152 -0
- package/Utils/Dashboard/VariableUrlState.ts +27 -5
- package/Utils/MetricUnitUtil.ts +34 -0
- package/Utils/Monitor/DeviceMacLearningUtil.ts +177 -0
- package/Utils/Monitor/MetricValueFormatter.ts +342 -0
- package/Utils/Monitor/MonitorTemplateCustomFieldUtil.ts +124 -0
- package/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.ts +7 -2
- package/Utils/Monitor/NetworkTopologyUtil.ts +693 -0
- package/Utils/NetworkAutomation/AutoImportRunChain.ts +138 -0
- package/build/dist/Models/DatabaseModels/GlobalConfig.js +12 -12
- package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/InventoryItem.js +34 -1
- package/build/dist/Models/DatabaseModels/InventoryItem.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +128 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +44 -12
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1791700000000-AddMacAddressToNetworkDevice.js +14 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1791700000000-AddMacAddressToNetworkDevice.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +2 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Redis.js +8 -8
- package/build/dist/Server/Infrastructure/Redis.js.map +1 -1
- package/build/dist/Server/Infrastructure/Status.js +10 -4
- package/build/dist/Server/Infrastructure/Status.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +58 -13
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/InventoryItemService.js +28 -1
- package/build/dist/Server/Services/InventoryItemService.js.map +1 -1
- package/build/dist/Server/Services/MonitorTemplateService.js +116 -17
- package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js +270 -37
- package/build/dist/Server/Services/NetworkDeviceAutoImportRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js +65 -0
- package/build/dist/Server/Services/NetworkDeviceDiscoveryScanService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceService.js +54 -0
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleService.js +60 -25
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/ReadPermission.js +29 -4
- package/build/dist/Server/Types/Database/Permissions/ReadPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/QueryUtil.js +36 -0
- package/build/dist/Server/Types/Database/QueryUtil.js.map +1 -1
- package/build/dist/Server/Types/Markdown.js +75 -0
- package/build/dist/Server/Types/Markdown.js.map +1 -1
- package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js +53 -18
- package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js.map +1 -1
- package/build/dist/Server/Utils/EmailRollup/EmailRollupFlushRunner.js +10 -1
- package/build/dist/Server/Utils/EmailRollup/EmailRollupFlushRunner.js.map +1 -1
- package/build/dist/Server/Utils/EmailRollup/EmailRollupRenderer.js +2 -2
- package/build/dist/Server/Utils/EmailRollup/EmailRollupRenderer.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js +58 -35
- package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js +29 -5
- package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +166 -35
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.js +58 -9
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaExpectationBuilder.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaMessageBuilder.js +9 -3
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaMessageBuilder.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaMessageFormatter.js +26 -12
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaMessageFormatter.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js +74 -33
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaObservationBuilder.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/NetworkDeviceMacLearningUtil.js +114 -0
- package/build/dist/Server/Utils/Monitor/NetworkDeviceMacLearningUtil.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js +25 -0
- package/build/dist/Server/Utils/Monitor/NetworkInventoryUtil.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +9 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +70 -13
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
- package/build/dist/Types/BaseDatabase/IncludesAnyOfGroups.js +54 -0
- package/build/dist/Types/BaseDatabase/IncludesAnyOfGroups.js.map +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +1 -0
- package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardVariable.js +1 -0
- package/build/dist/Types/Dashboard/DashboardVariable.js.map +1 -1
- package/build/dist/Types/JSON.js +1 -0
- package/build/dist/Types/JSON.js.map +1 -1
- package/build/dist/Types/JSONFunctions.js +13 -0
- package/build/dist/Types/JSONFunctions.js.map +1 -1
- package/build/dist/Types/NetworkAutomation/RuleRunResult.js +291 -6
- package/build/dist/Types/NetworkAutomation/RuleRunResult.js.map +1 -1
- package/build/dist/Types/SerializableObjectDictionary.js +4 -0
- package/build/dist/Types/SerializableObjectDictionary.js.map +1 -1
- package/build/dist/Types/Telemetry/InventoryLiveness.js +37 -0
- package/build/dist/Types/Telemetry/InventoryLiveness.js.map +1 -0
- package/build/dist/UI/Components/CSVFileUpload/CSVFileUpload.js +7 -0
- package/build/dist/UI/Components/CSVFileUpload/CSVFileUpload.js.map +1 -1
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js +9 -2
- package/build/dist/UI/Components/CustomFields/CustomFieldsDetail.js.map +1 -1
- package/build/dist/UI/Components/Dashboard/DashboardVariableControl.js +137 -0
- package/build/dist/UI/Components/Dashboard/DashboardVariableControl.js.map +1 -0
- package/build/dist/Utils/Dashboard/Components/DashboardMonitorListComponent.js +9 -1
- package/build/dist/Utils/Dashboard/Components/DashboardMonitorListComponent.js.map +1 -1
- package/build/dist/Utils/Dashboard/LabelVariable.js +96 -0
- package/build/dist/Utils/Dashboard/LabelVariable.js.map +1 -0
- package/build/dist/Utils/Dashboard/VariableUrlState.js +19 -4
- package/build/dist/Utils/Dashboard/VariableUrlState.js.map +1 -1
- package/build/dist/Utils/MetricUnitUtil.js +26 -0
- package/build/dist/Utils/MetricUnitUtil.js.map +1 -1
- package/build/dist/Utils/Monitor/DeviceMacLearningUtil.js +112 -0
- package/build/dist/Utils/Monitor/DeviceMacLearningUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/MetricValueFormatter.js +276 -0
- package/build/dist/Utils/Monitor/MetricValueFormatter.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitorTemplateCustomFieldUtil.js +101 -0
- package/build/dist/Utils/Monitor/MonitorTemplateCustomFieldUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js +7 -2
- package/build/dist/Utils/Monitor/NetworkDeviceMonitorTemplateUtil.js.map +1 -1
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +484 -0
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/NetworkAutomation/AutoImportRunChain.js +59 -0
- package/build/dist/Utils/NetworkAutomation/AutoImportRunChain.js.map +1 -0
- package/jest.config.json +2 -0
- package/package.json +1 -1
- package/test-setup.sh +9 -9
- package/tsconfig.json +51 -11
- package/Tests/App/Dashboard/NotificationEmailPreferences.test.tsx +0 -399
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MonitorTemplateService.js","sourceRoot":"","sources":["../../../../Server/Services/MonitorTemplateService.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,+BAA+B,MAAM,mCAAmC,CAAC;AAChF,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,kCAAkC,MAAM,sCAAsC,CAAC;AAOtF,OAAO,4BAA4B,MAAM,+CAA+C,CAAC;AAEzF,OAAO,gBAAgB,MAAM,wCAAwC,CAAC;AACtE,OAAO,QAAQ,MAAM,mCAAmC,CAAC;AACzD,OAAO,SAAS,MAAM,+BAA+B,CAAC;AAGtD,OAAO,WAAW,MAAM,iCAAiC,CAAC;AAG1D,OAAO,KAAK,MAAM,6CAA6C,CAAC;AAChE,OAAO,OAAO,MAAM,qCAAqC,CAAC;AAC1D,OAAO,WAAW,MAAM,gCAAgC,CAAC;AACzD,OAAO,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AAE,IAAI;aACjB;YACR,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;CACF;AAx1B0B;IADxB,WAAW,EAAE;;;;6CAUb;AAGwB;IADxB,WAAW,EAAE;;;;6CAoCb;AAyBwB;IADxB,WAAW,EAAE;;;;6CAiGb;AAkDY;IADZ,WAAW,EAAE;;;;kDAgBb;AAoGY;IADZ,WAAW,EAAE;;;;iDA2Qb;AA4CY;IADZ,WAAW,EAAE;;;;4CA0Gb;AASY;IADZ,WAAW,EAAE;;;;0CA4Db;AAQY;IADZ,WAAW,EAAE;;;;4CAgCb;AAEH,eAAe,IAAI,OAAO,EAAE,CAAC"}
|
|
@@ -18,7 +18,7 @@ import ObjectID from "../../Types/ObjectID";
|
|
|
18
18
|
import OneUptimeDate from "../../Types/Date";
|
|
19
19
|
import SortOrder from "../../Types/BaseDatabase/SortOrder";
|
|
20
20
|
import MonitorType from "../../Types/Monitor/MonitorType";
|
|
21
|
-
import { MAX_MATCHED_IP_SAMPLE, } from "../../Types/NetworkAutomation/RuleRunResult";
|
|
21
|
+
import { MAX_MATCHED_IP_SAMPLE, MAX_RUN_FAILURE_REASON_LENGTH, MAX_RUN_FAILURE_REASONS, } from "../../Types/NetworkAutomation/RuleRunResult";
|
|
22
22
|
import AutoImportRuleMatcher from "../../Utils/NetworkDiscovery/AutoImportRuleMatcher";
|
|
23
23
|
import { buildFallbackDeviceName, buildNetworkDeviceFromDiscoveredHost, } from "../../Utils/NetworkDiscovery/DiscoveredDeviceBuilder";
|
|
24
24
|
import { normalizeDiscoveredHosts } from "../../Utils/NetworkDiscovery/DiscoveredHostUtil";
|
|
@@ -101,6 +101,25 @@ export const MAX_DEVICES_PER_AUTO_IMPORT_RUN = 500;
|
|
|
101
101
|
export const MAX_MONITORS_PER_AUTO_IMPORT_RUN = 500;
|
|
102
102
|
// Scans one manual "Run Now" will read, oldest results last.
|
|
103
103
|
export const MAX_SCANS_PER_AUTO_IMPORT_RULE_RUN = 100;
|
|
104
|
+
/*
|
|
105
|
+
* How many monitor creates may fail IDENTICALLY, back to back with no success
|
|
106
|
+
* between them, before the run stops attempting any more.
|
|
107
|
+
*
|
|
108
|
+
* A monitor create fails for one of two kinds of reason. Per host — this
|
|
109
|
+
* device's name collides, this one raced another writer — where the next host
|
|
110
|
+
* is unaffected and trying it is right. Or systemic: the template's criteria
|
|
111
|
+
* name a monitor status that no longer exists, the plan's monitor limit is
|
|
112
|
+
* reached, the database is refusing writes. Those fail for the FIRST device
|
|
113
|
+
* and for all 500 after it, and the old engine could not tell the difference:
|
|
114
|
+
* it spent the whole per-run monitor budget re-proving one broken thing, then
|
|
115
|
+
* reported "Stopped at the run cap — run again to continue", which is an
|
|
116
|
+
* instruction to do it all again. That is OneUptime/oneuptime#3643.
|
|
117
|
+
*
|
|
118
|
+
* Ten consecutive failures carrying the SAME message, with no create
|
|
119
|
+
* succeeding in between, is not a run of bad luck. Any success resets it, so a
|
|
120
|
+
* genuinely per-host fault never trips this.
|
|
121
|
+
*/
|
|
122
|
+
export const MAX_CONSECUTIVE_MONITOR_CREATE_FAILURES = 10;
|
|
104
123
|
/*
|
|
105
124
|
* Results older than this are stamped processed WITHOUT importing. A late
|
|
106
125
|
* result can land on a reaper-Failed scan hours after its sweep ran (the
|
|
@@ -172,6 +191,11 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
172
191
|
scannedHostCount: true, respondedHostCount: true, autoImportProcessedAt: true, discoveredDevices: true }, AUTO_IMPORT_SCAN_CREDENTIAL_SELECT),
|
|
173
192
|
props: {
|
|
174
193
|
isRoot: true,
|
|
194
|
+
/*
|
|
195
|
+
* Keep the stored payload for stampScan; the engine checks live
|
|
196
|
+
* inventory itself before evaluating these hosts.
|
|
197
|
+
*/
|
|
198
|
+
ignoreHooks: true,
|
|
175
199
|
},
|
|
176
200
|
});
|
|
177
201
|
/*
|
|
@@ -428,7 +452,8 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
428
452
|
if (result.hasMoreScans) {
|
|
429
453
|
scanStubs.pop();
|
|
430
454
|
}
|
|
431
|
-
for (
|
|
455
|
+
for (let index = 0; index < scanStubs.length; index++) {
|
|
456
|
+
const scanStub = scanStubs[index];
|
|
432
457
|
const scan = await NetworkDeviceDiscoveryScanService.findOneBy({
|
|
433
458
|
query: {
|
|
434
459
|
_id: scanStub.id,
|
|
@@ -438,7 +463,8 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
438
463
|
select: Object.assign({ _id: true, projectId: true, status: true, completedAt: true,
|
|
439
464
|
// The version token stampScan's compare-and-set uses; see there.
|
|
440
465
|
scannedHostCount: true, respondedHostCount: true, discoveredDevices: true }, AUTO_IMPORT_SCAN_CREDENTIAL_SELECT),
|
|
441
|
-
|
|
466
|
+
// Preserve the raw scan rows for the compare-and-set write-back.
|
|
467
|
+
props: { isRoot: true, ignoreHooks: true },
|
|
442
468
|
});
|
|
443
469
|
// Re-queued or deleted since the stub query — nothing to evaluate.
|
|
444
470
|
if (!scan) {
|
|
@@ -468,8 +494,15 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
468
494
|
leaveMarkerUnstamped: true,
|
|
469
495
|
});
|
|
470
496
|
}
|
|
471
|
-
|
|
497
|
+
/*
|
|
498
|
+
* The caps are shared across the whole run, dry or real. Stop OPENING
|
|
499
|
+
* further scans once they are spent — each one is a multi-megabyte
|
|
500
|
+
* jsonb read whose hosts this pass could not act on anyway — but say
|
|
501
|
+
* that scans were left unread, so the pending counters below are
|
|
502
|
+
* reported as a floor rather than as the estate's total.
|
|
503
|
+
*/
|
|
472
504
|
if (result.isTruncated) {
|
|
505
|
+
result.hasUnevaluatedScans = index < scanStubs.length - 1;
|
|
473
506
|
break;
|
|
474
507
|
}
|
|
475
508
|
/*
|
|
@@ -503,17 +536,60 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
503
536
|
monitorsSkippedAlreadyExisting: 0,
|
|
504
537
|
monitorsSkippedUnsupportedHost: 0,
|
|
505
538
|
monitorsFailed: 0,
|
|
539
|
+
deviceFailureReasons: [],
|
|
540
|
+
monitorFailureReasons: [],
|
|
541
|
+
monitorProvisioningHalted: false,
|
|
506
542
|
isTruncated: false,
|
|
543
|
+
hostsPendingImport: 0,
|
|
544
|
+
monitorsPendingCreation: 0,
|
|
545
|
+
hasUnevaluatedScans: false,
|
|
507
546
|
hasMoreScans: false,
|
|
508
547
|
isDryRun: isDryRun,
|
|
509
548
|
matchedIpAddressSample: [],
|
|
510
549
|
};
|
|
511
550
|
}
|
|
551
|
+
/*
|
|
552
|
+
* Keep the reason a create failed, so the run can say WHY it created
|
|
553
|
+
* nothing instead of pointing at server logs the operator of a self-hosted
|
|
554
|
+
* install may not be able to read. Deduplicated (500 identical failures are
|
|
555
|
+
* one reason) and capped, in both count and length, because this string
|
|
556
|
+
* ends up in a modal.
|
|
557
|
+
*/
|
|
558
|
+
recordFailureReason(reasons, error) {
|
|
559
|
+
const message = this.describeError(error);
|
|
560
|
+
if (!message) {
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
const trimmed = message.substring(0, MAX_RUN_FAILURE_REASON_LENGTH);
|
|
564
|
+
if (reasons.includes(trimmed)) {
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
if (reasons.length >= MAX_RUN_FAILURE_REASONS) {
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
reasons.push(trimmed);
|
|
571
|
+
}
|
|
572
|
+
/*
|
|
573
|
+
* The message an operator should see. Exception extends Error, so one arm
|
|
574
|
+
* covers both; anything else is stringified rather than dropped, because a
|
|
575
|
+
* thrown non-Error is exactly the case where the reason matters most.
|
|
576
|
+
*/
|
|
577
|
+
describeError(error) {
|
|
578
|
+
if (error instanceof Error) {
|
|
579
|
+
return (error.message || "").replace(/\s+/g, " ").trim();
|
|
580
|
+
}
|
|
581
|
+
return String(error).replace(/\s+/g, " ").trim();
|
|
582
|
+
}
|
|
512
583
|
emptyExistingMonitorProvisioningState() {
|
|
513
584
|
return {
|
|
514
585
|
autoProvisionedKeys: new Set(),
|
|
515
586
|
manuallyMonitoredDeviceIds: new Set(),
|
|
516
587
|
attemptedProvisioningKeys: new Set(),
|
|
588
|
+
unresolvableTemplateIds: new Set(),
|
|
589
|
+
consecutiveCreateFailures: 0,
|
|
590
|
+
lastCreateFailureReason: "",
|
|
591
|
+
hasProvisionedAnyMonitor: false,
|
|
592
|
+
isProvisioningHalted: false,
|
|
517
593
|
};
|
|
518
594
|
}
|
|
519
595
|
/*
|
|
@@ -825,6 +901,17 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
825
901
|
into: data.existingDevices,
|
|
826
902
|
});
|
|
827
903
|
const createdIpAddresses = [];
|
|
904
|
+
/*
|
|
905
|
+
* What this pass counted as still-to-do, deduplicated.
|
|
906
|
+
*
|
|
907
|
+
* A stored result can list the same address twice (duplicate rows are
|
|
908
|
+
* normal enough that normalisation preserves them and the import path
|
|
909
|
+
* treats the second as already-registered), so counting rows rather than
|
|
910
|
+
* distinct work would report a remainder larger than the work that
|
|
911
|
+
* actually remains — in a number whose whole purpose is to be trusted.
|
|
912
|
+
*/
|
|
913
|
+
const pendingImportAddresses = new Set();
|
|
914
|
+
const pendingProvisioningKeys = new Set();
|
|
828
915
|
for (const host of hosts) {
|
|
829
916
|
/*
|
|
830
917
|
* The address becomes the device's varchar(100) hostname, on which
|
|
@@ -878,21 +965,13 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
878
965
|
let networkDevice = data.existingDevices.get(host.ipAddress);
|
|
879
966
|
let deviceWasCreated = false;
|
|
880
967
|
/*
|
|
881
|
-
*
|
|
882
|
-
*
|
|
883
|
-
*
|
|
884
|
-
* duplicate rows and overlapping scans
|
|
968
|
+
* Current inventory is authoritative. The stored isAlreadyRegistered
|
|
969
|
+
* flag can outlive a deleted device and must not veto re-importing it.
|
|
970
|
+
* The map also includes devices created during this run, keeping
|
|
971
|
+
* duplicate rows and overlapping scans idempotent.
|
|
885
972
|
*/
|
|
886
|
-
if (
|
|
973
|
+
if (networkDevice) {
|
|
887
974
|
result.hostsSkippedAlreadyRegistered++;
|
|
888
|
-
/*
|
|
889
|
-
* A stale scan can claim a deleted device is still registered. With
|
|
890
|
-
* no live row there is neither a safe binding nor enough intent to
|
|
891
|
-
* recreate it from old data, so preserve the established skip.
|
|
892
|
-
*/
|
|
893
|
-
if (!networkDevice) {
|
|
894
|
-
continue;
|
|
895
|
-
}
|
|
896
975
|
}
|
|
897
976
|
if (result.matchedIpAddressSample.length < MAX_MATCHED_IP_SAMPLE) {
|
|
898
977
|
if (!result.matchedIpAddressSample.includes(host.ipAddress)) {
|
|
@@ -901,8 +980,23 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
901
980
|
}
|
|
902
981
|
if (!networkDevice) {
|
|
903
982
|
if (data.attempts.deviceCount >= MAX_DEVICES_PER_AUTO_IMPORT_RUN) {
|
|
983
|
+
/*
|
|
984
|
+
* Budget spent — stop WRITING, keep COUNTING. The rest of this
|
|
985
|
+
* loop is pure matching over a jsonb array that is already in
|
|
986
|
+
* memory against addresses primeExistingDevices already resolved,
|
|
987
|
+
* so finishing the scan costs nothing the cap exists to prevent,
|
|
988
|
+
* and it is the difference between "imported 500" and "imported
|
|
989
|
+
* 500 of 909, 409 still to go". A run that stopped mid-count
|
|
990
|
+
* reported the truncated numbers as if they were the estate,
|
|
991
|
+
* which is what OneUptime issue #3642 experienced as the
|
|
992
|
+
* remainder being silently dropped.
|
|
993
|
+
*/
|
|
904
994
|
result.isTruncated = true;
|
|
905
|
-
|
|
995
|
+
if (!pendingImportAddresses.has(host.ipAddress)) {
|
|
996
|
+
pendingImportAddresses.add(host.ipAddress);
|
|
997
|
+
result.hostsPendingImport++;
|
|
998
|
+
}
|
|
999
|
+
continue;
|
|
906
1000
|
}
|
|
907
1001
|
if (data.isDryRun) {
|
|
908
1002
|
/*
|
|
@@ -935,7 +1029,7 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
935
1029
|
if (templateIds.length === 0) {
|
|
936
1030
|
continue;
|
|
937
1031
|
}
|
|
938
|
-
const
|
|
1032
|
+
const monitorsLeftPending = await this.ensureMonitorsForDevice({
|
|
939
1033
|
projectId: scan.projectId,
|
|
940
1034
|
host: host,
|
|
941
1035
|
networkDevice: networkDevice,
|
|
@@ -946,13 +1040,35 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
946
1040
|
attempts: data.attempts,
|
|
947
1041
|
isDryRun: data.isDryRun,
|
|
948
1042
|
});
|
|
949
|
-
|
|
1043
|
+
/*
|
|
1044
|
+
* Same protocol as the device cap above: the monitor budget stops the
|
|
1045
|
+
* creates, not the accounting. It also has its OWN cap, so an estate
|
|
1046
|
+
* that is fully imported but unmonitored — the shape of issue #3642 —
|
|
1047
|
+
* runs out of monitor budget with nothing pending on the device side,
|
|
1048
|
+
* and the operator needs to be told how many devices are still
|
|
1049
|
+
* waiting for a monitor.
|
|
1050
|
+
*/
|
|
1051
|
+
for (const templateId of monitorsLeftPending) {
|
|
950
1052
|
result.isTruncated = true;
|
|
951
|
-
|
|
1053
|
+
const pendingKey = NetworkDeviceAutoImportRuleEngineServiceClass.monitorProvisioningKey(networkDevice.id, templateId);
|
|
1054
|
+
if (!pendingProvisioningKeys.has(pendingKey)) {
|
|
1055
|
+
pendingProvisioningKeys.add(pendingKey);
|
|
1056
|
+
result.monitorsPendingCreation++;
|
|
1057
|
+
}
|
|
952
1058
|
}
|
|
953
1059
|
}
|
|
954
1060
|
return createdIpAddresses;
|
|
955
1061
|
}
|
|
1062
|
+
/*
|
|
1063
|
+
* Reconcile one device against the templates the matched rules selected.
|
|
1064
|
+
*
|
|
1065
|
+
* Returns the template ids the run's budget left UNATTEMPTED — empty when
|
|
1066
|
+
* every requested monitor was settled, whether created, failed, or skipped
|
|
1067
|
+
* because monitoring already existed. A non-empty answer is what makes the
|
|
1068
|
+
* run report itself truncated; the ids (rather than a bare count) are what
|
|
1069
|
+
* let the caller count one device's leftover work once, however many
|
|
1070
|
+
* duplicate rows the scan lists that host under.
|
|
1071
|
+
*/
|
|
956
1072
|
async ensureMonitorsForDevice(data) {
|
|
957
1073
|
/*
|
|
958
1074
|
* A Network Device monitor is fed by the device's polls, and nothing
|
|
@@ -966,12 +1082,12 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
966
1082
|
*/
|
|
967
1083
|
if (NetworkDeviceMonitoringMethodUtil.isMonitorBacked(data.networkDevice.monitoringMethod)) {
|
|
968
1084
|
data.result.monitorsSkippedUnsupportedHost += data.templateIds.length;
|
|
969
|
-
return
|
|
1085
|
+
return [];
|
|
970
1086
|
}
|
|
971
1087
|
if (!data.networkDevice.id) {
|
|
972
1088
|
data.result.monitorsFailed += data.templateIds.length;
|
|
973
1089
|
logger.error(`Auto-import: cannot provision monitor(s) for ${data.host.ipAddress} because the Network Device has no id.`, { projectId: data.projectId.toString() });
|
|
974
|
-
return
|
|
1090
|
+
return [];
|
|
975
1091
|
}
|
|
976
1092
|
const networkDeviceId = data.networkDevice.id;
|
|
977
1093
|
const networkDeviceIdString = networkDeviceId.toString();
|
|
@@ -994,19 +1110,59 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
994
1110
|
pendingTemplateIds.push(templateId);
|
|
995
1111
|
}
|
|
996
1112
|
if (pendingTemplateIds.length === 0) {
|
|
997
|
-
return
|
|
1113
|
+
return [];
|
|
998
1114
|
}
|
|
1115
|
+
/*
|
|
1116
|
+
* The project-wide snapshot already knows this device is monitored by
|
|
1117
|
+
* hand, and that answer outranks any failure below: a device nobody was
|
|
1118
|
+
* going to provision cannot be a monitor this run failed to create. Read
|
|
1119
|
+
* from memory, so it stays ahead of the systemic verdicts.
|
|
1120
|
+
*/
|
|
999
1121
|
if (data.existingMonitors.manuallyMonitoredDeviceIds.has(networkDeviceIdString)) {
|
|
1000
1122
|
data.result.monitorsSkippedAlreadyExisting += pendingTemplateIds.length;
|
|
1001
|
-
return
|
|
1123
|
+
return [];
|
|
1124
|
+
}
|
|
1125
|
+
/*
|
|
1126
|
+
* Everything below here costs the run something — a monitor budget slot, a
|
|
1127
|
+
* per-device search of the unindexed monitor step payload, a create round
|
|
1128
|
+
* trip. None of it is worth spending on work this run has already proved
|
|
1129
|
+
* cannot succeed, so the two systemic verdicts are settled next: a
|
|
1130
|
+
* template this run could not load, and a create pipeline that has failed
|
|
1131
|
+
* identically for every device it tried.
|
|
1132
|
+
*
|
|
1133
|
+
* Both still COUNT the monitors that are missing. "0 created, and here is
|
|
1134
|
+
* why" is the answer; quietly reporting fewer missing monitors than there
|
|
1135
|
+
* are would trade one confusing dialog for another.
|
|
1136
|
+
*/
|
|
1137
|
+
const resolvableTemplateIds = [];
|
|
1138
|
+
for (const templateId of pendingTemplateIds) {
|
|
1139
|
+
if (!data.existingMonitors.isProvisioningHalted &&
|
|
1140
|
+
!data.existingMonitors.unresolvableTemplateIds.has(templateId)) {
|
|
1141
|
+
resolvableTemplateIds.push(templateId);
|
|
1142
|
+
continue;
|
|
1143
|
+
}
|
|
1144
|
+
/*
|
|
1145
|
+
* Counted once and then settled. Marking the (device, template) key
|
|
1146
|
+
* attempted is what keeps a host carried by two overlapping scans in the
|
|
1147
|
+
* same run from being counted as two missing monitors — the same
|
|
1148
|
+
* bookkeeping a real attempt does, for the same reason.
|
|
1149
|
+
*/
|
|
1150
|
+
data.existingMonitors.attemptedProvisioningKeys.add(NetworkDeviceAutoImportRuleEngineServiceClass.monitorProvisioningKey(networkDeviceId, templateId));
|
|
1151
|
+
data.result.monitorsFailed++;
|
|
1152
|
+
data.result.monitorProvisioningHalted = true;
|
|
1153
|
+
}
|
|
1154
|
+
if (resolvableTemplateIds.length === 0) {
|
|
1155
|
+
return [];
|
|
1002
1156
|
}
|
|
1003
1157
|
/*
|
|
1004
1158
|
* Do not run the unindexed JSON race-check after this run's monitor-work
|
|
1005
1159
|
* budget is already exhausted. The device remains unreconciled and the
|
|
1006
|
-
* truncated marker protocol brings it back on the next bounded pass
|
|
1160
|
+
* truncated marker protocol brings it back on the next bounded pass —
|
|
1161
|
+
* counted, so the operator is told how many devices are still waiting
|
|
1162
|
+
* rather than left to infer it from a total that stopped early.
|
|
1007
1163
|
*/
|
|
1008
1164
|
if (data.attempts.monitorCount >= MAX_MONITORS_PER_AUTO_IMPORT_RUN) {
|
|
1009
|
-
return
|
|
1165
|
+
return resolvableTemplateIds;
|
|
1010
1166
|
}
|
|
1011
1167
|
if (!data.isDryRun) {
|
|
1012
1168
|
await this.refreshExistingMonitorsForDevice({
|
|
@@ -1016,31 +1172,56 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
1016
1172
|
});
|
|
1017
1173
|
}
|
|
1018
1174
|
if (data.existingMonitors.manuallyMonitoredDeviceIds.has(networkDeviceIdString)) {
|
|
1019
|
-
data.result.monitorsSkippedAlreadyExisting +=
|
|
1020
|
-
|
|
1175
|
+
data.result.monitorsSkippedAlreadyExisting +=
|
|
1176
|
+
resolvableTemplateIds.length;
|
|
1177
|
+
return [];
|
|
1021
1178
|
}
|
|
1022
|
-
for (
|
|
1179
|
+
for (let index = 0; index < resolvableTemplateIds.length; index++) {
|
|
1180
|
+
const templateId = resolvableTemplateIds[index];
|
|
1023
1181
|
const key = NetworkDeviceAutoImportRuleEngineServiceClass.monitorProvisioningKey(networkDeviceId, templateId);
|
|
1182
|
+
/*
|
|
1183
|
+
* A create earlier in THIS device's loop can be the one that trips the
|
|
1184
|
+
* systemic verdict. The rest of its templates are then in exactly the
|
|
1185
|
+
* position of every device after it.
|
|
1186
|
+
*/
|
|
1187
|
+
if (data.existingMonitors.isProvisioningHalted) {
|
|
1188
|
+
data.existingMonitors.attemptedProvisioningKeys.add(key);
|
|
1189
|
+
data.result.monitorsFailed++;
|
|
1190
|
+
data.result.monitorProvisioningHalted = true;
|
|
1191
|
+
continue;
|
|
1192
|
+
}
|
|
1024
1193
|
/* The race-check may have found this key after the initial snapshot. */
|
|
1025
1194
|
if (data.existingMonitors.autoProvisionedKeys.has(key)) {
|
|
1026
1195
|
data.result.monitorsSkippedAlreadyExisting++;
|
|
1027
1196
|
continue;
|
|
1028
1197
|
}
|
|
1198
|
+
/*
|
|
1199
|
+
* Budget spent mid-device. Everything from here on is untouched, so
|
|
1200
|
+
* that is exactly what is left pending for this device.
|
|
1201
|
+
*/
|
|
1029
1202
|
if (data.attempts.monitorCount >= MAX_MONITORS_PER_AUTO_IMPORT_RUN) {
|
|
1030
|
-
return
|
|
1203
|
+
return resolvableTemplateIds.slice(index);
|
|
1031
1204
|
}
|
|
1032
1205
|
data.attempts.monitorCount++;
|
|
1033
1206
|
data.existingMonitors.attemptedProvisioningKeys.add(key);
|
|
1034
1207
|
/*
|
|
1035
|
-
*
|
|
1036
|
-
*
|
|
1037
|
-
*
|
|
1038
|
-
*
|
|
1208
|
+
* A template the run could not load is a fault in the RULE, not in this
|
|
1209
|
+
* host: the rule points at a template that has been deleted, moved to
|
|
1210
|
+
* another project, or changed to a different monitor type since the rule
|
|
1211
|
+
* was saved (the rule form validates all three, but only at save time).
|
|
1212
|
+
* It will be just as unloadable for every other device, so the verdict is
|
|
1213
|
+
* recorded once and every later host short-circuits above — instead of
|
|
1214
|
+
* spending the run's whole monitor budget re-proving it, which is what
|
|
1215
|
+
* turned this into "500 monitors failed, stopped at the run cap, run
|
|
1216
|
+
* again to continue" in issue #3643.
|
|
1039
1217
|
*/
|
|
1040
1218
|
const template = data.monitorTemplates.get(templateId);
|
|
1041
1219
|
if (!template) {
|
|
1220
|
+
data.existingMonitors.unresolvableTemplateIds.add(templateId);
|
|
1042
1221
|
data.result.monitorsFailed++;
|
|
1043
|
-
|
|
1222
|
+
data.result.monitorProvisioningHalted = true;
|
|
1223
|
+
this.recordFailureReason(data.result.monitorFailureReasons, new Error("This rule's Monitor Template could not be loaded. It may have been deleted, moved to another project, or changed to a monitor type other than Network Device. Edit the rule and select a Network Device Monitor Template."));
|
|
1224
|
+
logger.error(`Auto-import: Network Device monitor template ${templateId} is missing, deleted, or not valid for project ${data.projectId.toString()}. No monitors will be provisioned from it for the rest of this run.`, { projectId: data.projectId.toString() });
|
|
1044
1225
|
continue;
|
|
1045
1226
|
}
|
|
1046
1227
|
if (data.isDryRun) {
|
|
@@ -1062,6 +1243,7 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
1062
1243
|
});
|
|
1063
1244
|
data.existingMonitors.autoProvisionedKeys.add(key);
|
|
1064
1245
|
data.result.monitorsCreated++;
|
|
1246
|
+
this.recordMonitorCreateSuccess(data.existingMonitors);
|
|
1065
1247
|
}
|
|
1066
1248
|
catch (error) {
|
|
1067
1249
|
/*
|
|
@@ -1090,14 +1272,64 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
1090
1272
|
this.recordExistingMonitor(data.existingMonitors, createdMeanwhile);
|
|
1091
1273
|
if (data.existingMonitors.autoProvisionedKeys.has(key)) {
|
|
1092
1274
|
data.result.monitorsSkippedAlreadyExisting++;
|
|
1275
|
+
/*
|
|
1276
|
+
* Losing this race proves the create pipeline works — somebody
|
|
1277
|
+
* else just used it — so it is not evidence of a systemic fault.
|
|
1278
|
+
*/
|
|
1279
|
+
this.recordMonitorCreateSuccess(data.existingMonitors);
|
|
1093
1280
|
continue;
|
|
1094
1281
|
}
|
|
1095
1282
|
}
|
|
1096
1283
|
data.result.monitorsFailed++;
|
|
1284
|
+
this.recordFailureReason(data.result.monitorFailureReasons, error);
|
|
1097
1285
|
logger.error(`Auto-import: could not create monitor from template ${templateId} for Network Device ${networkDeviceId.toString()} (${data.host.ipAddress}): ${error}`, { projectId: data.projectId.toString() });
|
|
1286
|
+
this.recordMonitorCreateFailure({
|
|
1287
|
+
state: data.existingMonitors,
|
|
1288
|
+
result: data.result,
|
|
1289
|
+
projectId: data.projectId,
|
|
1290
|
+
error: error,
|
|
1291
|
+
});
|
|
1098
1292
|
}
|
|
1099
1293
|
}
|
|
1100
|
-
return
|
|
1294
|
+
return [];
|
|
1295
|
+
}
|
|
1296
|
+
/*
|
|
1297
|
+
* A create succeeded (or lost a race to another writer, which proves the
|
|
1298
|
+
* same thing): whatever the last failures were, they were not systemic, and
|
|
1299
|
+
* this run has now seen the create pipeline work at least once.
|
|
1300
|
+
*/
|
|
1301
|
+
recordMonitorCreateSuccess(state) {
|
|
1302
|
+
state.consecutiveCreateFailures = 0;
|
|
1303
|
+
state.lastCreateFailureReason = "";
|
|
1304
|
+
state.hasProvisionedAnyMonitor = true;
|
|
1305
|
+
}
|
|
1306
|
+
/*
|
|
1307
|
+
* Decide whether one monitor create failure is this host's problem or the
|
|
1308
|
+
* whole run's. The bar is deliberately high, because giving up early on a
|
|
1309
|
+
* per-host fault would silently cost an estate its monitors — the failure
|
|
1310
|
+
* this fix exists to make visible. All three must hold: the run has never
|
|
1311
|
+
* created a monitor, the last MAX_CONSECUTIVE_MONITOR_CREATE_FAILURES
|
|
1312
|
+
* attempts all failed, and they all failed with the SAME message.
|
|
1313
|
+
*/
|
|
1314
|
+
recordMonitorCreateFailure(data) {
|
|
1315
|
+
const reason = this.describeError(data.error);
|
|
1316
|
+
if (reason && reason === data.state.lastCreateFailureReason) {
|
|
1317
|
+
data.state.consecutiveCreateFailures++;
|
|
1318
|
+
}
|
|
1319
|
+
else {
|
|
1320
|
+
data.state.lastCreateFailureReason = reason;
|
|
1321
|
+
data.state.consecutiveCreateFailures = 1;
|
|
1322
|
+
}
|
|
1323
|
+
if (data.state.hasProvisionedAnyMonitor) {
|
|
1324
|
+
return;
|
|
1325
|
+
}
|
|
1326
|
+
if (data.state.consecutiveCreateFailures <
|
|
1327
|
+
MAX_CONSECUTIVE_MONITOR_CREATE_FAILURES) {
|
|
1328
|
+
return;
|
|
1329
|
+
}
|
|
1330
|
+
data.state.isProvisioningHalted = true;
|
|
1331
|
+
data.result.monitorProvisioningHalted = true;
|
|
1332
|
+
logger.error(`Auto-import: ${MAX_CONSECUTIVE_MONITOR_CREATE_FAILURES} Network Device monitor creates failed identically for project ${data.projectId.toString()} with none succeeding ("${reason}"). Treating this as a systemic failure and provisioning no further monitors this run.`, { projectId: data.projectId.toString() });
|
|
1101
1333
|
}
|
|
1102
1334
|
/*
|
|
1103
1335
|
* One host -> one device, with the collision protocol the estate needs:
|
|
@@ -1160,6 +1392,7 @@ class NetworkDeviceAutoImportRuleEngineServiceClass {
|
|
|
1160
1392
|
}
|
|
1161
1393
|
catch (secondError) {
|
|
1162
1394
|
data.result.devicesFailed++;
|
|
1395
|
+
this.recordFailureReason(data.result.deviceFailureReasons, secondError);
|
|
1163
1396
|
logger.error(`Auto-import: could not create a device for ${data.host.ipAddress} (scan ${(_a = data.scan.id) === null || _a === void 0 ? void 0 : _a.toString()}): ${firstError} / retry: ${secondError}`, { projectId: data.projectId.toString() });
|
|
1164
1397
|
return { device: null, wasCreated: false };
|
|
1165
1398
|
}
|