@oneuptime/common 11.0.0 → 11.0.2

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.
Files changed (357) hide show
  1. package/Models/DatabaseModels/Alert.ts +110 -0
  2. package/Models/DatabaseModels/CephCluster.ts +964 -0
  3. package/Models/DatabaseModels/CephClusterLabelRule.ts +514 -0
  4. package/Models/DatabaseModels/CephClusterOwnerRule.ts +596 -0
  5. package/Models/DatabaseModels/CephClusterOwnerTeam.ts +487 -0
  6. package/Models/DatabaseModels/CephClusterOwnerUser.ts +486 -0
  7. package/Models/DatabaseModels/CephResource.ts +809 -0
  8. package/Models/DatabaseModels/Host.ts +64 -0
  9. package/Models/DatabaseModels/Incident.ts +110 -0
  10. package/Models/DatabaseModels/Index.ts +24 -0
  11. package/Models/DatabaseModels/ProxmoxCluster.ts +943 -0
  12. package/Models/DatabaseModels/ProxmoxClusterLabelRule.ts +514 -0
  13. package/Models/DatabaseModels/ProxmoxClusterOwnerRule.ts +596 -0
  14. package/Models/DatabaseModels/ProxmoxClusterOwnerTeam.ts +487 -0
  15. package/Models/DatabaseModels/ProxmoxClusterOwnerUser.ts +486 -0
  16. package/Models/DatabaseModels/ProxmoxResource.ts +726 -0
  17. package/Models/DatabaseModels/ScheduledMaintenance.ts +110 -0
  18. package/Server/API/BillingInvoiceAPI.ts +47 -7
  19. package/Server/API/CephResourceAPI.ts +134 -0
  20. package/Server/API/DashboardAPI.ts +46 -0
  21. package/Server/API/ProjectAPI.ts +15 -0
  22. package/Server/API/ProxmoxResourceAPI.ts +132 -0
  23. package/Server/API/ResellerPlanAPI.ts +17 -0
  24. package/Server/Infrastructure/GlobalCache.ts +8 -2
  25. package/Server/Infrastructure/Postgres/SchemaMigrations/1781500000000-AddProxmoxAndCephClusterTables.ts +163 -0
  26. package/Server/Infrastructure/Postgres/SchemaMigrations/1781600000000-AddProxmoxCephV2Columns.ts +211 -0
  27. package/Server/Infrastructure/Postgres/SchemaMigrations/1781600000001-AddProxmoxCephActivityAndRules.ts +590 -0
  28. package/Server/Infrastructure/Postgres/SchemaMigrations/1781700000000-AddProxmoxCephV3Columns.ts +64 -0
  29. package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
  30. package/Server/Infrastructure/Redis.ts +40 -12
  31. package/Server/Services/AnalyticsDatabaseService.ts +1 -1
  32. package/Server/Services/BillingService.ts +109 -21
  33. package/Server/Services/CephClusterLabelRuleEngineService.ts +200 -0
  34. package/Server/Services/CephClusterLabelRuleService.ts +14 -0
  35. package/Server/Services/CephClusterOwnerRuleEngineService.ts +218 -0
  36. package/Server/Services/CephClusterOwnerRuleService.ts +14 -0
  37. package/Server/Services/CephClusterOwnerTeamService.ts +10 -0
  38. package/Server/Services/CephClusterOwnerUserService.ts +10 -0
  39. package/Server/Services/CephClusterService.ts +401 -0
  40. package/Server/Services/CephResourceService.ts +383 -0
  41. package/Server/Services/CloudResourceService.ts +11 -3
  42. package/Server/Services/DockerHostService.ts +11 -3
  43. package/Server/Services/ExceptionAggregationService.ts +2 -0
  44. package/Server/Services/HostService.ts +11 -3
  45. package/Server/Services/Index.ts +24 -0
  46. package/Server/Services/KubernetesClusterService.ts +11 -3
  47. package/Server/Services/LogAggregationService.ts +2 -0
  48. package/Server/Services/MetricAggregationService.ts +2 -0
  49. package/Server/Services/OpenTelemetryIngestService.ts +36 -0
  50. package/Server/Services/ProxmoxClusterLabelRuleEngineService.ts +204 -0
  51. package/Server/Services/ProxmoxClusterLabelRuleService.ts +14 -0
  52. package/Server/Services/ProxmoxClusterOwnerRuleEngineService.ts +222 -0
  53. package/Server/Services/ProxmoxClusterOwnerRuleService.ts +14 -0
  54. package/Server/Services/ProxmoxClusterOwnerTeamService.ts +10 -0
  55. package/Server/Services/ProxmoxClusterOwnerUserService.ts +10 -0
  56. package/Server/Services/ProxmoxClusterService.ts +382 -0
  57. package/Server/Services/ProxmoxResourceService.ts +404 -0
  58. package/Server/Services/RumApplicationService.ts +11 -3
  59. package/Server/Services/ServerlessFunctionService.ts +11 -3
  60. package/Server/Services/TelemetryUsageBillingService.ts +41 -3
  61. package/Server/Services/TraceAggregationService.ts +2 -0
  62. package/Server/Types/AnalyticsDatabase/AggregateBy.ts +8 -23
  63. package/Server/Utils/Monitor/MonitorAlert.ts +45 -0
  64. package/Server/Utils/Monitor/MonitorClusterContext.ts +129 -0
  65. package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +344 -4
  66. package/Server/Utils/Monitor/MonitorIncident.ts +130 -7
  67. package/Server/Utils/Monitor/MonitorMaintenanceSuppression.ts +39 -6
  68. package/Server/Utils/Monitor/MonitorTemplateUtil.ts +3 -1
  69. package/Server/Utils/Monitor/SeriesResourceLabels.ts +33 -0
  70. package/Server/Utils/Profiling.ts +37 -2
  71. package/Server/Utils/Telemetry/EntityRegistry.ts +4 -0
  72. package/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.ts +1096 -0
  73. package/Server/Utils/Telemetry/TelemetryEntity.ts +85 -0
  74. package/Server/Utils/Telemetry.ts +8 -19
  75. package/Tests/Server/API/BillingInvoiceAPI.test.ts +194 -0
  76. package/Tests/Server/API/ProjectAPI.test.ts +91 -0
  77. package/Tests/Server/API/ResellerPlanAPI.test.ts +207 -0
  78. package/Tests/Server/Infrastructure/GlobalCache.test.ts +100 -0
  79. package/Tests/Server/Services/BillingService.test.ts +323 -0
  80. package/Tests/Server/Services/CephResourceService.test.ts +264 -0
  81. package/Tests/Server/Services/ProxmoxResourceService.test.ts +326 -0
  82. package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluator.test.ts +322 -0
  83. package/Tests/Server/Utils/Monitor/MonitorMaintenanceSuppression.test.ts +13 -0
  84. package/Tests/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.test.ts +879 -0
  85. package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +196 -0
  86. package/Tests/Types/Monitor/CephAlertTemplates.test.ts +1231 -0
  87. package/Tests/Types/Monitor/ProxmoxAlertTemplates.test.ts +732 -0
  88. package/Tests/Utils/ModelImportExport.test.ts +366 -0
  89. package/Tests/Utils/Telemetry/EntityRelationship.test.ts +49 -0
  90. package/Tests/Utils/Telemetry/HeartbeatAvailability.test.ts +423 -0
  91. package/Types/BaseDatabase/AggregationIntervalUtil.ts +74 -0
  92. package/Types/Dashboard/DashboardComponentType.ts +4 -0
  93. package/Types/Dashboard/DashboardComponents/ComponentArgument.ts +2 -0
  94. package/Types/Dashboard/DashboardComponents/DashboardCephOsdListComponent.ts +15 -0
  95. package/Types/Dashboard/DashboardComponents/DashboardCephPoolListComponent.ts +14 -0
  96. package/Types/Dashboard/DashboardComponents/DashboardProxmoxGuestListComponent.ts +17 -0
  97. package/Types/Dashboard/DashboardComponents/DashboardProxmoxNodeListComponent.ts +16 -0
  98. package/Types/Dashboard/DashboardTemplates.ts +446 -0
  99. package/Types/Icon/IconProp.ts +2 -0
  100. package/Types/Monitor/CephAlertTemplates.ts +1647 -0
  101. package/Types/Monitor/CephMetricCatalog.ts +409 -0
  102. package/Types/Monitor/MetricMonitor/MetricMonitorResponse.ts +44 -0
  103. package/Types/Monitor/MonitorStep.ts +64 -0
  104. package/Types/Monitor/MonitorStepCephMonitor.ts +57 -0
  105. package/Types/Monitor/MonitorStepProxmoxMonitor.ts +81 -0
  106. package/Types/Monitor/MonitorType.ts +29 -1
  107. package/Types/Monitor/ProxmoxAlertTemplates.ts +899 -0
  108. package/Types/Monitor/ProxmoxMetricCatalog.ts +382 -0
  109. package/Types/Permission.ts +464 -0
  110. package/Types/Telemetry/EntityType.ts +11 -0
  111. package/Types/Telemetry/ServiceType.ts +2 -0
  112. package/UI/Components/Icon/Icon.tsx +84 -0
  113. package/UI/Components/ImportExport/ExportModelCard.tsx +90 -0
  114. package/UI/Components/ImportExport/ImportModelsModal.tsx +239 -0
  115. package/UI/Components/ModelTable/ModelTable.tsx +294 -143
  116. package/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.ts +9 -5
  117. package/UI/Utils/ModelImportExport.ts +207 -0
  118. package/UI/Utils/Telemetry/Telemetry.ts +16 -21
  119. package/UI/Utils/TelemetryService.ts +7 -3
  120. package/Utils/Dashboard/Components/DashboardCephOsdListComponent.ts +63 -0
  121. package/Utils/Dashboard/Components/DashboardCephPoolListComponent.ts +32 -0
  122. package/Utils/Dashboard/Components/DashboardCephResourceListShared.ts +61 -0
  123. package/Utils/Dashboard/Components/DashboardProxmoxGuestListComponent.ts +69 -0
  124. package/Utils/Dashboard/Components/DashboardProxmoxNodeListComponent.ts +55 -0
  125. package/Utils/Dashboard/Components/DashboardProxmoxResourceListShared.ts +61 -0
  126. package/Utils/Dashboard/Components/Index.ts +28 -0
  127. package/Utils/ModelImportExport.ts +369 -0
  128. package/Utils/Telemetry/EntityKey.ts +35 -0
  129. package/Utils/Telemetry/EntityRelationship.ts +6 -0
  130. package/Utils/Telemetry/HeartbeatAvailability.ts +262 -0
  131. package/build/dist/Models/DatabaseModels/Alert.js +108 -0
  132. package/build/dist/Models/DatabaseModels/Alert.js.map +1 -1
  133. package/build/dist/Models/DatabaseModels/CephCluster.js +992 -0
  134. package/build/dist/Models/DatabaseModels/CephCluster.js.map +1 -0
  135. package/build/dist/Models/DatabaseModels/CephClusterLabelRule.js +522 -0
  136. package/build/dist/Models/DatabaseModels/CephClusterLabelRule.js.map +1 -0
  137. package/build/dist/Models/DatabaseModels/CephClusterOwnerRule.js +603 -0
  138. package/build/dist/Models/DatabaseModels/CephClusterOwnerRule.js.map +1 -0
  139. package/build/dist/Models/DatabaseModels/CephClusterOwnerTeam.js +503 -0
  140. package/build/dist/Models/DatabaseModels/CephClusterOwnerTeam.js.map +1 -0
  141. package/build/dist/Models/DatabaseModels/CephClusterOwnerUser.js +502 -0
  142. package/build/dist/Models/DatabaseModels/CephClusterOwnerUser.js.map +1 -0
  143. package/build/dist/Models/DatabaseModels/CephResource.js +846 -0
  144. package/build/dist/Models/DatabaseModels/CephResource.js.map +1 -0
  145. package/build/dist/Models/DatabaseModels/Host.js +63 -0
  146. package/build/dist/Models/DatabaseModels/Host.js.map +1 -1
  147. package/build/dist/Models/DatabaseModels/Incident.js +108 -0
  148. package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
  149. package/build/dist/Models/DatabaseModels/Index.js +24 -0
  150. package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
  151. package/build/dist/Models/DatabaseModels/ProxmoxCluster.js +967 -0
  152. package/build/dist/Models/DatabaseModels/ProxmoxCluster.js.map +1 -0
  153. package/build/dist/Models/DatabaseModels/ProxmoxClusterLabelRule.js +522 -0
  154. package/build/dist/Models/DatabaseModels/ProxmoxClusterLabelRule.js.map +1 -0
  155. package/build/dist/Models/DatabaseModels/ProxmoxClusterOwnerRule.js +603 -0
  156. package/build/dist/Models/DatabaseModels/ProxmoxClusterOwnerRule.js.map +1 -0
  157. package/build/dist/Models/DatabaseModels/ProxmoxClusterOwnerTeam.js +503 -0
  158. package/build/dist/Models/DatabaseModels/ProxmoxClusterOwnerTeam.js.map +1 -0
  159. package/build/dist/Models/DatabaseModels/ProxmoxClusterOwnerUser.js +502 -0
  160. package/build/dist/Models/DatabaseModels/ProxmoxClusterOwnerUser.js.map +1 -0
  161. package/build/dist/Models/DatabaseModels/ProxmoxResource.js +761 -0
  162. package/build/dist/Models/DatabaseModels/ProxmoxResource.js.map +1 -0
  163. package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +108 -0
  164. package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
  165. package/build/dist/Server/API/BillingInvoiceAPI.js +35 -5
  166. package/build/dist/Server/API/BillingInvoiceAPI.js.map +1 -1
  167. package/build/dist/Server/API/CephResourceAPI.js +98 -0
  168. package/build/dist/Server/API/CephResourceAPI.js.map +1 -0
  169. package/build/dist/Server/API/DashboardAPI.js +46 -0
  170. package/build/dist/Server/API/DashboardAPI.js.map +1 -1
  171. package/build/dist/Server/API/ProjectAPI.js +11 -0
  172. package/build/dist/Server/API/ProjectAPI.js.map +1 -1
  173. package/build/dist/Server/API/ProxmoxResourceAPI.js +95 -0
  174. package/build/dist/Server/API/ProxmoxResourceAPI.js.map +1 -0
  175. package/build/dist/Server/API/ResellerPlanAPI.js +17 -3
  176. package/build/dist/Server/API/ResellerPlanAPI.js.map +1 -1
  177. package/build/dist/Server/Infrastructure/GlobalCache.js +7 -2
  178. package/build/dist/Server/Infrastructure/GlobalCache.js.map +1 -1
  179. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781500000000-AddProxmoxAndCephClusterTables.js +76 -0
  180. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781500000000-AddProxmoxAndCephClusterTables.js.map +1 -0
  181. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781600000000-AddProxmoxCephV2Columns.js +108 -0
  182. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781600000000-AddProxmoxCephV2Columns.js.map +1 -0
  183. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781600000001-AddProxmoxCephActivityAndRules.js +253 -0
  184. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781600000001-AddProxmoxCephActivityAndRules.js.map +1 -0
  185. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781700000000-AddProxmoxCephV3Columns.js +43 -0
  186. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1781700000000-AddProxmoxCephV3Columns.js.map +1 -0
  187. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
  188. package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
  189. package/build/dist/Server/Infrastructure/Redis.js +31 -8
  190. package/build/dist/Server/Infrastructure/Redis.js.map +1 -1
  191. package/build/dist/Server/Services/AnalyticsDatabaseService.js +1 -1
  192. package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
  193. package/build/dist/Server/Services/BillingService.js +85 -23
  194. package/build/dist/Server/Services/BillingService.js.map +1 -1
  195. package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js +166 -0
  196. package/build/dist/Server/Services/CephClusterLabelRuleEngineService.js.map +1 -0
  197. package/build/dist/Server/Services/CephClusterLabelRuleService.js +13 -0
  198. package/build/dist/Server/Services/CephClusterLabelRuleService.js.map +1 -0
  199. package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js +186 -0
  200. package/build/dist/Server/Services/CephClusterOwnerRuleEngineService.js.map +1 -0
  201. package/build/dist/Server/Services/CephClusterOwnerRuleService.js +13 -0
  202. package/build/dist/Server/Services/CephClusterOwnerRuleService.js.map +1 -0
  203. package/build/dist/Server/Services/CephClusterOwnerTeamService.js +9 -0
  204. package/build/dist/Server/Services/CephClusterOwnerTeamService.js.map +1 -0
  205. package/build/dist/Server/Services/CephClusterOwnerUserService.js +9 -0
  206. package/build/dist/Server/Services/CephClusterOwnerUserService.js.map +1 -0
  207. package/build/dist/Server/Services/CephClusterService.js +353 -0
  208. package/build/dist/Server/Services/CephClusterService.js.map +1 -0
  209. package/build/dist/Server/Services/CephResourceService.js +257 -0
  210. package/build/dist/Server/Services/CephResourceService.js.map +1 -0
  211. package/build/dist/Server/Services/CloudResourceService.js +10 -2
  212. package/build/dist/Server/Services/CloudResourceService.js.map +1 -1
  213. package/build/dist/Server/Services/DockerHostService.js +10 -2
  214. package/build/dist/Server/Services/DockerHostService.js.map +1 -1
  215. package/build/dist/Server/Services/ExceptionAggregationService.js +2 -0
  216. package/build/dist/Server/Services/ExceptionAggregationService.js.map +1 -1
  217. package/build/dist/Server/Services/HostService.js +10 -2
  218. package/build/dist/Server/Services/HostService.js.map +1 -1
  219. package/build/dist/Server/Services/Index.js +24 -0
  220. package/build/dist/Server/Services/Index.js.map +1 -1
  221. package/build/dist/Server/Services/KubernetesClusterService.js +10 -2
  222. package/build/dist/Server/Services/KubernetesClusterService.js.map +1 -1
  223. package/build/dist/Server/Services/LogAggregationService.js +2 -0
  224. package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
  225. package/build/dist/Server/Services/MetricAggregationService.js +2 -0
  226. package/build/dist/Server/Services/MetricAggregationService.js.map +1 -1
  227. package/build/dist/Server/Services/OpenTelemetryIngestService.js +37 -7
  228. package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
  229. package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js +166 -0
  230. package/build/dist/Server/Services/ProxmoxClusterLabelRuleEngineService.js.map +1 -0
  231. package/build/dist/Server/Services/ProxmoxClusterLabelRuleService.js +13 -0
  232. package/build/dist/Server/Services/ProxmoxClusterLabelRuleService.js.map +1 -0
  233. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js +186 -0
  234. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleEngineService.js.map +1 -0
  235. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleService.js +13 -0
  236. package/build/dist/Server/Services/ProxmoxClusterOwnerRuleService.js.map +1 -0
  237. package/build/dist/Server/Services/ProxmoxClusterOwnerTeamService.js +9 -0
  238. package/build/dist/Server/Services/ProxmoxClusterOwnerTeamService.js.map +1 -0
  239. package/build/dist/Server/Services/ProxmoxClusterOwnerUserService.js +9 -0
  240. package/build/dist/Server/Services/ProxmoxClusterOwnerUserService.js.map +1 -0
  241. package/build/dist/Server/Services/ProxmoxClusterService.js +337 -0
  242. package/build/dist/Server/Services/ProxmoxClusterService.js.map +1 -0
  243. package/build/dist/Server/Services/ProxmoxResourceService.js +285 -0
  244. package/build/dist/Server/Services/ProxmoxResourceService.js.map +1 -0
  245. package/build/dist/Server/Services/RumApplicationService.js +10 -2
  246. package/build/dist/Server/Services/RumApplicationService.js.map +1 -1
  247. package/build/dist/Server/Services/ServerlessFunctionService.js +10 -2
  248. package/build/dist/Server/Services/ServerlessFunctionService.js.map +1 -1
  249. package/build/dist/Server/Services/TelemetryUsageBillingService.js +30 -3
  250. package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
  251. package/build/dist/Server/Services/TraceAggregationService.js +2 -0
  252. package/build/dist/Server/Services/TraceAggregationService.js.map +1 -1
  253. package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js +8 -25
  254. package/build/dist/Server/Types/AnalyticsDatabase/AggregateBy.js.map +1 -1
  255. package/build/dist/Server/Utils/Monitor/MonitorAlert.js +36 -0
  256. package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
  257. package/build/dist/Server/Utils/Monitor/MonitorClusterContext.js +90 -0
  258. package/build/dist/Server/Utils/Monitor/MonitorClusterContext.js.map +1 -0
  259. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +228 -4
  260. package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
  261. package/build/dist/Server/Utils/Monitor/MonitorIncident.js +103 -8
  262. package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
  263. package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js +23 -6
  264. package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js.map +1 -1
  265. package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js +3 -1
  266. package/build/dist/Server/Utils/Monitor/MonitorTemplateUtil.js.map +1 -1
  267. package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js +23 -0
  268. package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js.map +1 -1
  269. package/build/dist/Server/Utils/Profiling.js +24 -3
  270. package/build/dist/Server/Utils/Profiling.js.map +1 -1
  271. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +4 -0
  272. package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
  273. package/build/dist/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.js +854 -0
  274. package/build/dist/Server/Utils/Telemetry/ProxmoxCephSnapshotScan.js.map +1 -0
  275. package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +62 -0
  276. package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
  277. package/build/dist/Server/Utils/Telemetry.js +8 -10
  278. package/build/dist/Server/Utils/Telemetry.js.map +1 -1
  279. package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js +69 -0
  280. package/build/dist/Types/BaseDatabase/AggregationIntervalUtil.js.map +1 -0
  281. package/build/dist/Types/Dashboard/DashboardComponentType.js +4 -0
  282. package/build/dist/Types/Dashboard/DashboardComponentType.js.map +1 -1
  283. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js +2 -0
  284. package/build/dist/Types/Dashboard/DashboardComponents/ComponentArgument.js.map +1 -1
  285. package/build/dist/Types/Dashboard/DashboardComponents/DashboardCephOsdListComponent.js +2 -0
  286. package/build/dist/Types/Dashboard/DashboardComponents/DashboardCephOsdListComponent.js.map +1 -0
  287. package/build/dist/Types/Dashboard/DashboardComponents/DashboardCephPoolListComponent.js +2 -0
  288. package/build/dist/Types/Dashboard/DashboardComponents/DashboardCephPoolListComponent.js.map +1 -0
  289. package/build/dist/Types/Dashboard/DashboardComponents/DashboardProxmoxGuestListComponent.js +2 -0
  290. package/build/dist/Types/Dashboard/DashboardComponents/DashboardProxmoxGuestListComponent.js.map +1 -0
  291. package/build/dist/Types/Dashboard/DashboardComponents/DashboardProxmoxNodeListComponent.js +2 -0
  292. package/build/dist/Types/Dashboard/DashboardComponents/DashboardProxmoxNodeListComponent.js.map +1 -0
  293. package/build/dist/Types/Dashboard/DashboardTemplates.js +394 -0
  294. package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
  295. package/build/dist/Types/Icon/IconProp.js +2 -0
  296. package/build/dist/Types/Icon/IconProp.js.map +1 -1
  297. package/build/dist/Types/Monitor/CephAlertTemplates.js +1379 -0
  298. package/build/dist/Types/Monitor/CephAlertTemplates.js.map +1 -0
  299. package/build/dist/Types/Monitor/CephMetricCatalog.js +353 -0
  300. package/build/dist/Types/Monitor/CephMetricCatalog.js.map +1 -0
  301. package/build/dist/Types/Monitor/MonitorStep.js +46 -0
  302. package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
  303. package/build/dist/Types/Monitor/MonitorStepCephMonitor.js +34 -0
  304. package/build/dist/Types/Monitor/MonitorStepCephMonitor.js.map +1 -0
  305. package/build/dist/Types/Monitor/MonitorStepProxmoxMonitor.js +36 -0
  306. package/build/dist/Types/Monitor/MonitorStepProxmoxMonitor.js.map +1 -0
  307. package/build/dist/Types/Monitor/MonitorType.js +27 -1
  308. package/build/dist/Types/Monitor/MonitorType.js.map +1 -1
  309. package/build/dist/Types/Monitor/ProxmoxAlertTemplates.js +743 -0
  310. package/build/dist/Types/Monitor/ProxmoxAlertTemplates.js.map +1 -0
  311. package/build/dist/Types/Monitor/ProxmoxMetricCatalog.js +320 -0
  312. package/build/dist/Types/Monitor/ProxmoxMetricCatalog.js.map +1 -0
  313. package/build/dist/Types/Permission.js +408 -0
  314. package/build/dist/Types/Permission.js.map +1 -1
  315. package/build/dist/Types/Telemetry/EntityType.js +11 -0
  316. package/build/dist/Types/Telemetry/EntityType.js.map +1 -1
  317. package/build/dist/Types/Telemetry/ServiceType.js +2 -0
  318. package/build/dist/Types/Telemetry/ServiceType.js.map +1 -1
  319. package/build/dist/UI/Components/Icon/Icon.js +33 -0
  320. package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
  321. package/build/dist/UI/Components/ImportExport/ExportModelCard.js +50 -0
  322. package/build/dist/UI/Components/ImportExport/ExportModelCard.js.map +1 -0
  323. package/build/dist/UI/Components/ImportExport/ImportModelsModal.js +115 -0
  324. package/build/dist/UI/Components/ImportExport/ImportModelsModal.js.map +1 -0
  325. package/build/dist/UI/Components/ModelTable/ModelTable.js +166 -74
  326. package/build/dist/UI/Components/ModelTable/ModelTable.js.map +1 -1
  327. package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js +5 -1
  328. package/build/dist/UI/Components/MonitorTemplateVariables/TemplateVariablesCatalog.js.map +1 -1
  329. package/build/dist/UI/Utils/ModelImportExport.js +142 -0
  330. package/build/dist/UI/Utils/ModelImportExport.js.map +1 -0
  331. package/build/dist/UI/Utils/Telemetry/Telemetry.js +11 -10
  332. package/build/dist/UI/Utils/Telemetry/Telemetry.js.map +1 -1
  333. package/build/dist/UI/Utils/TelemetryService.js +5 -2
  334. package/build/dist/UI/Utils/TelemetryService.js.map +1 -1
  335. package/build/dist/Utils/Dashboard/Components/DashboardCephOsdListComponent.js +50 -0
  336. package/build/dist/Utils/Dashboard/Components/DashboardCephOsdListComponent.js.map +1 -0
  337. package/build/dist/Utils/Dashboard/Components/DashboardCephPoolListComponent.js +27 -0
  338. package/build/dist/Utils/Dashboard/Components/DashboardCephPoolListComponent.js.map +1 -0
  339. package/build/dist/Utils/Dashboard/Components/DashboardCephResourceListShared.js +46 -0
  340. package/build/dist/Utils/Dashboard/Components/DashboardCephResourceListShared.js.map +1 -0
  341. package/build/dist/Utils/Dashboard/Components/DashboardProxmoxGuestListComponent.js +55 -0
  342. package/build/dist/Utils/Dashboard/Components/DashboardProxmoxGuestListComponent.js.map +1 -0
  343. package/build/dist/Utils/Dashboard/Components/DashboardProxmoxNodeListComponent.js +42 -0
  344. package/build/dist/Utils/Dashboard/Components/DashboardProxmoxNodeListComponent.js.map +1 -0
  345. package/build/dist/Utils/Dashboard/Components/DashboardProxmoxResourceListShared.js +46 -0
  346. package/build/dist/Utils/Dashboard/Components/DashboardProxmoxResourceListShared.js.map +1 -0
  347. package/build/dist/Utils/Dashboard/Components/Index.js +16 -0
  348. package/build/dist/Utils/Dashboard/Components/Index.js.map +1 -1
  349. package/build/dist/Utils/ModelImportExport.js +257 -0
  350. package/build/dist/Utils/ModelImportExport.js.map +1 -0
  351. package/build/dist/Utils/Telemetry/EntityKey.js +27 -0
  352. package/build/dist/Utils/Telemetry/EntityKey.js.map +1 -1
  353. package/build/dist/Utils/Telemetry/EntityRelationship.js +3 -0
  354. package/build/dist/Utils/Telemetry/EntityRelationship.js.map +1 -1
  355. package/build/dist/Utils/Telemetry/HeartbeatAvailability.js +174 -0
  356. package/build/dist/Utils/Telemetry/HeartbeatAvailability.js.map +1 -0
  357. package/package.json +29 -21
@@ -0,0 +1,743 @@
1
+ import ObjectID from "../ObjectID";
2
+ import MonitorStep from "./MonitorStep";
3
+ import MonitorCriteria from "./MonitorCriteria";
4
+ import MonitorCriteriaInstance from "./MonitorCriteriaInstance";
5
+ import FilterCondition from "../Filter/FilterCondition";
6
+ import { CheckOn, FilterType, EvaluateOverTimeType } from "./CriteriaFilter";
7
+ import RollingTime from "../RollingTime/RollingTime";
8
+ import MetricsAggregationType from "../Metrics/MetricsAggregationType";
9
+ /*
10
+ * Filter contract: pve-exporter data metrics carry only the `id` datapoint
11
+ * label (`node/pve1`, `qemu/100`, `lxc/101`, `storage/local`). The agent's
12
+ * OTTL transform processor splits it into the datapoint attributes
13
+ * `pve.scope` (node | guest | storage | cluster), `pve.type` (node | qemu |
14
+ * lxc | storage) and `pve.id` (the part after the slash). Templates filter
15
+ * on `pve.scope` / `pve.type` and group by the untouched `id` label so one
16
+ * incident fires per resource. All of these are datapoint attributes, so
17
+ * they are NOT `resource.`-prefixed in ClickHouse.
18
+ */
19
+ export function buildProxmoxMonitorStep(args) {
20
+ const monitorStep = new MonitorStep();
21
+ const monitorCriteria = new MonitorCriteria();
22
+ monitorCriteria.data = {
23
+ monitorCriteriaInstanceArray: [
24
+ args.offlineCriteriaInstance,
25
+ args.onlineCriteriaInstance,
26
+ ],
27
+ };
28
+ monitorStep.data = {
29
+ id: ObjectID.generate().toString(),
30
+ monitorDestination: undefined,
31
+ doNotFollowRedirects: undefined,
32
+ monitorDestinationPort: undefined,
33
+ monitorCriteria: monitorCriteria,
34
+ requestType: "GET",
35
+ requestHeaders: undefined,
36
+ requestBody: undefined,
37
+ customCode: undefined,
38
+ screenSizeTypes: undefined,
39
+ browserTypes: undefined,
40
+ retryCountOnError: undefined,
41
+ logMonitor: undefined,
42
+ traceMonitor: undefined,
43
+ metricMonitor: undefined,
44
+ exceptionMonitor: undefined,
45
+ snmpMonitor: undefined,
46
+ dnsMonitor: undefined,
47
+ domainMonitor: undefined,
48
+ externalStatusPageMonitor: undefined,
49
+ kubernetesMonitor: undefined,
50
+ profileMonitor: undefined,
51
+ dockerMonitor: undefined,
52
+ proxmoxMonitor: args.proxmoxMonitor,
53
+ };
54
+ return monitorStep;
55
+ }
56
+ export function buildProxmoxOfflineCriteriaInstance(args) {
57
+ const instance = new MonitorCriteriaInstance();
58
+ const incidentTitle = args.incidentTitle || `${args.monitorName} - Alert Triggered`;
59
+ const incidentDescription = args.incidentDescription ||
60
+ `${args.monitorName} has triggered an alert condition. See root cause for detailed Proxmox cluster information.`;
61
+ instance.data = {
62
+ id: ObjectID.generate().toString(),
63
+ monitorStatusId: args.offlineMonitorStatusId,
64
+ filterCondition: FilterCondition.Any,
65
+ filters: [
66
+ {
67
+ checkOn: CheckOn.MetricValue,
68
+ filterType: args.filterType,
69
+ metricMonitorOptions: {
70
+ metricAggregationType: EvaluateOverTimeType.AnyValue,
71
+ metricAlias: args.metricAlias,
72
+ },
73
+ value: args.value,
74
+ },
75
+ ],
76
+ incidents: [
77
+ {
78
+ title: incidentTitle,
79
+ description: incidentDescription,
80
+ incidentSeverityId: args.incidentSeverityId,
81
+ autoResolveIncident: true,
82
+ id: ObjectID.generate().toString(),
83
+ onCallPolicyIds: [],
84
+ },
85
+ ],
86
+ alerts: [
87
+ {
88
+ title: incidentTitle,
89
+ description: incidentDescription,
90
+ alertSeverityId: args.alertSeverityId,
91
+ autoResolveAlert: true,
92
+ id: ObjectID.generate().toString(),
93
+ onCallPolicyIds: [],
94
+ },
95
+ ],
96
+ changeMonitorStatus: true,
97
+ createIncidents: true,
98
+ createAlerts: true,
99
+ name: args.criteriaName || `${args.monitorName} - Unhealthy`,
100
+ description: args.criteriaDescription || `Criteria for detecting unhealthy state.`,
101
+ };
102
+ return instance;
103
+ }
104
+ export function buildProxmoxOnlineCriteriaInstance(args) {
105
+ const instance = new MonitorCriteriaInstance();
106
+ instance.data = {
107
+ id: ObjectID.generate().toString(),
108
+ monitorStatusId: args.onlineMonitorStatusId,
109
+ filterCondition: FilterCondition.Any,
110
+ filters: [
111
+ {
112
+ checkOn: CheckOn.MetricValue,
113
+ filterType: args.filterType,
114
+ metricMonitorOptions: {
115
+ metricAggregationType: EvaluateOverTimeType.AnyValue,
116
+ metricAlias: args.metricAlias,
117
+ },
118
+ value: args.value,
119
+ },
120
+ ],
121
+ incidents: [],
122
+ alerts: [],
123
+ changeMonitorStatus: true,
124
+ createIncidents: false,
125
+ createAlerts: false,
126
+ name: "Healthy",
127
+ description: "Criteria for healthy state.",
128
+ };
129
+ return instance;
130
+ }
131
+ export function buildProxmoxMonitorConfig(args) {
132
+ return {
133
+ clusterIdentifier: args.clusterIdentifier,
134
+ resourceFilters: {},
135
+ metricViewConfig: {
136
+ queryConfigs: [
137
+ {
138
+ metricAliasData: {
139
+ metricVariable: args.metricAlias,
140
+ title: args.metricAlias,
141
+ description: args.metricAlias,
142
+ legend: args.metricAlias,
143
+ legendUnit: undefined,
144
+ },
145
+ metricQueryData: Object.assign({ filterData: {
146
+ metricName: args.metricName,
147
+ attributes: args.attributes || {},
148
+ aggegationType: args.aggregationType,
149
+ aggregateBy: {},
150
+ } }, (args.groupByAttributeKey
151
+ ? { groupByAttributeKeys: [args.groupByAttributeKey] }
152
+ : {})),
153
+ },
154
+ ],
155
+ formulaConfigs: [],
156
+ },
157
+ rollingTime: args.rollingTime,
158
+ };
159
+ }
160
+ /**
161
+ * Build a ratio monitor: `(numerator / denominator) * 100`, optionally
162
+ * grouped by an OpenTelemetry attribute so one incident fires per group
163
+ * (e.g. per `id` = per node/guest/storage volume).
164
+ *
165
+ * Aggregation contract (see buildKubernetesRatioMonitorConfig for the full
166
+ * derivation): the per-series worker buckets raw rows by (group, minute)
167
+ * and applies the aggregation across both the grouped series AND the
168
+ * scrapes in that minute. `Sum` is only correct when numerator and
169
+ * denominator ride the SAME receiver/scrape so the scrape multiple
170
+ * cancels: `(Σnum × scrapes) / (Σden × scrapes)`. Every Proxmox metric
171
+ * comes from ONE receiver — the prometheus scrape of pve-exporter — so
172
+ * all Proxmox ratios are same-receiver and default to `Sum`/`Sum`.
173
+ * (`Avg`/`Avg` is the cross-receiver variant; not needed here.)
174
+ *
175
+ * `attributes` is applied to BOTH queries — the agent stamps `pve.scope` /
176
+ * `pve.type` on every series of a scrape (including the *_info metadata
177
+ * series, which also carry `id`), so a shared equality filter is safe.
178
+ */
179
+ export function buildProxmoxRatioMonitorConfig(args) {
180
+ const aggregationType = args.aggregationType || MetricsAggregationType.Sum;
181
+ const buildQueryConfig = (alias, metricName) => {
182
+ return {
183
+ metricAliasData: {
184
+ metricVariable: alias,
185
+ title: alias,
186
+ description: alias,
187
+ legend: alias,
188
+ legendUnit: undefined,
189
+ },
190
+ metricQueryData: Object.assign({ filterData: {
191
+ metricName: metricName,
192
+ attributes: args.attributes || {},
193
+ aggegationType: aggregationType,
194
+ aggregateBy: {},
195
+ } }, (args.groupByAttributeKey
196
+ ? { groupByAttributeKeys: [args.groupByAttributeKey] }
197
+ : {})),
198
+ };
199
+ };
200
+ return {
201
+ clusterIdentifier: args.clusterIdentifier,
202
+ resourceFilters: {},
203
+ metricViewConfig: {
204
+ queryConfigs: [
205
+ buildQueryConfig(args.numeratorAlias, args.numeratorMetricName),
206
+ buildQueryConfig(args.denominatorAlias, args.denominatorMetricName),
207
+ ],
208
+ formulaConfigs: [
209
+ {
210
+ metricAliasData: {
211
+ metricVariable: args.resultAlias,
212
+ title: args.resultLegend,
213
+ description: args.resultLegend,
214
+ legend: args.resultLegend,
215
+ legendUnit: "%",
216
+ },
217
+ metricFormulaData: {
218
+ metricFormula: `(${args.numeratorAlias} / ${args.denominatorAlias}) * 100`,
219
+ },
220
+ },
221
+ ],
222
+ },
223
+ rollingTime: args.rollingTime,
224
+ };
225
+ }
226
+ // --- Template Definitions ---
227
+ const nodeOfflineTemplate = {
228
+ id: "pve-node-offline",
229
+ name: "Node Offline",
230
+ description: "Alert when any Proxmox node reports as down (pve_up = 0, scoped to nodes via pve.scope). One incident per node.",
231
+ category: "Availability",
232
+ severity: "Critical",
233
+ getMonitorStep: (args) => {
234
+ const metricAlias = "node_up";
235
+ return buildProxmoxMonitorStep({
236
+ proxmoxMonitor: buildProxmoxMonitorConfig({
237
+ clusterIdentifier: args.clusterIdentifier,
238
+ metricName: "pve_up",
239
+ metricAlias,
240
+ rollingTime: RollingTime.Past5Minutes,
241
+ /*
242
+ * Min per node — a single down scrape trips the threshold instead
243
+ * of being masked by scrapes where the node was still up.
244
+ */
245
+ aggregationType: MetricsAggregationType.Min,
246
+ attributes: { "pve.scope": "node" },
247
+ groupByAttributeKey: "id",
248
+ }),
249
+ offlineCriteriaInstance: buildProxmoxOfflineCriteriaInstance({
250
+ offlineMonitorStatusId: args.offlineMonitorStatusId,
251
+ incidentSeverityId: args.defaultIncidentSeverityId,
252
+ alertSeverityId: args.defaultAlertSeverityId,
253
+ monitorName: args.monitorName,
254
+ metricAlias,
255
+ filterType: FilterType.LessThan,
256
+ value: 1,
257
+ incidentTitle: `[Proxmox] Node Offline - ${args.monitorName}`,
258
+ incidentDescription: `A Proxmox node is reporting as down (pve_up = 0). The node is unreachable or has crashed and every guest running on it may be offline. Check the root cause for the affected node id, verify the node's power/network state, and check whether HA has relocated its guests.`,
259
+ criteriaName: "Node Offline - pve_up < 1",
260
+ criteriaDescription: "Triggers when any node reports pve_up below 1 over the monitoring window.",
261
+ }),
262
+ onlineCriteriaInstance: buildProxmoxOnlineCriteriaInstance({
263
+ onlineMonitorStatusId: args.onlineMonitorStatusId,
264
+ metricAlias,
265
+ filterType: FilterType.GreaterThanOrEqualTo,
266
+ value: 1,
267
+ }),
268
+ });
269
+ },
270
+ };
271
+ const guestDownTemplate = {
272
+ id: "pve-guest-down",
273
+ name: "Guest Down",
274
+ description: "Alert when any VM or container reports as down (pve_up = 0, scoped to guests via pve.scope). One incident per guest. Intentionally stopped guests also report 0 — add a pve.id filter to scope to guests that should always run.",
275
+ category: "Availability",
276
+ severity: "Warning",
277
+ getMonitorStep: (args) => {
278
+ const metricAlias = "guest_up";
279
+ return buildProxmoxMonitorStep({
280
+ proxmoxMonitor: buildProxmoxMonitorConfig({
281
+ clusterIdentifier: args.clusterIdentifier,
282
+ metricName: "pve_up",
283
+ metricAlias,
284
+ rollingTime: RollingTime.Past5Minutes,
285
+ /*
286
+ * Min per guest — a single down scrape trips the threshold instead
287
+ * of being masked by scrapes where the guest was still up.
288
+ */
289
+ aggregationType: MetricsAggregationType.Min,
290
+ attributes: { "pve.scope": "guest" },
291
+ groupByAttributeKey: "id",
292
+ }),
293
+ offlineCriteriaInstance: buildProxmoxOfflineCriteriaInstance({
294
+ offlineMonitorStatusId: args.offlineMonitorStatusId,
295
+ incidentSeverityId: args.defaultIncidentSeverityId,
296
+ alertSeverityId: args.defaultAlertSeverityId,
297
+ monitorName: args.monitorName,
298
+ metricAlias,
299
+ filterType: FilterType.LessThan,
300
+ value: 1,
301
+ incidentTitle: `[Proxmox] Guest Down - ${args.monitorName}`,
302
+ incidentDescription: `A Proxmox guest (VM or container) is reporting as down (pve_up = 0). It has stopped or crashed. Check the root cause for the affected guest id. Note: intentionally stopped guests also report pve_up = 0 — add a pve.id attribute filter to scope this monitor to guests that should always be running.`,
303
+ criteriaName: "Guest Down - pve_up < 1",
304
+ criteriaDescription: "Triggers when any guest reports pve_up below 1 over the monitoring window.",
305
+ }),
306
+ onlineCriteriaInstance: buildProxmoxOnlineCriteriaInstance({
307
+ onlineMonitorStatusId: args.onlineMonitorStatusId,
308
+ metricAlias,
309
+ filterType: FilterType.GreaterThanOrEqualTo,
310
+ value: 1,
311
+ }),
312
+ });
313
+ },
314
+ };
315
+ const quorumRiskTemplate = {
316
+ id: "pve-quorum-risk",
317
+ name: "Cluster Quorum at Risk",
318
+ description: "Alert when 50% or fewer of the cluster's nodes are online. Derived from node visibility (online pve_up nodes ÷ pve_node_info node count) — pve-exporter exposes no corosync metric, so this is the honest quorum proxy: at ≤50% node availability the cluster has lost (or is about to lose) quorum and HA recovery stops.",
319
+ category: "Availability",
320
+ severity: "Critical",
321
+ getMonitorStep: (args) => {
322
+ const metricAlias = "node_availability";
323
+ return buildProxmoxMonitorStep({
324
+ proxmoxMonitor: buildProxmoxRatioMonitorConfig({
325
+ clusterIdentifier: args.clusterIdentifier,
326
+ /*
327
+ * Numerator Σpve_up over node series = nodes online; denominator
328
+ * Σpve_node_info (a constant-1 metadata series per node) = nodes
329
+ * total. Same receiver ⇒ the scrape multiple cancels (Sum/Sum).
330
+ */
331
+ numeratorMetricName: "pve_up",
332
+ denominatorMetricName: "pve_node_info",
333
+ numeratorAlias: "nodes_online",
334
+ denominatorAlias: "nodes_total",
335
+ resultAlias: metricAlias,
336
+ resultLegend: "Node Availability (%)",
337
+ rollingTime: RollingTime.Past5Minutes,
338
+ attributes: { "pve.scope": "node" },
339
+ }),
340
+ offlineCriteriaInstance: buildProxmoxOfflineCriteriaInstance({
341
+ offlineMonitorStatusId: args.offlineMonitorStatusId,
342
+ incidentSeverityId: args.defaultIncidentSeverityId,
343
+ alertSeverityId: args.defaultAlertSeverityId,
344
+ monitorName: args.monitorName,
345
+ metricAlias,
346
+ filterType: FilterType.LessThanOrEqualTo,
347
+ value: 50,
348
+ incidentTitle: `[Proxmox] CRITICAL: Cluster Quorum at Risk - ${args.monitorName}`,
349
+ incidentDescription: `Half or more of the Proxmox cluster's nodes are offline. With ≤50% of nodes online the cluster has lost (or is about to lose) corosync quorum — pmxcfs goes read-only, guests cannot be started or migrated, and HA recovery stops. Identify and recover the offline nodes immediately. (This is derived from node visibility: online nodes ÷ total nodes; pve-exporter exposes no direct corosync metric.)`,
350
+ criteriaName: "Quorum Risk - Node Availability <= 50%",
351
+ criteriaDescription: "Triggers when 50% or fewer of the cluster's nodes report as online.",
352
+ }),
353
+ onlineCriteriaInstance: buildProxmoxOnlineCriteriaInstance({
354
+ onlineMonitorStatusId: args.onlineMonitorStatusId,
355
+ metricAlias,
356
+ filterType: FilterType.GreaterThan,
357
+ value: 50,
358
+ }),
359
+ });
360
+ },
361
+ };
362
+ const nodeHighCpuTemplate = {
363
+ id: "pve-node-high-cpu",
364
+ name: "High Node CPU Usage",
365
+ description: "Alert when any node's average CPU usage exceeds 90% of its cores (pve_cpu_usage_ratio > 0.9, scoped to nodes). One incident per node.",
366
+ category: "Node",
367
+ severity: "Warning",
368
+ getMonitorStep: (args) => {
369
+ const metricAlias = "node_cpu";
370
+ return buildProxmoxMonitorStep({
371
+ proxmoxMonitor: buildProxmoxMonitorConfig({
372
+ clusterIdentifier: args.clusterIdentifier,
373
+ metricName: "pve_cpu_usage_ratio",
374
+ metricAlias,
375
+ rollingTime: RollingTime.Past5Minutes,
376
+ /*
377
+ * Avg per node — pve_cpu_usage_ratio is already a true 0-1 ratio
378
+ * (one series per node), so the per-minute average is the
379
+ * sustained utilization regardless of scrape count.
380
+ */
381
+ aggregationType: MetricsAggregationType.Avg,
382
+ attributes: { "pve.scope": "node" },
383
+ groupByAttributeKey: "id",
384
+ }),
385
+ offlineCriteriaInstance: buildProxmoxOfflineCriteriaInstance({
386
+ offlineMonitorStatusId: args.offlineMonitorStatusId,
387
+ incidentSeverityId: args.defaultIncidentSeverityId,
388
+ alertSeverityId: args.defaultAlertSeverityId,
389
+ monitorName: args.monitorName,
390
+ metricAlias,
391
+ filterType: FilterType.GreaterThan,
392
+ value: 0.9,
393
+ incidentTitle: `[Proxmox] High Node CPU Usage (>90%) - ${args.monitorName}`,
394
+ incidentDescription: `A Proxmox node's CPU usage has exceeded 90% of its available cores. Sustained high CPU on a node degrades performance of every guest running on it. Check the root cause for the affected node id, then consider migrating guests to another node or adding capacity.`,
395
+ criteriaName: "High Node CPU - Usage Ratio > 0.9",
396
+ criteriaDescription: "Triggers when any node's average CPU usage ratio exceeds 0.9 over the monitoring window.",
397
+ }),
398
+ onlineCriteriaInstance: buildProxmoxOnlineCriteriaInstance({
399
+ onlineMonitorStatusId: args.onlineMonitorStatusId,
400
+ metricAlias,
401
+ filterType: FilterType.LessThanOrEqualTo,
402
+ value: 0.9,
403
+ }),
404
+ });
405
+ },
406
+ };
407
+ const nodeHighMemoryTemplate = {
408
+ id: "pve-node-high-memory",
409
+ name: "High Node Memory Usage",
410
+ description: "Alert when any node's memory usage exceeds 85% of its RAM. Computed per node as pve_memory_usage_bytes ÷ pve_memory_size_bytes × 100 — both are bytes from the same scrape, so this is a true percentage with no per-node threshold tuning.",
411
+ category: "Node",
412
+ severity: "Warning",
413
+ getMonitorStep: (args) => {
414
+ const metricAlias = "node_memory_utilization";
415
+ return buildProxmoxMonitorStep({
416
+ proxmoxMonitor: buildProxmoxRatioMonitorConfig({
417
+ clusterIdentifier: args.clusterIdentifier,
418
+ numeratorMetricName: "pve_memory_usage_bytes",
419
+ denominatorMetricName: "pve_memory_size_bytes",
420
+ numeratorAlias: "used_mem",
421
+ denominatorAlias: "total_mem",
422
+ resultAlias: metricAlias,
423
+ resultLegend: "Node Memory Utilization (%)",
424
+ rollingTime: RollingTime.Past5Minutes,
425
+ attributes: { "pve.scope": "node" },
426
+ groupByAttributeKey: "id",
427
+ }),
428
+ offlineCriteriaInstance: buildProxmoxOfflineCriteriaInstance({
429
+ offlineMonitorStatusId: args.offlineMonitorStatusId,
430
+ incidentSeverityId: args.defaultIncidentSeverityId,
431
+ alertSeverityId: args.defaultAlertSeverityId,
432
+ monitorName: args.monitorName,
433
+ metricAlias,
434
+ filterType: FilterType.GreaterThan,
435
+ value: 85,
436
+ incidentTitle: `[Proxmox] High Node Memory Usage (>85%) - ${args.monitorName}`,
437
+ incidentDescription: `A Proxmox node's memory usage has exceeded 85% of its physical RAM. Memory pressure on a node can trigger the kernel OOM killer, which terminates guests. Check the root cause for the affected node id, then consider migrating guests, reducing guest memory allocations, or adding RAM.`,
438
+ criteriaName: "High Node Memory - Utilization > 85%",
439
+ criteriaDescription: "Triggers when any node's memory usage exceeds 85% of its total memory over the monitoring window.",
440
+ }),
441
+ onlineCriteriaInstance: buildProxmoxOnlineCriteriaInstance({
442
+ onlineMonitorStatusId: args.onlineMonitorStatusId,
443
+ metricAlias,
444
+ filterType: FilterType.LessThanOrEqualTo,
445
+ value: 85,
446
+ }),
447
+ });
448
+ },
449
+ };
450
+ const guestHighCpuTemplate = {
451
+ id: "pve-guest-high-cpu",
452
+ name: "High Guest CPU Usage",
453
+ description: "Alert when any VM or container uses more than 90% of its allocated vCPUs (pve_cpu_usage_ratio > 0.9, scoped to guests). One incident per guest.",
454
+ category: "Guest",
455
+ severity: "Warning",
456
+ getMonitorStep: (args) => {
457
+ const metricAlias = "guest_cpu";
458
+ return buildProxmoxMonitorStep({
459
+ proxmoxMonitor: buildProxmoxMonitorConfig({
460
+ clusterIdentifier: args.clusterIdentifier,
461
+ metricName: "pve_cpu_usage_ratio",
462
+ metricAlias,
463
+ rollingTime: RollingTime.Past5Minutes,
464
+ /*
465
+ * Avg per guest — pve_cpu_usage_ratio is already a true 0-1 ratio
466
+ * (one series per guest), so the per-minute average is the
467
+ * sustained utilization regardless of scrape count.
468
+ */
469
+ aggregationType: MetricsAggregationType.Avg,
470
+ attributes: { "pve.scope": "guest" },
471
+ groupByAttributeKey: "id",
472
+ }),
473
+ offlineCriteriaInstance: buildProxmoxOfflineCriteriaInstance({
474
+ offlineMonitorStatusId: args.offlineMonitorStatusId,
475
+ incidentSeverityId: args.defaultIncidentSeverityId,
476
+ alertSeverityId: args.defaultAlertSeverityId,
477
+ monitorName: args.monitorName,
478
+ metricAlias,
479
+ filterType: FilterType.GreaterThan,
480
+ value: 0.9,
481
+ incidentTitle: `[Proxmox] High Guest CPU Usage (>90%) - ${args.monitorName}`,
482
+ incidentDescription: `A guest (VM or container) is using more than 90% of its allocated vCPUs. The workload inside the guest may be CPU-starved. Check the root cause for the affected guest id, then consider allocating more vCPUs or investigating the workload inside the guest.`,
483
+ criteriaName: "High Guest CPU - Usage Ratio > 0.9",
484
+ criteriaDescription: "Triggers when any guest's average CPU usage ratio exceeds 0.9 over the monitoring window.",
485
+ }),
486
+ onlineCriteriaInstance: buildProxmoxOnlineCriteriaInstance({
487
+ onlineMonitorStatusId: args.onlineMonitorStatusId,
488
+ metricAlias,
489
+ filterType: FilterType.LessThanOrEqualTo,
490
+ value: 0.9,
491
+ }),
492
+ });
493
+ },
494
+ };
495
+ const storageNearFullTemplate = {
496
+ id: "pve-storage-near-full",
497
+ name: "Storage Near Full",
498
+ description: "Alert when any storage volume's disk usage exceeds 85% of its capacity. Computed per volume as pve_disk_usage_bytes ÷ pve_disk_size_bytes × 100 — a true percentage with no per-volume threshold tuning.",
499
+ category: "Storage",
500
+ severity: "Warning",
501
+ getMonitorStep: (args) => {
502
+ const metricAlias = "storage_utilization";
503
+ return buildProxmoxMonitorStep({
504
+ proxmoxMonitor: buildProxmoxRatioMonitorConfig({
505
+ clusterIdentifier: args.clusterIdentifier,
506
+ numeratorMetricName: "pve_disk_usage_bytes",
507
+ denominatorMetricName: "pve_disk_size_bytes",
508
+ numeratorAlias: "used_disk",
509
+ denominatorAlias: "total_disk",
510
+ resultAlias: metricAlias,
511
+ resultLegend: "Storage Utilization (%)",
512
+ rollingTime: RollingTime.Past5Minutes,
513
+ attributes: { "pve.scope": "storage" },
514
+ groupByAttributeKey: "id",
515
+ }),
516
+ offlineCriteriaInstance: buildProxmoxOfflineCriteriaInstance({
517
+ offlineMonitorStatusId: args.offlineMonitorStatusId,
518
+ incidentSeverityId: args.defaultIncidentSeverityId,
519
+ alertSeverityId: args.defaultAlertSeverityId,
520
+ monitorName: args.monitorName,
521
+ metricAlias,
522
+ filterType: FilterType.GreaterThan,
523
+ value: 85,
524
+ incidentTitle: `[Proxmox] Storage Near Full (>85%) - ${args.monitorName}`,
525
+ incidentDescription: `A Proxmox storage volume is more than 85% full. A full storage volume prevents guests from writing, can pause VMs, and blocks backups and snapshots. Check the root cause for the affected storage id, then free space, prune old backups/snapshots, or extend the volume.`,
526
+ criteriaName: "Storage Near Full - Utilization > 85%",
527
+ criteriaDescription: "Triggers when any storage volume's disk usage exceeds 85% of its capacity over the monitoring window.",
528
+ }),
529
+ onlineCriteriaInstance: buildProxmoxOnlineCriteriaInstance({
530
+ onlineMonitorStatusId: args.onlineMonitorStatusId,
531
+ metricAlias,
532
+ filterType: FilterType.LessThanOrEqualTo,
533
+ value: 85,
534
+ }),
535
+ });
536
+ },
537
+ };
538
+ const lxcDiskNearFullTemplate = {
539
+ id: "pve-lxc-disk-near-full",
540
+ name: "Container Root Disk Near Full",
541
+ description: "Alert when any LXC container's root disk usage exceeds 90% of its size (pve_disk_usage_bytes ÷ pve_disk_size_bytes × 100, scoped to pve.type=lxc). QEMU VMs are excluded — their in-guest disk usage is only reported when the QEMU guest agent is installed, so it reads 0 otherwise.",
542
+ category: "Storage",
543
+ severity: "Warning",
544
+ getMonitorStep: (args) => {
545
+ const metricAlias = "lxc_disk_utilization";
546
+ return buildProxmoxMonitorStep({
547
+ proxmoxMonitor: buildProxmoxRatioMonitorConfig({
548
+ clusterIdentifier: args.clusterIdentifier,
549
+ numeratorMetricName: "pve_disk_usage_bytes",
550
+ denominatorMetricName: "pve_disk_size_bytes",
551
+ numeratorAlias: "used_disk",
552
+ denominatorAlias: "total_disk",
553
+ resultAlias: metricAlias,
554
+ resultLegend: "Container Root Disk Utilization (%)",
555
+ rollingTime: RollingTime.Past5Minutes,
556
+ attributes: { "pve.type": "lxc" },
557
+ groupByAttributeKey: "id",
558
+ }),
559
+ offlineCriteriaInstance: buildProxmoxOfflineCriteriaInstance({
560
+ offlineMonitorStatusId: args.offlineMonitorStatusId,
561
+ incidentSeverityId: args.defaultIncidentSeverityId,
562
+ alertSeverityId: args.defaultAlertSeverityId,
563
+ monitorName: args.monitorName,
564
+ metricAlias,
565
+ filterType: FilterType.GreaterThan,
566
+ value: 90,
567
+ incidentTitle: `[Proxmox] Container Root Disk Near Full (>90%) - ${args.monitorName}`,
568
+ incidentDescription: `An LXC container's root disk is more than 90% full. When the root filesystem fills up, services inside the container start failing and the container may become unresponsive. Check the root cause for the affected container id, then free space inside the container or grow its root disk.`,
569
+ criteriaName: "LXC Disk Near Full - Utilization > 90%",
570
+ criteriaDescription: "Triggers when any LXC container's root disk usage exceeds 90% of its size over the monitoring window.",
571
+ }),
572
+ onlineCriteriaInstance: buildProxmoxOnlineCriteriaInstance({
573
+ onlineMonitorStatusId: args.onlineMonitorStatusId,
574
+ metricAlias,
575
+ filterType: FilterType.LessThanOrEqualTo,
576
+ value: 90,
577
+ }),
578
+ });
579
+ },
580
+ };
581
+ const haStateErrorTemplate = {
582
+ id: "pve-ha-state-error",
583
+ name: "HA Resource in Error State",
584
+ description: "Alert when any HA-managed resource enters the error state, meaning high availability could not recover it. One incident per HA resource.",
585
+ category: "HA",
586
+ severity: "Critical",
587
+ getMonitorStep: (args) => {
588
+ const metricAlias = "ha_error_state";
589
+ return buildProxmoxMonitorStep({
590
+ proxmoxMonitor: buildProxmoxMonitorConfig({
591
+ clusterIdentifier: args.clusterIdentifier,
592
+ metricName: "pve_ha_state",
593
+ metricAlias,
594
+ rollingTime: RollingTime.Past5Minutes,
595
+ /*
596
+ * pve_ha_state is an enum-style metric: one series per possible
597
+ * state with value 1 for the current state. Filtering on
598
+ * state="error" makes the series go to 1 only when an HA-managed
599
+ * resource is in the error state; Max per resource catches it.
600
+ */
601
+ aggregationType: MetricsAggregationType.Max,
602
+ attributes: { state: "error" },
603
+ groupByAttributeKey: "id",
604
+ }),
605
+ offlineCriteriaInstance: buildProxmoxOfflineCriteriaInstance({
606
+ offlineMonitorStatusId: args.offlineMonitorStatusId,
607
+ incidentSeverityId: args.defaultIncidentSeverityId,
608
+ alertSeverityId: args.defaultAlertSeverityId,
609
+ monitorName: args.monitorName,
610
+ metricAlias,
611
+ filterType: FilterType.GreaterThan,
612
+ value: 0,
613
+ incidentTitle: `[Proxmox] HA Resource in Error State - ${args.monitorName}`,
614
+ incidentDescription: `A high-availability managed resource in the Proxmox cluster has entered the error state. The HA manager could not start or recover the resource automatically — manual intervention is required (typically \`ha-manager set <sid> --state disabled\` followed by re-enabling after fixing the underlying issue). Check the root cause for the affected resource id.`,
615
+ criteriaName: "HA Error - Error State Present",
616
+ criteriaDescription: "Triggers when any HA-managed resource reports the error state.",
617
+ }),
618
+ onlineCriteriaInstance: buildProxmoxOnlineCriteriaInstance({
619
+ onlineMonitorStatusId: args.onlineMonitorStatusId,
620
+ metricAlias,
621
+ filterType: FilterType.EqualTo,
622
+ value: 0,
623
+ }),
624
+ });
625
+ },
626
+ };
627
+ const guestNotBackedUpTemplate = {
628
+ id: "pve-guest-not-backed-up",
629
+ name: "Guest Not Backed Up",
630
+ description: "Alert when one or more guests are not covered by ANY backup job (pve_not_backed_up_total > 0, cluster scope). Identify the uncovered guests via pve_not_backed_up_info grouped by id. Honest boundary: this checks backup-JOB coverage only — whether backups ran recently or succeeded is not exposed by pve-exporter.",
631
+ category: "Backup",
632
+ severity: "Warning",
633
+ getMonitorStep: (args) => {
634
+ const metricAlias = "guests_without_backup";
635
+ return buildProxmoxMonitorStep({
636
+ proxmoxMonitor: buildProxmoxMonitorConfig({
637
+ clusterIdentifier: args.clusterIdentifier,
638
+ /*
639
+ * Cluster-level gauge from the backup-info collector — one
640
+ * series, no `id` label, so no groupBy: one incident per
641
+ * cluster. Per-guest naming belongs to the breakdown table
642
+ * (pve_not_backed_up_info grouped by `id`), not the alert.
643
+ */
644
+ metricName: "pve_not_backed_up_total",
645
+ metricAlias,
646
+ rollingTime: RollingTime.Past5Minutes,
647
+ // Max — a single scrape reporting uncovered guests trips it.
648
+ aggregationType: MetricsAggregationType.Max,
649
+ }),
650
+ offlineCriteriaInstance: buildProxmoxOfflineCriteriaInstance({
651
+ offlineMonitorStatusId: args.offlineMonitorStatusId,
652
+ incidentSeverityId: args.defaultIncidentSeverityId,
653
+ alertSeverityId: args.defaultAlertSeverityId,
654
+ monitorName: args.monitorName,
655
+ metricAlias,
656
+ filterType: FilterType.GreaterThan,
657
+ value: 0,
658
+ incidentTitle: `[Proxmox] Guest Not Backed Up - ${args.monitorName}`,
659
+ incidentDescription: `One or more guests (VMs or containers) in the Proxmox cluster are not covered by any backup job. A guest outside every backup job has NO recovery path if its node or storage fails. Query pve_not_backed_up_info grouped by id to list the uncovered guests, then add them to a vzdump backup job (Datacenter → Backup). Note: this alert covers backup-job membership only — pve-exporter does not expose whether backups ran recently or succeeded.`,
660
+ criteriaName: "Guests Without Backup - Total > 0",
661
+ criteriaDescription: "Triggers when any guest is not covered by a backup job over the monitoring window.",
662
+ }),
663
+ onlineCriteriaInstance: buildProxmoxOnlineCriteriaInstance({
664
+ onlineMonitorStatusId: args.onlineMonitorStatusId,
665
+ metricAlias,
666
+ filterType: FilterType.EqualTo,
667
+ value: 0,
668
+ }),
669
+ });
670
+ },
671
+ };
672
+ const replicationFailingTemplate = {
673
+ id: "pve-replication-failing",
674
+ name: "Replication Failing",
675
+ description: "Alert when any storage replication job reports failed syncs (pve_replication_failed_syncs > 0). One incident per replication job (grouped by the job id). A failing job means the guest's replica on the target node is going stale — manual failover would lose the data written since the last successful sync.",
676
+ category: "Replication",
677
+ severity: "Critical",
678
+ getMonitorStep: (args) => {
679
+ const metricAlias = "replication_failed_syncs";
680
+ return buildProxmoxMonitorStep({
681
+ proxmoxMonitor: buildProxmoxMonitorConfig({
682
+ clusterIdentifier: args.clusterIdentifier,
683
+ /*
684
+ * Node-level replication collector (default-on). Series are
685
+ * labeled `id` with the replication JOB id (e.g. 100-0), not a
686
+ * node/qemu/lxc-prefixed resource id — so no pve.scope filter,
687
+ * and groupBy `id` fires one incident per job.
688
+ */
689
+ metricName: "pve_replication_failed_syncs",
690
+ metricAlias,
691
+ rollingTime: RollingTime.Past5Minutes,
692
+ // Max per job — any scrape reporting a failed sync trips it.
693
+ aggregationType: MetricsAggregationType.Max,
694
+ groupByAttributeKey: "id",
695
+ }),
696
+ offlineCriteriaInstance: buildProxmoxOfflineCriteriaInstance({
697
+ offlineMonitorStatusId: args.offlineMonitorStatusId,
698
+ incidentSeverityId: args.defaultIncidentSeverityId,
699
+ alertSeverityId: args.defaultAlertSeverityId,
700
+ monitorName: args.monitorName,
701
+ metricAlias,
702
+ filterType: FilterType.GreaterThan,
703
+ value: 0,
704
+ incidentTitle: `[Proxmox] CRITICAL: Replication Failing - ${args.monitorName}`,
705
+ incidentDescription: `A Proxmox storage replication job is reporting failed syncs (pve_replication_failed_syncs > 0). The guest's replica on the target node is going stale — a failover now would lose every write since the last successful sync. Check the root cause for the affected replication job id, then inspect the job's log on the source node (Datacenter → Replication) for the failure reason — common causes are a full target storage, an offline target node, or a broken SSH trust between nodes.`,
706
+ criteriaName: "Replication Failing - Failed Syncs > 0",
707
+ criteriaDescription: "Triggers when any replication job reports one or more failed syncs over the monitoring window.",
708
+ }),
709
+ onlineCriteriaInstance: buildProxmoxOnlineCriteriaInstance({
710
+ onlineMonitorStatusId: args.onlineMonitorStatusId,
711
+ metricAlias,
712
+ filterType: FilterType.EqualTo,
713
+ value: 0,
714
+ }),
715
+ });
716
+ },
717
+ };
718
+ export function getAllProxmoxAlertTemplates() {
719
+ return [
720
+ nodeOfflineTemplate,
721
+ guestDownTemplate,
722
+ quorumRiskTemplate,
723
+ nodeHighCpuTemplate,
724
+ nodeHighMemoryTemplate,
725
+ guestHighCpuTemplate,
726
+ storageNearFullTemplate,
727
+ lxcDiskNearFullTemplate,
728
+ haStateErrorTemplate,
729
+ guestNotBackedUpTemplate,
730
+ replicationFailingTemplate,
731
+ ];
732
+ }
733
+ export function getProxmoxAlertTemplatesByCategory(category) {
734
+ return getAllProxmoxAlertTemplates().filter((template) => {
735
+ return template.category === category;
736
+ });
737
+ }
738
+ export function getProxmoxAlertTemplateById(id) {
739
+ return getAllProxmoxAlertTemplates().find((template) => {
740
+ return template.id === id;
741
+ });
742
+ }
743
+ //# sourceMappingURL=ProxmoxAlertTemplates.js.map