dbabrain 0.1.0__tar.gz

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 (513) hide show
  1. dbabrain-0.1.0/LICENSE +201 -0
  2. dbabrain-0.1.0/NOTICE +57 -0
  3. dbabrain-0.1.0/PKG-INFO +297 -0
  4. dbabrain-0.1.0/README.md +246 -0
  5. dbabrain-0.1.0/db_ops/__init__.py +8 -0
  6. dbabrain-0.1.0/db_ops/cli.py +495 -0
  7. dbabrain-0.1.0/db_ops/common/__init__.py +1 -0
  8. dbabrain-0.1.0/db_ops/common/backup/__init__.py +129 -0
  9. dbabrain-0.1.0/db_ops/common/backup/spec.py +209 -0
  10. dbabrain-0.1.0/db_ops/common/backup_scripts/oracle/oracle_rman_archivelog.sh +114 -0
  11. dbabrain-0.1.0/db_ops/common/backup_scripts/oracle/oracle_rman_database.sh +119 -0
  12. dbabrain-0.1.0/db_ops/common/backup_scripts/postgresql/pg_archive_wal.sh +116 -0
  13. dbabrain-0.1.0/db_ops/common/backup_scripts/postgresql/pg_basebackup_database.sh +152 -0
  14. dbabrain-0.1.0/db_ops/common/backup_scripts/sqlserver/mssql_backup_database.ps1 +274 -0
  15. dbabrain-0.1.0/db_ops/common/backup_scripts/sqlserver/mssql_backup_database.sh +224 -0
  16. dbabrain-0.1.0/db_ops/common/backupfiles/__init__.py +171 -0
  17. dbabrain-0.1.0/db_ops/common/backupfiles/oracle.py +113 -0
  18. dbabrain-0.1.0/db_ops/common/backupfiles/postgresql.py +54 -0
  19. dbabrain-0.1.0/db_ops/common/backupfiles/sqlserver.py +83 -0
  20. dbabrain-0.1.0/db_ops/common/cli.py +1671 -0
  21. dbabrain-0.1.0/db_ops/common/cli_backup.py +120 -0
  22. dbabrain-0.1.0/db_ops/common/cli_backup_files.py +237 -0
  23. dbabrain-0.1.0/db_ops/common/cli_catalog.py +230 -0
  24. dbabrain-0.1.0/db_ops/common/cli_delete_files.py +137 -0
  25. dbabrain-0.1.0/db_ops/common/cli_filetransfer.py +106 -0
  26. dbabrain-0.1.0/db_ops/common/cli_restore.py +106 -0
  27. dbabrain-0.1.0/db_ops/common/cli_restorestep.py +168 -0
  28. dbabrain-0.1.0/db_ops/common/config_admin.py +887 -0
  29. dbabrain-0.1.0/db_ops/common/confirm.py +341 -0
  30. dbabrain-0.1.0/db_ops/common/data_sources/__init__.py +461 -0
  31. dbabrain-0.1.0/db_ops/common/data_sources/metric_targets.py +118 -0
  32. dbabrain-0.1.0/db_ops/common/data_sources/ssh_auth.py +98 -0
  33. dbabrain-0.1.0/db_ops/common/data_sources/target_resolve.py +238 -0
  34. dbabrain-0.1.0/db_ops/common/db_catalog.py +534 -0
  35. dbabrain-0.1.0/db_ops/common/db_connect.py +408 -0
  36. dbabrain-0.1.0/db_ops/common/deletefiles.py +233 -0
  37. dbabrain-0.1.0/db_ops/common/evidence.py +254 -0
  38. dbabrain-0.1.0/db_ops/common/file_transfer.py +685 -0
  39. dbabrain-0.1.0/db_ops/common/filetransfer.py +204 -0
  40. dbabrain-0.1.0/db_ops/common/host_ops.py +1443 -0
  41. dbabrain-0.1.0/db_ops/common/host_probe.py +213 -0
  42. dbabrain-0.1.0/db_ops/common/hostcmd.py +395 -0
  43. dbabrain-0.1.0/db_ops/common/identifier_scan.py +528 -0
  44. dbabrain-0.1.0/db_ops/common/job_control.py +180 -0
  45. dbabrain-0.1.0/db_ops/common/oracle_bridge.py +527 -0
  46. dbabrain-0.1.0/db_ops/common/password_rotation.py +470 -0
  47. dbabrain-0.1.0/db_ops/common/remote_exec.py +1209 -0
  48. dbabrain-0.1.0/db_ops/common/restore/__init__.py +48 -0
  49. dbabrain-0.1.0/db_ops/common/restore/sqlserver/__init__.py +28 -0
  50. dbabrain-0.1.0/db_ops/common/restore/sqlserver/chain.py +180 -0
  51. dbabrain-0.1.0/db_ops/common/restore/sqlserver/runner.py +177 -0
  52. dbabrain-0.1.0/db_ops/common/restore/sqlserver/sql.py +90 -0
  53. dbabrain-0.1.0/db_ops/common/restore/sqlserver/timeparse.py +59 -0
  54. dbabrain-0.1.0/db_ops/common/restore_drill.py +154 -0
  55. dbabrain-0.1.0/db_ops/common/restore_scripts/oracle/oracle_rman_restore.sh +282 -0
  56. dbabrain-0.1.0/db_ops/common/restore_scripts/postgresql/pg_restore_basebackup.sh +344 -0
  57. dbabrain-0.1.0/db_ops/common/restore_scripts/sqlserver/mssql_restore.sh +240 -0
  58. dbabrain-0.1.0/db_ops/common/restorekey.py +110 -0
  59. dbabrain-0.1.0/db_ops/common/restoremetadata.py +113 -0
  60. dbabrain-0.1.0/db_ops/common/restorestep/__init__.py +83 -0
  61. dbabrain-0.1.0/db_ops/common/restorestep/oracle.py +192 -0
  62. dbabrain-0.1.0/db_ops/common/restorestep/postgresql.py +318 -0
  63. dbabrain-0.1.0/db_ops/common/restorestep/sqlserver.py +107 -0
  64. dbabrain-0.1.0/db_ops/common/secret_check.py +433 -0
  65. dbabrain-0.1.0/db_ops/common/session_trace.py +238 -0
  66. dbabrain-0.1.0/db_ops/common/sql_execution.py +719 -0
  67. dbabrain-0.1.0/db_ops/common/sql_run.py +920 -0
  68. dbabrain-0.1.0/db_ops/common/sqlserver_emergency.py +428 -0
  69. dbabrain-0.1.0/db_ops/common/sqlserver_instance.py +1591 -0
  70. dbabrain-0.1.0/db_ops/common/sqlserver_patch.py +804 -0
  71. dbabrain-0.1.0/db_ops/common/ssh.py +119 -0
  72. dbabrain-0.1.0/db_ops/common/table_load.py +499 -0
  73. dbabrain-0.1.0/db_ops/common/verifyrestore.py +129 -0
  74. dbabrain-0.1.0/db_ops/config.py +792 -0
  75. dbabrain-0.1.0/db_ops/db/__init__.py +3 -0
  76. dbabrain-0.1.0/db_ops/db/backend.py +759 -0
  77. dbabrain-0.1.0/db_ops/db/backup_restore_history.py +141 -0
  78. dbabrain-0.1.0/db_ops/db/cli.py +1194 -0
  79. dbabrain-0.1.0/db_ops/db/config_edit.py +242 -0
  80. dbabrain-0.1.0/db_ops/db/config_store.py +640 -0
  81. dbabrain-0.1.0/db_ops/db/config_sync.py +642 -0
  82. dbabrain-0.1.0/db_ops/db/declaration.py +130 -0
  83. dbabrain-0.1.0/db_ops/db/job_runs.py +60 -0
  84. dbabrain-0.1.0/db_ops/db/metric_definitions.py +30 -0
  85. dbabrain-0.1.0/db_ops/db/metric_results.py +57 -0
  86. dbabrain-0.1.0/db_ops/db/metric_store.py +1027 -0
  87. dbabrain-0.1.0/db_ops/db/ops_status.py +438 -0
  88. dbabrain-0.1.0/db_ops/db/postgres_store.py +280 -0
  89. dbabrain-0.1.0/db_ops/db/queue_message.py +137 -0
  90. dbabrain-0.1.0/db_ops/db/run_requests.py +355 -0
  91. dbabrain-0.1.0/db_ops/db/schema_export.py +148 -0
  92. dbabrain-0.1.0/db_ops/db/sla_results.py +94 -0
  93. dbabrain-0.1.0/db_ops/db/sla_store.py +367 -0
  94. dbabrain-0.1.0/db_ops/db/sqlite_to_postgres.py +1188 -0
  95. dbabrain-0.1.0/db_ops/db/store.py +2538 -0
  96. dbabrain-0.1.0/db_ops/db/telegram_queue.py +209 -0
  97. dbabrain-0.1.0/db_ops/db/web_auth_store.py +645 -0
  98. dbabrain-0.1.0/db_ops/jobs/__init__.py +3 -0
  99. dbabrain-0.1.0/db_ops/jobs/cli.py +32 -0
  100. dbabrain-0.1.0/db_ops/jobs/daemon.py +1317 -0
  101. dbabrain-0.1.0/db_ops/jobs/models.py +4 -0
  102. dbabrain-0.1.0/db_ops/jobs/status.py +149 -0
  103. dbabrain-0.1.0/db_ops/levels.py +29 -0
  104. dbabrain-0.1.0/db_ops/lib/__init__.py +24 -0
  105. dbabrain-0.1.0/db_ops/lib/backup_kinds.py +25 -0
  106. dbabrain-0.1.0/db_ops/lib/backup_level.py +43 -0
  107. dbabrain-0.1.0/db_ops/lib/backup_policy.py +283 -0
  108. dbabrain-0.1.0/db_ops/lib/backupfiles_retention.py +186 -0
  109. dbabrain-0.1.0/db_ops/lib/capacity_forecast.py +220 -0
  110. dbabrain-0.1.0/db_ops/lib/cmd_access.py +147 -0
  111. dbabrain-0.1.0/db_ops/lib/coerce.py +115 -0
  112. dbabrain-0.1.0/db_ops/lib/common_cli.py +120 -0
  113. dbabrain-0.1.0/db_ops/lib/connection_spec.py +157 -0
  114. dbabrain-0.1.0/db_ops/lib/delimited_import.py +229 -0
  115. dbabrain-0.1.0/db_ops/lib/distribution.py +220 -0
  116. dbabrain-0.1.0/db_ops/lib/event_policy.py +133 -0
  117. dbabrain-0.1.0/db_ops/lib/health_model.py +218 -0
  118. dbabrain-0.1.0/db_ops/lib/instance_bundle.py +55 -0
  119. dbabrain-0.1.0/db_ops/lib/interval_rates.py +38 -0
  120. dbabrain-0.1.0/db_ops/lib/inventory_render.py +575 -0
  121. dbabrain-0.1.0/db_ops/lib/json_io.py +100 -0
  122. dbabrain-0.1.0/db_ops/lib/listing.py +89 -0
  123. dbabrain-0.1.0/db_ops/lib/log_tail.py +230 -0
  124. dbabrain-0.1.0/db_ops/lib/metric_score.py +18 -0
  125. dbabrain-0.1.0/db_ops/lib/notify.py +239 -0
  126. dbabrain-0.1.0/db_ops/lib/notify_route.py +107 -0
  127. dbabrain-0.1.0/db_ops/lib/paths.py +219 -0
  128. dbabrain-0.1.0/db_ops/lib/policy_engine.py +376 -0
  129. dbabrain-0.1.0/db_ops/lib/powershell.py +116 -0
  130. dbabrain-0.1.0/db_ops/lib/record_form.py +300 -0
  131. dbabrain-0.1.0/db_ops/lib/report_archive.py +79 -0
  132. dbabrain-0.1.0/db_ops/lib/response.py +104 -0
  133. dbabrain-0.1.0/db_ops/lib/restore/__init__.py +31 -0
  134. dbabrain-0.1.0/db_ops/lib/restore/pitr.py +35 -0
  135. dbabrain-0.1.0/db_ops/lib/restore/plan.py +59 -0
  136. dbabrain-0.1.0/db_ops/lib/restore/spec.py +224 -0
  137. dbabrain-0.1.0/db_ops/lib/result_format.py +319 -0
  138. dbabrain-0.1.0/db_ops/lib/rows.py +41 -0
  139. dbabrain-0.1.0/db_ops/lib/secret_text.py +309 -0
  140. dbabrain-0.1.0/db_ops/lib/shell.py +64 -0
  141. dbabrain-0.1.0/db_ops/lib/sql_access.py +91 -0
  142. dbabrain-0.1.0/db_ops/lib/sql_text.py +193 -0
  143. dbabrain-0.1.0/db_ops/lib/ssh_errors.py +34 -0
  144. dbabrain-0.1.0/db_ops/lib/state_transition.py +239 -0
  145. dbabrain-0.1.0/db_ops/lib/target_flags.py +39 -0
  146. dbabrain-0.1.0/db_ops/lib/target_profile.py +512 -0
  147. dbabrain-0.1.0/db_ops/lib/task_output.py +48 -0
  148. dbabrain-0.1.0/db_ops/lib/telegram_route.py +112 -0
  149. dbabrain-0.1.0/db_ops/lib/telegram_severity.py +217 -0
  150. dbabrain-0.1.0/db_ops/lib/telegram_text.py +90 -0
  151. dbabrain-0.1.0/db_ops/lib/text_format.py +25 -0
  152. dbabrain-0.1.0/db_ops/lib/time_window.py +303 -0
  153. dbabrain-0.1.0/db_ops/lib/web_auth.py +200 -0
  154. dbabrain-0.1.0/db_ops/lib/xlsx_export.py +223 -0
  155. dbabrain-0.1.0/db_ops/lib/xlsx_import.py +371 -0
  156. dbabrain-0.1.0/db_ops/logging_ops/__init__.py +33 -0
  157. dbabrain-0.1.0/db_ops/logging_ops/formatter.py +10 -0
  158. dbabrain-0.1.0/db_ops/logging_ops/handlers.py +94 -0
  159. dbabrain-0.1.0/db_ops/logging_ops/runtime_stdout.py +73 -0
  160. dbabrain-0.1.0/db_ops/logging_ops/writer.py +113 -0
  161. dbabrain-0.1.0/db_ops/metrics/__init__.py +23 -0
  162. dbabrain-0.1.0/db_ops/metrics/cli.py +670 -0
  163. dbabrain-0.1.0/db_ops/metrics/collector.py +1498 -0
  164. dbabrain-0.1.0/db_ops/metrics/collectors/docker/009_docker_container_stats.sh +75 -0
  165. dbabrain-0.1.0/db_ops/metrics/collectors/mysql/001_mysql_instance_status.sql +6 -0
  166. dbabrain-0.1.0/db_ops/metrics/collectors/mysql/002_mysql_database_status.sql +9 -0
  167. dbabrain-0.1.0/db_ops/metrics/collectors/mysql/003_mysql_connections.sql +15 -0
  168. dbabrain-0.1.0/db_ops/metrics/collectors/mysql/004_mysql_long_running_queries.sql +10 -0
  169. dbabrain-0.1.0/db_ops/metrics/collectors/mysql/006_mysql_data_file_space.sql +14 -0
  170. dbabrain-0.1.0/db_ops/metrics/collectors/mysql/009_mysql_blocking_sessions.sql +19 -0
  171. dbabrain-0.1.0/db_ops/metrics/collectors/mysql/014_mysql_wait_stats.sql +11 -0
  172. dbabrain-0.1.0/db_ops/metrics/collectors/mysql/050_mysql_user_permissions.sql +40 -0
  173. dbabrain-0.1.0/db_ops/metrics/collectors/mysql/051_mysql_constraint_health.sql +44 -0
  174. dbabrain-0.1.0/db_ops/metrics/collectors/mysql/052_mysql_database_data_size.sql +29 -0
  175. dbabrain-0.1.0/db_ops/metrics/collectors/mysql/053_mysql_table_fragmentation.sql +56 -0
  176. dbabrain-0.1.0/db_ops/metrics/collectors/mysql/054_mysql_statistics_age.sql +53 -0
  177. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/001_oracle_instance_status.sql +7 -0
  178. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/002_oracle_database_status.sql +65 -0
  179. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/003_oracle_sessions.sql +13 -0
  180. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/004_oracle_long_running_queries.sql +15 -0
  181. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/005_oracle_backup_age.sql +49 -0
  182. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/006_oracle_data_file_space.sql +57 -0
  183. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/007_oracle_archive_log_space.sql +89 -0
  184. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/009_oracle_blocking_sessions.sql +12 -0
  185. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/009_oracle_temp_usage.sql +14 -0
  186. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/011_oracle_dataguard_health.sql +116 -0
  187. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/014_oracle_wait_stats.sql +15 -0
  188. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/016_oracle_backup_job_status.sql +49 -0
  189. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/017_oracle_alertlog_recent_critical.sql +33 -0
  190. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/018_oracle_redo_reuse_wait.sql +73 -0
  191. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/019_oracle_io_latency.sql +19 -0
  192. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/022_oracle_last_backup_result.sql +89 -0
  193. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/024_oracle_sleeping_open_transaction.sql +62 -0
  194. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/061_oracle_index_health.sql +90 -0
  195. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/061_oracle_user_permissions.sql +38 -0
  196. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/062_oracle_constraint_health.sql +69 -0
  197. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/064_oracle_statistics_age.sql +56 -0
  198. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/065_oracle_top_disk_read_sql.sql +28 -0
  199. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/066_oracle_top_buffer_gets_sql.sql +29 -0
  200. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/067_oracle_index_unusable.sql +49 -0
  201. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/068_oracle_invalid_objects.sql +37 -0
  202. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/069_oracle_top_segments.sql +36 -0
  203. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/070_oracle_scheduler_jobs.sql +39 -0
  204. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/071_oracle_index_inventory.sql +85 -0
  205. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/201_oracle_backup_health.sh +160 -0
  206. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/202_oracle_restore_validation.sh +81 -0
  207. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/001_oracle_instance_status.sql +9 -0
  208. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/002_oracle_database_status.sql +22 -0
  209. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/003_oracle_sessions.sql +26 -0
  210. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/004_oracle_long_running_queries.sql +17 -0
  211. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/006_oracle_data_file_space.sql +12 -0
  212. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/008_oracle_temp_usage.sql +40 -0
  213. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/009_oracle_blocking_sessions.sql +14 -0
  214. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/014_oracle_wait_stats.sql +20 -0
  215. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/019_oracle_io_latency.sql +15 -0
  216. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/101_oracle_tablespace_free.sql +79 -0
  217. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/102_oracle_process_limit.sql +18 -0
  218. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/103_oracle_shared_pool_free.sql +16 -0
  219. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/104_oracle_library_cache.sql +15 -0
  220. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/105_oracle_buffer_cache_hit.sql +18 -0
  221. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/106_oracle_top_disk_read_sql.sql +16 -0
  222. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/107_oracle_top_buffer_gets_sql.sql +31 -0
  223. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/108_oracle_segment_extent_limit.sql +39 -0
  224. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/109_oracle_statistics_age.sql +35 -0
  225. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/110_oracle_archive_dest.sql +67 -0
  226. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/111_oracle_rollback_contention.sql +36 -0
  227. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/112_oracle_jobs.sql +43 -0
  228. dbabrain-0.1.0/db_ops/metrics/collectors/oracle/legacy_8i/113_oracle_dead_sessions_and_threads.sql +78 -0
  229. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/001_os_cpu_usage.sh +48 -0
  230. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/002_os_memory_usage.sh +59 -0
  231. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/003_os_disk_usage.sh +48 -0
  232. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/004_os_top_processes.sh +12 -0
  233. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/005_os_service_status.sh +80 -0
  234. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/006_os_reboot_pending.sh +15 -0
  235. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/007_os_uptime.sh +13 -0
  236. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/008_os_time_sync.sh +16 -0
  237. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/009_os_tcp_port_status.sh +127 -0
  238. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/010_os_info.sh +31 -0
  239. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/011_os_network.sh +67 -0
  240. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/012_os_eventlog_critical.sh +38 -0
  241. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/013_os_process_top_cpu.sh +20 -0
  242. dbabrain-0.1.0/db_ops/metrics/collectors/os/linux/014_os_process_top_memory.sh +23 -0
  243. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/001_os_cpu_usage.ps1 +37 -0
  244. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/002_os_memory_usage.ps1 +42 -0
  245. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/003_os_disk_usage.ps1 +98 -0
  246. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/004_os_top_processes.ps1 +19 -0
  247. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/005_os_service_status.ps1 +32 -0
  248. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/006_os_reboot_pending.ps1 +16 -0
  249. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/007_os_uptime.ps1 +14 -0
  250. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/008_os_time_sync.ps1 +53 -0
  251. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/009_os_tcp_port_status.ps1 +149 -0
  252. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/010_os_info.ps1 +21 -0
  253. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/011_os_network.ps1 +73 -0
  254. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/012_os_eventlog_critical.ps1 +95 -0
  255. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/013_os_process_top_cpu.ps1 +52 -0
  256. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/014_os_process_top_memory.ps1 +31 -0
  257. dbabrain-0.1.0/db_ops/metrics/collectors/os/windows/015_os_failover_cluster.ps1 +191 -0
  258. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/001_postgresql_instance_status.sql +8 -0
  259. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/002_postgresql_database_status.sql +16 -0
  260. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/003_postgresql_connections.sql +15 -0
  261. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/004_postgresql_long_running_queries.sql +18 -0
  262. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/006_postgresql_database_size.sql +10 -0
  263. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/009_postgresql_blocking_sessions.sql +16 -0
  264. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/022_postgresql_last_backup_result.sh +129 -0
  265. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/050_postgresql_replication.sql +97 -0
  266. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/051_postgresql_identity_role.sql +6 -0
  267. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/052_postgresql_replication_slots.sql +10 -0
  268. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/053_postgresql_wal_archive.sql +6 -0
  269. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/054_postgresql_transactions.sql +7 -0
  270. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/055_postgresql_vacuum_health.sql +7 -0
  271. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/056_postgresql_xid_wraparound.sql +6 -0
  272. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/057_postgresql_database_health.sql +7 -0
  273. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/058_postgresql_invalid_indexes.sql +4 -0
  274. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/059_postgresql_role_permissions.sql +53 -0
  275. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/060_postgresql_constraint_health.sql +54 -0
  276. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/061_postgresql_database_data_size.sql +28 -0
  277. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/062_postgresql_table_bloat.sql +56 -0
  278. dbabrain-0.1.0/db_ops/metrics/collectors/postgresql/072_postgresql_index_usage.sql +183 -0
  279. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/001_sqlserver_instance_status.sql +39 -0
  280. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/002_sqlserver_database_status.sql +31 -0
  281. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/003_sqlserver_connections.sql +17 -0
  282. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/004_sqlserver_long_running_queries.sql +130 -0
  283. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/005_sqlserver_backup_age.sql +41 -0
  284. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/006_sqlserver_data_file_space.sql +132 -0
  285. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/007_sqlserver_log_space.sql +96 -0
  286. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/008_sqlserver_tempdb_space.sql +41 -0
  287. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/009_sqlserver_blocking_sessions.sql +136 -0
  288. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/010_sqlserver_agent_failed_jobs.sql +108 -0
  289. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/011_sqlserver_ag_database_health.sql +29 -0
  290. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/012_sqlserver_cpu_memory.sql +217 -0
  291. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/013_sqlserver_disk_free_space.sql +54 -0
  292. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/014_sqlserver_wait_stats.sql +71 -0
  293. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/015_sqlserver_deadlock_recent.sql +39 -0
  294. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/016_sqlserver_backup_job_status.sql +154 -0
  295. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/017_sqlserver_errorlog_recent_critical.sql +249 -0
  296. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/018_sqlserver_log_reuse_wait.sql +49 -0
  297. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/019_sqlserver_io_latency.sql +107 -0
  298. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/021_sqlserver_suspect_pages.sql +45 -0
  299. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/022_sqlserver_last_backup_result.sql +87 -0
  300. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/023_sqlserver_query_store_query_issues.sql +416 -0
  301. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/024_sqlserver_sleeping_open_transaction.sql +167 -0
  302. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/025_sqlserver_transaction_lock_holders.sql +221 -0
  303. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/026_long_waiting_or_rollback_requests.sql +241 -0
  304. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/050_sqlserver_configuration.sql +24 -0
  305. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/051_sqlserver_database_config.sql +22 -0
  306. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/052_sqlserver_page_life_expectancy.sql +11 -0
  307. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/053_sqlserver_agent_job_inventory.sql +122 -0
  308. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/054_sqlserver_database_checkdb.sql +131 -0
  309. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/055_sqlserver_file_placement.sql +21 -0
  310. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/056_sqlserver_agent_job_runtime.sql +91 -0
  311. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/057_sqlserver_database_user_permissions.sql +118 -0
  312. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/058_sqlserver_constraint_health.sql +135 -0
  313. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/059_sqlserver_certificate_expiry.sql +67 -0
  314. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/060_sqlserver_failed_logins.sql +73 -0
  315. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/061_sqlserver_index_fragmentation.sql +67 -0
  316. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/062_sqlserver_statistics_age.sql +62 -0
  317. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/063_sqlserver_login_health.sql +147 -0
  318. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/064_sqlserver_database_data_size.sql +36 -0
  319. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/065_sqlserver_database_log_size.sql +30 -0
  320. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/066_sqlserver_heap_fragmentation.sql +92 -0
  321. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/067_sqlserver_vlf_count.sql +67 -0
  322. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/068_sqlserver_index_usage.sql +304 -0
  323. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/069_sqlserver_linked_server_status.sql +206 -0
  324. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/070_sqlserver_query_store_coverage.sql +221 -0
  325. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/071_sqlserver_server_principals.sql +99 -0
  326. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/001_sqlserver_instance_status.sql +35 -0
  327. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/002_sqlserver_database_status.sql +32 -0
  328. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/003_sqlserver_connections.sql +15 -0
  329. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/004_sqlserver_long_running_queries.sql +128 -0
  330. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/005_sqlserver_backup_age.sql +37 -0
  331. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/006_sqlserver_data_file_space.sql +50 -0
  332. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/007_sqlserver_log_space.sql +37 -0
  333. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/008_sqlserver_tempdb_space.sql +53 -0
  334. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/009_sqlserver_blocking_sessions.sql +37 -0
  335. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/010_sqlserver_agent_failed_jobs.sql +79 -0
  336. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/011_sqlserver_ag_database_health.sql +6 -0
  337. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/012_sqlserver_cpu_memory.sql +217 -0
  338. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/013_sqlserver_disk_free_space.sql +24 -0
  339. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/014_sqlserver_wait_stats.sql +28 -0
  340. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/015_sqlserver_deadlock_recent.sql +6 -0
  341. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/016_sqlserver_backup_job_status.sql +103 -0
  342. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/017_sqlserver_errorlog_recent_critical.sql +249 -0
  343. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/018_sqlserver_log_reuse_wait.sql +39 -0
  344. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/019_sqlserver_io_latency.sql +87 -0
  345. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/021_sqlserver_suspect_pages.sql +45 -0
  346. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/022_sqlserver_last_backup_result.sql +87 -0
  347. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/023_sqlserver_query_store_query_issues.sql +11 -0
  348. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/024_sqlserver_sleeping_open_transaction.sql +33 -0
  349. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/025_sqlserver_transaction_lock_holders.sql +154 -0
  350. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/026_long_waiting_or_rollback_requests.sql +241 -0
  351. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/054_sqlserver_database_checkdb.sql +136 -0
  352. dbabrain-0.1.0/db_ops/metrics/collectors/sqlserver/legacy_2008r2/069_sqlserver_linked_server_status.sql +189 -0
  353. dbabrain-0.1.0/db_ops/metrics/definitions.py +319 -0
  354. dbabrain-0.1.0/db_ops/metrics/executor.py +307 -0
  355. dbabrain-0.1.0/db_ops/metrics/health.py +83 -0
  356. dbabrain-0.1.0/db_ops/metrics/importance.py +96 -0
  357. dbabrain-0.1.0/db_ops/metrics/message.py +68 -0
  358. dbabrain-0.1.0/db_ops/metrics/models.py +148 -0
  359. dbabrain-0.1.0/db_ops/metrics/notify.py +28 -0
  360. dbabrain-0.1.0/db_ops/metrics/storage.py +29 -0
  361. dbabrain-0.1.0/db_ops/metrics/targets.py +293 -0
  362. dbabrain-0.1.0/db_ops/scaffold.py +495 -0
  363. dbabrain-0.1.0/db_ops/telegram/__init__.py +43 -0
  364. dbabrain-0.1.0/db_ops/telegram/api.py +316 -0
  365. dbabrain-0.1.0/db_ops/telegram/cli.py +219 -0
  366. dbabrain-0.1.0/db_ops/telegram/client.py +38 -0
  367. dbabrain-0.1.0/db_ops/telegram/command_processor.py +3239 -0
  368. dbabrain-0.1.0/db_ops/telegram/commands.py +41 -0
  369. dbabrain-0.1.0/db_ops/telegram/metrics_reports.py +93 -0
  370. dbabrain-0.1.0/db_ops/telegram/routing.py +75 -0
  371. dbabrain-0.1.0/db_ops/telegram/send_queue.py +132 -0
  372. dbabrain-0.1.0/db_ops/telegram/severity.py +32 -0
  373. dbabrain-0.1.0/db_ops/telegram/sql_commands.py +201 -0
  374. dbabrain-0.1.0/db_ops/telegram/updates.py +251 -0
  375. dbabrain-0.1.0/db_ops/telegram/workflow.py +75 -0
  376. dbabrain-0.1.0/dbabrain.egg-info/PKG-INFO +297 -0
  377. dbabrain-0.1.0/dbabrain.egg-info/SOURCES.txt +511 -0
  378. dbabrain-0.1.0/dbabrain.egg-info/dependency_links.txt +1 -0
  379. dbabrain-0.1.0/dbabrain.egg-info/entry_points.txt +2 -0
  380. dbabrain-0.1.0/dbabrain.egg-info/requires.txt +33 -0
  381. dbabrain-0.1.0/dbabrain.egg-info/top_level.txt +1 -0
  382. dbabrain-0.1.0/pyproject.toml +185 -0
  383. dbabrain-0.1.0/setup.cfg +4 -0
  384. dbabrain-0.1.0/tests/test_app_common_imports.py +296 -0
  385. dbabrain-0.1.0/tests/test_app_database_drivers.py +112 -0
  386. dbabrain-0.1.0/tests/test_asset_lookup.py +142 -0
  387. dbabrain-0.1.0/tests/test_backup_files_listing.py +347 -0
  388. dbabrain-0.1.0/tests/test_backup_retention.py +236 -0
  389. dbabrain-0.1.0/tests/test_backup_spec_api.py +251 -0
  390. dbabrain-0.1.0/tests/test_capacity_forecast.py +143 -0
  391. dbabrain-0.1.0/tests/test_checkdb_legacy_variant.py +123 -0
  392. dbabrain-0.1.0/tests/test_cli_dispatch.py +134 -0
  393. dbabrain-0.1.0/tests/test_collector_env_secrets.py +84 -0
  394. dbabrain-0.1.0/tests/test_common_cli_json_contract.py +131 -0
  395. dbabrain-0.1.0/tests/test_common_cli_listing.py +62 -0
  396. dbabrain-0.1.0/tests/test_common_cli_response_shape.py +166 -0
  397. dbabrain-0.1.0/tests/test_common_db_catalog.py +249 -0
  398. dbabrain-0.1.0/tests/test_common_db_connect.py +275 -0
  399. dbabrain-0.1.0/tests/test_common_delimited_import.py +257 -0
  400. dbabrain-0.1.0/tests/test_common_layers.py +168 -0
  401. dbabrain-0.1.0/tests/test_common_remote_exec.py +475 -0
  402. dbabrain-0.1.0/tests/test_common_response_shape.py +208 -0
  403. dbabrain-0.1.0/tests/test_common_restore_is_pure.py +114 -0
  404. dbabrain-0.1.0/tests/test_common_sql_run.py +893 -0
  405. dbabrain-0.1.0/tests/test_common_table_load.py +226 -0
  406. dbabrain-0.1.0/tests/test_common_xlsx_import.py +289 -0
  407. dbabrain-0.1.0/tests/test_config_edit.py +309 -0
  408. dbabrain-0.1.0/tests/test_config_resolution.py +372 -0
  409. dbabrain-0.1.0/tests/test_config_sync.py +389 -0
  410. dbabrain-0.1.0/tests/test_confirm.py +164 -0
  411. dbabrain-0.1.0/tests/test_db_cli_json_contract.py +188 -0
  412. dbabrain-0.1.0/tests/test_delete_files.py +258 -0
  413. dbabrain-0.1.0/tests/test_dispatcher_lists_what_is_installed.py +121 -0
  414. dbabrain-0.1.0/tests/test_docker_stats.py +110 -0
  415. dbabrain-0.1.0/tests/test_docs_cover_every_component.py +132 -0
  416. dbabrain-0.1.0/tests/test_docs_name_paths_that_exist.py +204 -0
  417. dbabrain-0.1.0/tests/test_driver_fallback.py +215 -0
  418. dbabrain-0.1.0/tests/test_emergency_operations.py +218 -0
  419. dbabrain-0.1.0/tests/test_evidence.py +90 -0
  420. dbabrain-0.1.0/tests/test_file_transfer.py +154 -0
  421. dbabrain-0.1.0/tests/test_filetransfer.py +167 -0
  422. dbabrain-0.1.0/tests/test_health_summary_formats.py +137 -0
  423. dbabrain-0.1.0/tests/test_host_ops.py +582 -0
  424. dbabrain-0.1.0/tests/test_host_probe.py +148 -0
  425. dbabrain-0.1.0/tests/test_host_runtime_and_dialect.py +175 -0
  426. dbabrain-0.1.0/tests/test_hostcmd_runtime.py +224 -0
  427. dbabrain-0.1.0/tests/test_identifier_scan.py +244 -0
  428. dbabrain-0.1.0/tests/test_import_boundaries.py +290 -0
  429. dbabrain-0.1.0/tests/test_instance_metadata_export_resilience.py +161 -0
  430. dbabrain-0.1.0/tests/test_instance_status_collection_outcomes.py +189 -0
  431. dbabrain-0.1.0/tests/test_interval_rates.py +45 -0
  432. dbabrain-0.1.0/tests/test_job_control.py +176 -0
  433. dbabrain-0.1.0/tests/test_job_runs_archive.py +151 -0
  434. dbabrain-0.1.0/tests/test_jobs_daemon.py +900 -0
  435. dbabrain-0.1.0/tests/test_lib_is_pure.py +169 -0
  436. dbabrain-0.1.0/tests/test_listing.py +97 -0
  437. dbabrain-0.1.0/tests/test_local_method_guard.py +66 -0
  438. dbabrain-0.1.0/tests/test_log_reuse_wait_severity.py +108 -0
  439. dbabrain-0.1.0/tests/test_log_tail.py +222 -0
  440. dbabrain-0.1.0/tests/test_logging_ops.py +62 -0
  441. dbabrain-0.1.0/tests/test_message_type_coverage.py +79 -0
  442. dbabrain-0.1.0/tests/test_metric_collection_parallelism.py +206 -0
  443. dbabrain-0.1.0/tests/test_metric_collectors.py +958 -0
  444. dbabrain-0.1.0/tests/test_metric_error_severity.py +262 -0
  445. dbabrain-0.1.0/tests/test_metric_error_type.py +71 -0
  446. dbabrain-0.1.0/tests/test_metric_storage.py +165 -0
  447. dbabrain-0.1.0/tests/test_metric_store.py +37 -0
  448. dbabrain-0.1.0/tests/test_metric_targets.py +307 -0
  449. dbabrain-0.1.0/tests/test_metric_timeouts.py +90 -0
  450. dbabrain-0.1.0/tests/test_metric_toggle_config_admin.py +240 -0
  451. dbabrain-0.1.0/tests/test_metrics_per_database_postgresql.py +172 -0
  452. dbabrain-0.1.0/tests/test_missing_driver_names_its_extra.py +93 -0
  453. dbabrain-0.1.0/tests/test_mssql_backup_scripts.py +180 -0
  454. dbabrain-0.1.0/tests/test_mssql_restore_piece_selection.py +143 -0
  455. dbabrain-0.1.0/tests/test_no_duplicate_definitions.py +211 -0
  456. dbabrain-0.1.0/tests/test_no_self_derived_project_root.py +77 -0
  457. dbabrain-0.1.0/tests/test_no_undefined_globals.py +103 -0
  458. dbabrain-0.1.0/tests/test_notify_route.py +178 -0
  459. dbabrain-0.1.0/tests/test_ops_status.py +362 -0
  460. dbabrain-0.1.0/tests/test_oracle_resilience.py +99 -0
  461. dbabrain-0.1.0/tests/test_oracle_restore_shutdown.py +52 -0
  462. dbabrain-0.1.0/tests/test_password_rotation.py +366 -0
  463. dbabrain-0.1.0/tests/test_query_store_alert_window.py +73 -0
  464. dbabrain-0.1.0/tests/test_record_form.py +236 -0
  465. dbabrain-0.1.0/tests/test_report_base_url_and_bridge_secret.py +108 -0
  466. dbabrain-0.1.0/tests/test_restore_drill.py +108 -0
  467. dbabrain-0.1.0/tests/test_restore_spec_api.py +179 -0
  468. dbabrain-0.1.0/tests/test_restore_steps.py +398 -0
  469. dbabrain-0.1.0/tests/test_result_format.py +190 -0
  470. dbabrain-0.1.0/tests/test_run_requests.py +285 -0
  471. dbabrain-0.1.0/tests/test_scaffold_first_run.py +206 -0
  472. dbabrain-0.1.0/tests/test_scheduler_concurrency.py +247 -0
  473. dbabrain-0.1.0/tests/test_secret_check.py +204 -0
  474. dbabrain-0.1.0/tests/test_secret_text.py +103 -0
  475. dbabrain-0.1.0/tests/test_self_contained_requests.py +185 -0
  476. dbabrain-0.1.0/tests/test_session_trace.py +190 -0
  477. dbabrain-0.1.0/tests/test_sleeping_open_transaction_grading.py +140 -0
  478. dbabrain-0.1.0/tests/test_sql_assets_split_cleanly.py +97 -0
  479. dbabrain-0.1.0/tests/test_sqlserver_instance.py +516 -0
  480. dbabrain-0.1.0/tests/test_sqlserver_patch.py +418 -0
  481. dbabrain-0.1.0/tests/test_sqlserver_restore_chain.py +252 -0
  482. dbabrain-0.1.0/tests/test_state_transition.py +152 -0
  483. dbabrain-0.1.0/tests/test_store_config.py +314 -0
  484. dbabrain-0.1.0/tests/test_store_declaration.py +162 -0
  485. dbabrain-0.1.0/tests/test_suite_needs_no_database_driver.py +111 -0
  486. dbabrain-0.1.0/tests/test_target_flags.py +37 -0
  487. dbabrain-0.1.0/tests/test_target_profile.py +305 -0
  488. dbabrain-0.1.0/tests/test_target_resolve.py +142 -0
  489. dbabrain-0.1.0/tests/test_tcp_port_probe.py +138 -0
  490. dbabrain-0.1.0/tests/test_telegram_add_sql.py +194 -0
  491. dbabrain-0.1.0/tests/test_telegram_background_probe.py +154 -0
  492. dbabrain-0.1.0/tests/test_telegram_command_claims.py +119 -0
  493. dbabrain-0.1.0/tests/test_telegram_command_permissions.py +185 -0
  494. dbabrain-0.1.0/tests/test_telegram_conversation_file_upload.py +52 -0
  495. dbabrain-0.1.0/tests/test_telegram_error_masking.py +129 -0
  496. dbabrain-0.1.0/tests/test_telegram_list_all_command.py +182 -0
  497. dbabrain-0.1.0/tests/test_telegram_message_type.py +175 -0
  498. dbabrain-0.1.0/tests/test_telegram_metric_history_command.py +309 -0
  499. dbabrain-0.1.0/tests/test_telegram_prompt_choices.py +182 -0
  500. dbabrain-0.1.0/tests/test_telegram_report_commands.py +723 -0
  501. dbabrain-0.1.0/tests/test_telegram_run_sql_task_command.py +137 -0
  502. dbabrain-0.1.0/tests/test_telegram_severity_emoji.py +274 -0
  503. dbabrain-0.1.0/tests/test_telegram_sql_export_format.py +87 -0
  504. dbabrain-0.1.0/tests/test_telegram_sql_support_commands.py +126 -0
  505. dbabrain-0.1.0/tests/test_telegram_sql_to_xlsx.py +701 -0
  506. dbabrain-0.1.0/tests/test_telegram_unknown_commands.py +147 -0
  507. dbabrain-0.1.0/tests/test_telegram_updates.py +63 -0
  508. dbabrain-0.1.0/tests/test_telegram_xlsx_to_table.py +355 -0
  509. dbabrain-0.1.0/tests/test_time_window.py +54 -0
  510. dbabrain-0.1.0/tests/test_time_window_config.py +299 -0
  511. dbabrain-0.1.0/tests/test_tool_root_resolution.py +131 -0
  512. dbabrain-0.1.0/tests/test_verify_and_metadata.py +160 -0
  513. dbabrain-0.1.0/tests/test_web_auth.py +415 -0
dbabrain-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
dbabrain-0.1.0/NOTICE ADDED
@@ -0,0 +1,57 @@
1
+ DBA Brain
2
+ Copyright 2026 Trieu Tan Thanh
3
+
4
+ This product includes software developed by Trieu Tan Thanh.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License");
7
+ you may not use this file except in compliance with the License.
8
+ You may obtain a copy of the License at
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Unless required by applicable law or agreed to in writing, software
13
+ distributed under the License is distributed on an "AS IS" BASIS,
14
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ See the License for the specific language governing permissions and
16
+ limitations under the License.
17
+
18
+ --------------------------------------------------------------------------------
19
+ Third-party dependencies
20
+ --------------------------------------------------------------------------------
21
+
22
+ DBA Brain does not bundle or modify its dependencies; they are installed from
23
+ PyPI by pip. Distributed container images, however, do contain them, so their
24
+ licenses are listed here.
25
+
26
+ Permissively licensed (Apache-2.0, BSD, MIT or equivalent):
27
+
28
+ cryptography Apache-2.0 OR BSD-3-Clause
29
+ oracledb UPL-1.0 OR Apache-2.0
30
+ pyodbc MIT
31
+ pg8000 BSD-3-Clause
32
+ PyMySQL MIT
33
+ PyYAML MIT
34
+ pypsrp MIT
35
+ psutil BSD-3-Clause
36
+ pytest MIT
37
+ bcrypt Apache-2.0
38
+ PyNaCl Apache-2.0
39
+ requests Apache-2.0
40
+
41
+ Weak copyleft — used as unmodified libraries, never linked statically and never
42
+ modified. Their own license terms continue to apply to them:
43
+
44
+ paramiko LGPL-2.1
45
+ pymssql LGPL-2.1
46
+ certifi MPL-2.0
47
+
48
+ Both LGPL components are optional in the sense that they serve specific
49
+ transports: paramiko provides SSH, and pymssql is the fallback SQL Server driver
50
+ for hosts where ODBC/TLS negotiation fails. Anyone redistributing a container
51
+ image that contains them inherits the LGPL obligation to make the corresponding
52
+ source of those libraries available and to allow them to be replaced with a
53
+ modified version; both are satisfied by shipping them unmodified from PyPI and
54
+ by this notice.
55
+
56
+ The full license text of every dependency is available in its distribution on
57
+ PyPI and in the site-packages directory of any installation.
@@ -0,0 +1,297 @@
1
+ Metadata-Version: 2.4
2
+ Name: dbabrain
3
+ Version: 0.1.0
4
+ Summary: Database operations toolkit: metrics, reports, scheduled SQL, backup/restore validation, SLA checks.
5
+ Author: Trieu Tan Thanh
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/tanthanhkaka01/dba-brain
8
+ Project-URL: Repository, https://github.com/tanthanhkaka01/dba-brain
9
+ Project-URL: Changelog, https://github.com/tanthanhkaka01/dba-brain/blob/main/CHANGELOG.md
10
+ Keywords: dba,database,sqlserver,oracle,postgresql,mysql,monitoring,operations
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Environment :: Console
13
+ Classifier: Intended Audience :: System Administrators
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Database
19
+ Classifier: Topic :: System :: Monitoring
20
+ Classifier: Topic :: System :: Systems Administration
21
+ Requires-Python: >=3.12
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ License-File: NOTICE
25
+ Requires-Dist: cryptography>=42.0.0
26
+ Requires-Dist: PyYAML>=6.0.2
27
+ Provides-Extra: mssql
28
+ Requires-Dist: pyodbc>=5.3.0; extra == "mssql"
29
+ Requires-Dist: pymssql>=2.3.13; extra == "mssql"
30
+ Provides-Extra: oracle
31
+ Requires-Dist: oracledb>=3.1.0; extra == "oracle"
32
+ Provides-Extra: postgres
33
+ Requires-Dist: pg8000>=1.31.0; extra == "postgres"
34
+ Provides-Extra: mysql
35
+ Requires-Dist: PyMySQL>=1.1.0; extra == "mysql"
36
+ Provides-Extra: ssh
37
+ Requires-Dist: paramiko>=3.0.0; extra == "ssh"
38
+ Provides-Extra: winrm
39
+ Requires-Dist: pypsrp; extra == "winrm"
40
+ Provides-Extra: all
41
+ Requires-Dist: pyodbc>=5.3.0; extra == "all"
42
+ Requires-Dist: pymssql>=2.3.13; extra == "all"
43
+ Requires-Dist: oracledb>=3.1.0; extra == "all"
44
+ Requires-Dist: pg8000>=1.31.0; extra == "all"
45
+ Requires-Dist: PyMySQL>=1.1.0; extra == "all"
46
+ Requires-Dist: paramiko>=3.0.0; extra == "all"
47
+ Requires-Dist: pypsrp; extra == "all"
48
+ Provides-Extra: dev
49
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
50
+ Dynamic: license-file
51
+
52
+ # DBA Brain
53
+
54
+ **A database operations toolkit for people who are on call.** It collects health metrics from your
55
+ SQL Server, Oracle, PostgreSQL and MySQL instances, grades them against policies you write, runs
56
+ your scheduled SQL, takes backups and *proves them by restoring them*, checks objectives against
57
+ real measurement history, and tells you about it — on a schedule, without an agent on any
58
+ monitored machine.
59
+
60
+ **It sends nothing anywhere by itself.** No telemetry, no usage reporting, no update check. It
61
+ connects to the databases and hosts you list, and — only if you turn it on and give it a token —
62
+ to a chat service. Nothing else.
63
+
64
+ > **This project is being renamed.** The distribution and the module path are still `db_ops`, so
65
+ > every command below reads `python -m db_ops.<app>.cli`. They become `dbabrain` when the code
66
+ > moves to the public repository; nothing else changes with them.
67
+ > <!-- TODO(rename): update the distribution name and every `python -m` path in this file once the
68
+ > package rename lands. -->
69
+
70
+ ---
71
+
72
+ ## What it is not
73
+
74
+ - **It is not an AI agent.** It is a toolkit with a CLI, where every capability takes one JSON
75
+ object and answers with one. That shape is what lets a human, a shell script, a chat command and
76
+ an AI agent all drive the same operation without a translation layer — and it is why an
77
+ agent-facing interface can be added later without rewriting anything underneath it. Today
78
+ nothing here talks to a model.
79
+ - **It does not replace incident analysis, change approval, or runbooks.** It supports them. A
80
+ restore drill proves a backup is restorable; deciding to restore production is still yours.
81
+ - **It is not a dashboard product.** It has a web console for reading reports and editing
82
+ configuration, but the primary interface is a CLI and its primary output is a record in a
83
+ database you own.
84
+ - **It installs nothing on your databases.** No agent, no extension, no stored procedure. It logs
85
+ in with a read-only account and asks questions.
86
+
87
+ ## Who it is for
88
+
89
+ A DBA or small team responsible for a handful to a few dozen instances across more than one
90
+ engine, who already know what they want checked and are tired of it living in twelve cron jobs and
91
+ a folder of scripts. If you have one PostgreSQL cluster and a hosted monitoring product you are
92
+ happy with, this is more machinery than you need.
93
+
94
+ ---
95
+
96
+ ## Capabilities
97
+
98
+ Ordered to match the reference docs; the **ORD** number links to each one.
99
+
100
+ | ORD | Component | Package / config | Responsibility |
101
+ | :---: | --- | --- | --- |
102
+ | [01](./docs/01_runtime_store.md) | Runtime store | `db_ops/db`, `data/store_config.json` | The database the toolkit keeps its **own** data in — job runs, measurements, report state, the delivery queue, restore history. SQLite to start, PostgreSQL when you outgrow it; the backend is one word in one file. |
103
+ | [02](./docs/02_logging_engine.md) | Logging engine | `db_ops/logging_ops`, `logs/` | Scoped application logs, runtime logs, shared errors, and daily archives. |
104
+ | [03](./docs/03_app_command_daemon.md) | App command daemon | `db_ops/jobs`, `data/app_commands.json` | The scheduler: runs each app on its own interval inside its allowed hours, skips one that is still running, and forwards the secret passphrase to every child process. |
105
+ | [04](./docs/04_metrics_engine.md) | Metrics engine | `db_ops/metrics`, `data/db_instances.json`, `data/metric_definitions.json` | Around ninety metrics across four engines — availability, capacity, performance, recoverability, security, maintenance — collected and normalised into one shape. |
106
+ | [05](./docs/05_sql_task_runner.md) | SQL task runner | `db_ops/sql_tasks`, `data/sql_commands.json`, `data/sql_targets.json` | Your own SQL, on a schedule or on request, against approved targets, delivered as text or a spreadsheet. The SQL is a reviewable file, never a string in configuration. |
107
+ | [06](./docs/06_reports_app.md) | Reports | `db_ops/reports`, `data/reports_config.json` | Turns measurements into scheduled reports and inventory pages, with a freshness gate so a stale number is never reported as a current one. |
108
+ | [07](./docs/07_telegram_app.md) | Chat delivery and commands | `db_ops/telegram`, the Telegram data files | Delivers the outgoing queue one message at a time, and executes the commands people send back — gated by the person's clearance *and* the chat's. |
109
+ | [08](./docs/08_backup_restore_app.md) | Backup / restore | `db_ops/backup_restore`, `data/restore_config.json` | Runs backups, restores them onto a disposable target, verifies the result, and records what was proven and when. |
110
+ | [09](./docs/09_sla_slo_compliance_app.md) | SLA / SLO compliance | `db_ops/sla`, `data/sla_policies.json` | Computes indicators from stored measurement history, evaluates objectives with an error budget, and reports what is left of it. |
111
+ | [10](./docs/10_sre_app.md) | SRE | `db_ops/sre`, `data/sre_config.json` | Provisions the disposable lab databases that drills and rehearsals need — single instances or small HA clusters, in Docker or on VMs. |
112
+ | [11](./docs/11_control_app.md) | Control | `db_ops/control`, `config.json` | Builds and deploys the toolkit to another node, and watches the toolkit itself — the one app that reports on the others. |
113
+ | [12](./docs/12_webhost_app.md) | Web host | `db_ops/webhost`, `data/webhost_config.json` | Serves the rendered reports over HTTP and hosts the console. Publishes files; never generates them. |
114
+ | [13](./docs/13_common.md) | **Common** — shared operations | `db_ops/common` | Reaching a host, running SQL, moving a file, rotating a password, confirming something dangerous. Every command takes one JSON object. **Invoked as a CLI, never imported.** |
115
+ | [14](./docs/14_lib.md) | **Lib** — shared rules | `db_ops/lib` | Values and rules that are pure functions of their arguments: time windows, notify routing, severity, formatting. Imports nothing from the rest of the project. **Only ever imported, never run as a CLI.** |
116
+
117
+ **Fourteen components, and the list is closed.** ORD 01–12 are the apps — one directory, one CLI
118
+ each — and 13/14 are the two shared layers they all sit on.
119
+
120
+ > **Every component has a doc, and every doc has a component.** One `docs/NN_*.md` per package,
121
+ > both directions, enforced by `tests/test_docs_cover_every_component.py`. A component is not
122
+ > finished until its doc exists.
123
+ >
124
+ > That is a claim few projects can make, and it was written the hard way: one shared layer reached
125
+ > 46 modules and roughly 6,500 lines with no documentation and a fully green suite, because nothing
126
+ > connected the two directories.
127
+
128
+ ---
129
+
130
+ ## Install
131
+
132
+ Python **3.12+**. Every database driver is an extra, so a DBA who runs only PostgreSQL is not made
133
+ to install an ODBC driver and an Oracle client to start.
134
+
135
+ ```bash
136
+ python -m venv .venv
137
+ .venv/bin/pip install 'db_ops[postgres]' # Windows: .venv\Scripts\pip
138
+ ```
139
+
140
+ | Extra | For |
141
+ | --- | --- |
142
+ | `[postgres]` | PostgreSQL — pure Python, nothing else to install |
143
+ | `[mysql]` | MySQL / MariaDB — pure Python |
144
+ | `[oracle]` | Oracle — no client library needed for 12.1 and newer |
145
+ | `[mssql]` | SQL Server — **also needs Microsoft's system ODBC driver** |
146
+ | `[ssh]`, `[winrm]` | OS-level metrics and maintenance on Linux / Windows targets |
147
+ | `[all]` | everything |
148
+
149
+ Full instructions, including the two prerequisites that are not pip-installable and the container
150
+ image: **[`docs/installation.md`](./docs/installation.md)**.
151
+
152
+ ## Five minutes
153
+
154
+ A throwaway container, a least-privilege login, seven real measurements — and nothing to uninstall
155
+ afterwards:
156
+
157
+ **[`examples/postgres-quickstart/`](./examples/postgres-quickstart)** — needs no system packages.
158
+ **[`examples/sqlserver-quickstart/`](./examples/sqlserver-quickstart)** — same shape, and it finds
159
+ a real problem with the instance, then clears it once you fix it.
160
+
161
+ ```bash
162
+ cd examples/postgres-quickstart
163
+ docker compose up -d
164
+ python -m db_ops.db.cli --config config.json init
165
+ python -m db_ops.metrics.cli --config config.json collect --dry-run
166
+ python -m db_ops.metrics.cli --config config.json collect
167
+ python -m db_ops.metrics.cli --config config.json report
168
+ ```
169
+
170
+ ---
171
+
172
+ ## Two ways to drive it
173
+
174
+ After `pip install`, someone has to describe the estate — which instances exist, which credentials
175
+ reach them, where alerts go. There are two ways to do that, and they differ only in who writes the
176
+ files.
177
+
178
+ | | Who configures it | Status |
179
+ | --- | --- | --- |
180
+ | **A person, in a browser** | A web console: add an instance the way a database client does — host, port, user, password — and it collects | **Planned.** The console exists and edits configuration; the add-an-instance flow does not, and `webhost` is not in `v0.1.0` |
181
+ | **An agent, writing JSON** | Every decision is a file. An agent writes them and runs three commands | **This is the supported path today** |
182
+
183
+ `v0.1.0` ships the agent path on purpose: the configuration surface has to be settled before
184
+ something generates it, and a console that writes files nobody has agreed the shape of becomes a
185
+ second source of truth.
186
+
187
+ **Both paths are written out step by step, with what to assert after each one, in
188
+ [`docs/first_run.md`](./docs/first_run.md).** It is written to be followed by a program and to be
189
+ readable by a person, because until the console lands they do the same thing.
190
+
191
+ ---
192
+
193
+ ## How it is configured
194
+
195
+ Everything is JSON you own. **A new threshold, target, route, schedule or severity belongs in
196
+ `data/*.json`, never as a literal in Python** — the design assumes the person affected by a setting
197
+ can read it, change it, and be reviewed on the change.
198
+
199
+ ```text
200
+ config.json → where runtime output goes, and which declaration files to read
201
+ data/*.json → what to run, monitor, report and deliver
202
+ secrets/ → the plaintext source of the encrypted secret store (git-ignored)
203
+ assets/ → the SQL and scripts that implement it
204
+ ```
205
+
206
+ Every configuration file has a `*.example.json` beside it, complete enough to copy, rename and
207
+ edit, with a `notes` array explaining what it decides and why.
208
+
209
+ **The tool finds its configuration by a stated order**, not by where its code sits on disk:
210
+ `DB_OPS_HOME`, then the working directory if it holds `data/` or `config.json`, then the package
211
+ location. That is what makes an installed copy work, and it is why standing in an example
212
+ directory is enough to run against it.
213
+
214
+ See **[`docs/configuration.md`](./docs/configuration.md)**.
215
+
216
+ ## Secrets
217
+
218
+ Passwords and tokens live encrypted in `data/encrypted_secret_text.json` — PBKDF2-HMAC-SHA256 over
219
+ a per-file salt, sealed with Fernet. The passphrase is supplied at run time and is never written to
220
+ disk, a log, or the store. Configuration names a *reference*; the value is resolved from the
221
+ environment first and the encrypted store second, so an organisation with an external secret
222
+ manager never has to use the built-in one.
223
+
224
+ A request carrying a password is passed on **stdin**, never as a command-line word — argv is
225
+ world-readable in the process table.
226
+
227
+ See **[`docs/security.md`](./docs/security.md)**, which also covers the least-privilege login the
228
+ toolkit needs on each engine, the audit trail, and running with no outbound network access.
229
+
230
+ ## How it is put together
231
+
232
+ Fourteen components, two shared layers, four rules about who may call whom — and a guard test
233
+ beside each rule, because a diagram describes what someone intended and a test describes what is
234
+ true this morning.
235
+
236
+ > `common` **may not be imported** — it is only ever run as a CLI.
237
+ > `lib` **may not run a CLI** — it is only ever imported.
238
+ > No app imports another app.
239
+ > No shared layer imports an app.
240
+
241
+ See **[`docs/architecture.md`](./docs/architecture.md)**.
242
+
243
+ ---
244
+
245
+ ## Documentation
246
+
247
+ | Start here | |
248
+ | --- | --- |
249
+ | [`docs/installation.md`](./docs/installation.md) | pip and Docker, the engine extras, the ODBC and Oracle prerequisites |
250
+ | [`docs/first_run.md`](./docs/first_run.md) | From `pip install` to a collected metric — the agent path in full, and what the browser path will be |
251
+ | [`docs/configuration.md`](./docs/configuration.md) | Where configuration lives, and what every file decides |
252
+ | [`docs/security.md`](./docs/security.md) | Secrets, least privilege, the audit trail, air-gapped operation |
253
+ | [`docs/architecture.md`](./docs/architecture.md) | The components, the layers, and the rules that keep them apart |
254
+ | [`examples/`](./examples) | Worked configurations you can copy whole |
255
+
256
+ | Component reference | |
257
+ | --- | --- |
258
+ | [`docs/01_runtime_store.md`](./docs/01_runtime_store.md) | Store backends, schema, migration, troubleshooting |
259
+ | [`docs/02_logging_engine.md`](./docs/02_logging_engine.md) | Log scopes, files, and archive behaviour |
260
+ | [`docs/03_app_command_daemon.md`](./docs/03_app_command_daemon.md) | Scheduling, time windows, timeouts, key forwarding |
261
+ | [`docs/04_metrics_engine.md`](./docs/04_metrics_engine.md) | The metric catalogue per engine, and least-privilege setup |
262
+ | [`docs/05_sql_task_runner.md`](./docs/05_sql_task_runner.md) | SQL task configuration, parameters, and execution |
263
+ | [`docs/06_reports_app.md`](./docs/06_reports_app.md) | Report creation, schedules, and finding delivery |
264
+ | [`docs/07_telegram_app.md`](./docs/07_telegram_app.md) | Delivery, bot commands, and permissions |
265
+ | [`docs/08_backup_restore_app.md`](./docs/08_backup_restore_app.md) | Backup, restore, verification, and history |
266
+ | [`docs/09_sla_slo_compliance_app.md`](./docs/09_sla_slo_compliance_app.md) | Objectives, indicators, and error budgets |
267
+ | [`docs/10_sre_app.md`](./docs/10_sre_app.md) | Lab provisioning, HA topologies, and delegated workflows |
268
+ | [`docs/11_control_app.md`](./docs/11_control_app.md) | Build, deploy, and watching the toolkit itself |
269
+ | [`docs/12_webhost_app.md`](./docs/12_webhost_app.md) | Serving reports, the stable `latest` link, snapshot selection |
270
+ | [`docs/13_common.md`](./docs/13_common.md) | The shared operations layer, command by command |
271
+ | [`docs/14_lib.md`](./docs/14_lib.md) | The pure rules layer, the purity guarantee, and the module index |
272
+
273
+ | Project | |
274
+ | --- | --- |
275
+ | [`CONTRIBUTING.md`](./CONTRIBUTING.md) | How to contribute, and the rules that exist because something broke |
276
+ | [`SECURITY.md`](./SECURITY.md) | Reporting a vulnerability |
277
+ | [`CHANGELOG.md`](./CHANGELOG.md) | What changed, written for someone deciding whether to upgrade |
278
+ | [`CODE_OF_CONDUCT.md`](./CODE_OF_CONDUCT.md) | |
279
+
280
+ ---
281
+
282
+ ## Tests
283
+
284
+ The suite is **offline**: no database, no network, no delivery. That is why it runs anywhere and
285
+ why you can refactor with it.
286
+
287
+ ```bash
288
+ .venv/bin/python -m pytest tests -q # full suite
289
+ .venv/bin/python -m pytest tests/test_<area>.py -q # while developing
290
+ ```
291
+
292
+ Tests read as prose — a module docstring explaining *why the behaviour matters*, then test names
293
+ that are sentences.
294
+
295
+ ## License
296
+
297
+ [Apache License 2.0](./LICENSE). See [`NOTICE`](./NOTICE).