Agent skill

Monitoring Database Health

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Monitor use when you need to work with monitoring and observability.

MITAuto-check passedDevOps & Cloud

Install Monitoring Database Health

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill monitoring-database-health -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace monitoring-database-health --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/monitoring-database-health .claude/skills/monitoring-database-health && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
monitoring-database-health
GitHub stars
2.8k
Token cost
~2k tokens
SKILL.md length
815 words
Files
4 (incl. scripts, references, assets)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Monitor use when you need to work with monitoring and observability.

  • Works in 10 steps: Check connection utilization → Monitor query throughput and error rate → Check disk usage and growth → …
  • You need to work with monitoring and observability
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • With phrases like monitor system health

What it does

Monitoring Database Health is an agent skill from jeremylongshore/tons-of-skills-marketplace. Monitor use when you need to work with monitoring and observability. This skill provides health monitoring and alerting with comprehensive guidance and automation. Trigger with phrases like "monitor system health", "set up alerts", or "track metrics".

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including scripts, reference files and assets (for example `assets/README.md`, `references/README.md` and `scripts/README.md`). Compatibility notes: Designed for Claude Code

It sits in DevOps & Cloud, covering Monitoring and alerting and Observability. It works with PostgreSQL and MySQL. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • You need to work with monitoring and observability
  • With phrases like monitor system health

Example prompts

  • “monitor system health”
  • “set up alerts”
  • “track metrics”
  • “/monitoring-database-health”

Requirements

  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*), Bash(mongosh:*)

Workflow steps

10 steps, taken from the first numbered list in SKILL.md.

  1. Check connection utilization
  2. Monitor query throughput and error rate
  3. Check disk usage and growth
  4. Monitor cache hit ratio
  5. Check vacuum and autovacuum health (PostgreSQL)
  6. Monitor replication lag (if replicas exist)
  7. Check for long-running queries
  8. Monitor lock contention
  9. Compile all health checks into a single monitoring script that runs via cron every 60 seconds, outputs metrics in a structured format…
  10. Create a health summary dashboard query that returns a single-row result with RAG (Red/Amber/Green) status for each health dimension…

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(psql:*)
    • Bash(mysql:*)
    • Bash(mongosh:*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/, which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • postgresql.org
    • mongodb.com
    • bucardo.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Monitoring Database Health loads about 2k tokens when it runs, and up to ~2k if it reads all its reference files. Until then it costs about 70 tokens; SKILL.md has 815 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~70
When it runs · the whole SKILL.md, loaded when a task matches
~2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 815 words, ~1,962 tokens.

Download SKILL.mdSave it as .claude/skills/monitoring-database-health/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
monitoring-database-health
description
Monitor use when you need to work with monitoring and observability. This skill provides health monitoring and alerting with comprehensive guidance and automation. Trigger with phrases like "monitor system health", "set up alerts", or "track metrics".
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*), Bash(mongosh:*)
compatibility
Designed for Claude Code
version
1.25.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
database, monitoring, observability

Database Health Monitor

Overview

Monitor database server health across PostgreSQL, MySQL, and MongoDB by tracking key performance indicators including connection utilization, query throughput, replication lag, disk usage, cache hit ratios, vacuum activity, and lock contention.

Prerequisites

  • Database credentials with access to system statistics views (pg_stat_*, performance_schema, serverStatus)
  • psql, mysql, or mongosh CLI tools for running health check queries
  • Permissions: pg_monitor role (PostgreSQL), PROCESS privilege (MySQL)
  • Baseline metrics from a period of normal operation for threshold calibration
  • Alerting channel configured (email, Slack webhook, PagerDuty)

Instructions

  1. Check connection utilization:

    • PostgreSQL: SELECT count(*) AS active_connections, (SELECT setting::int FROM pg_settings WHERE name = 'max_connections') AS max_connections, round(count(*)::numeric / (SELECT setting::int FROM pg_settings WHERE name = 'max_connections') * 100, 1) AS utilization_pct FROM pg_stat_activity
    • MySQL: SELECT VARIABLE_VALUE AS connections FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Threads_connected'
    • Alert threshold: utilization above 80%
  2. Monitor query throughput and error rate:

    • PostgreSQL: SELECT datname, xact_commit AS commits_total, xact_rollback AS rollbacks_total, xact_rollback::float / GREATEST(xact_commit, 1) AS rollback_ratio FROM pg_stat_database WHERE datname = current_database()
    • MySQL: SHOW GLOBAL STATUS LIKE 'Com_commit' and SHOW GLOBAL STATUS LIKE 'Com_rollback'
    • Alert threshold: rollback ratio above 5% or throughput drops more than 50% from baseline
  3. Check disk usage and growth:

    • PostgreSQL: SELECT pg_size_pretty(pg_database_size(current_database())) AS db_size and SELECT tablename, pg_size_pretty(pg_total_relation_size(tablename::text)) AS size FROM pg_tables WHERE schemaname = 'public' ORDER BY pg_total_relation_size(tablename::text) DESC LIMIT 10
    • Alert threshold: disk usage above 80% or growth rate projecting full disk within 7 days
  4. Monitor cache hit ratio:

    • PostgreSQL: SELECT sum(heap_blks_hit)::float / GREATEST(sum(heap_blks_hit) + sum(heap_blks_read), 1) AS cache_hit_ratio FROM pg_statio_user_tables
    • MySQL: SELECT (1 - (VARIABLE_VALUE / (SELECT VARIABLE_VALUE FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_read_requests'))) AS hit_ratio FROM performance_schema.global_status WHERE VARIABLE_NAME = 'Innodb_buffer_pool_reads'
    • Alert threshold: cache hit ratio below 95% indicates shared_buffers or innodb_buffer_pool_size needs increasing
  5. Check vacuum and autovacuum health (PostgreSQL):

    • SELECT relname, last_vacuum, last_autovacuum, n_dead_tup, n_live_tup, round(n_dead_tup::numeric / GREATEST(n_live_tup, 1) * 100, 1) AS dead_pct FROM pg_stat_user_tables WHERE n_dead_tup > 1000 ORDER BY n_dead_tup DESC LIMIT 10
    • Alert threshold: dead tuple percentage above 20% or autovacuum not running for more than 24 hours on active tables
  6. Monitor replication lag (if replicas exist):

    • PostgreSQL: SELECT client_addr, state, pg_wal_lsn_diff(sent_lsn, replay_lsn) AS lag_bytes FROM pg_stat_replication
    • MySQL: SHOW REPLICA STATUS\G - check Seconds_Behind_Source
    • Alert threshold: lag above 30 seconds or replication stopped
  7. Check for long-running queries:

    • PostgreSQL: SELECT pid, now() - query_start AS duration, state, query FROM pg_stat_activity WHERE state != 'idle' AND now() - query_start > interval '5 minutes' ORDER BY duration DESC
    • Alert threshold: any query running longer than 10 minutes (OLTP) or 1 hour (analytics)
  8. Monitor lock contention:

    • PostgreSQL: SELECT count(*) AS waiting_queries FROM pg_stat_activity WHERE wait_event_type = 'Lock'
    • Alert threshold: more than 10 queries waiting for locks simultaneously
  9. Compile all health checks into a single monitoring script that runs via cron every 60 seconds, outputs metrics in a structured format (JSON), and triggers alerts when thresholds are breached.

  10. Create a health summary dashboard query that returns a single-row result with RAG (Red/Amber/Green) status for each health dimension: connections, throughput, disk, cache, vacuum, replication, queries, and locks.

Show full SKILL.md (334 more words)Show less

Output

  • Health check queries tailored to the specific database engine
  • Monitoring script (shell or Python) for scheduled health checks with alerting
  • Threshold configuration with default values and tuning guidance
  • Dashboard summary query providing RAG status across all health dimensions
  • Alert notification templates for Slack, email, or PagerDuty integration

Error Handling

ErrorCauseSolution
pg_stat_activity returns incomplete datatrack_activities = off in postgresql.confEnable track_activities = on and track_counts = on; reload configuration
Health check query itself times outDatabase under heavy load or lock contentionSet statement_timeout = '5s' for monitoring queries; use a dedicated monitoring connection
False alerts during maintenance windowsPlanned maintenance triggers threshold breachesImplement alert suppression windows; add maintenance mode flag to monitoring script
Disk usage alert but no obvious growthWAL files, temporary files, or pg_stat_tmp consuming spaceCheck pg_wal directory size; check for orphaned temporary files; verify wal_keep_size setting
Cache hit ratio drops after restartBuffer pool/shared_buffers cold after database restartImplement cache warming script that runs key queries after restart; alert will self-resolve as cache warms

Examples

PostgreSQL health dashboard for a production SaaS application: A single cron-based script checks 8 health dimensions every 60 seconds, writing results to a metrics table. A dashboard query shows: connections 45/200 (GREEN), cache hit 98.5% (GREEN), dead tuples 2.1% (GREEN), disk 62% (GREEN), replication lag 0.5s (GREEN), long queries 0 (GREEN), lock waiters 1 (GREEN), rollback ratio 0.3% (GREEN).

Detecting impending disk full condition: Health monitor tracks daily disk growth rate. Current usage: 72%, daily growth: 1.2GB, remaining: 280GB. Projected full date: 233 days. Alert triggers at 80% with recommendation to archive old data or add storage. A second alert at 90% escalates to PagerDuty.

Identifying autovacuum falling behind: Health check shows the events table with 15M dead tuples (45% dead ratio) and last autovacuum 3 days ago. Root cause: autovacuum_vacuum_cost_delay too conservative for a high-write table. Fix: set per-table autovacuum_vacuum_cost_delay = 2 and autovacuum_vacuum_scale_factor = 0.01.

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, references, assets) in skills/.curated/monitoring-database-health of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • assets/README.md
  • references/README.md
  • scripts/README.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Monitoring Database Health next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Monitoring Database Health compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Monitoring Database Health this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2kAutomated safety check: PassMIT
Database Observabilitygrafana/skills282—~1.1kAutomated safety check: PassApache-2.0
Database ObservabilityKilo-Org/kilo-marketplace190—~1.4kAutomated safety check: PassApache-2.0
Neonsmontlouis/bible-strong172—~7.1kAutomated safety check: NotesGPL-3.0
OpenTelemetry Pipeline Metrics Speccomet-ml/opik22k—~3.2kAutomated safety check: PassApache-2.0
Redis Observabilityredis/agent-skills1662 repos~911Automated safety check: PassMIT

Similar skills

  • Official

    Set up Grafana Cloud Database Observability for MySQL and PostgreSQL — enables pgstatstatements / Performance Schema, creates a least-privilege monitoring user, configures the…

    282 GitHub stars~1.1k tokensUpdated 2 days ago
    DevOps & CloudAuto-check passed
  • Database Observability

    Kilo-Org/kilo-marketplace

    Grafana Cloud Database Observability — query-level performance insights for MySQL and PostgreSQL.

    190 GitHub stars~1.4k tokensUpdated 12 days ago
    DevOps & CloudAuto-check passed
  • Neon

    smontlouis/bible-strong

    Overview of Neon, a complete set of cloud backend primitives for apps and agents, spanning Lakebase Postgres, Auth, the Data API, Object Storage, Compute Functions, and the AI Gateway.

    172 GitHub stars~7.1k tokensUpdated today
    Backend & APIsAuto-check: notes
  • Specifies how to instrument an opik-backend pipeline with per-stage OpenTelemetry metrics for throughput, latency, errors and queue delay by workspace.

    22k GitHub stars~3.2k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Redis Observability

    redis/agent-skills

    Official

    Redis observability guidance — which metrics to monitor (memory, connections, hit ratio, ops/sec, rejected connections), which built-in commands to reach for during incident triage (SLOWLOG, INFO…

    166 GitHub starsUsed in 2 repos~911 tokens
    DevOps & CloudAuto-check passed
  • Exploring Apm Traces

    PostHog/posthog

    Official

    Investigates distributed application performance using PostHog APM (OpenTelemetry span) data via MCP.

    40k GitHub stars~3.5k tokensUpdated today
    DevOps & CloudAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Monitoring Database Health

What does Monitoring Database Health do?

Monitor use when you need to work with monitoring and observability. Monitoring Database Health is an agent skill from jeremylongshore/tons-of-skills-marketplace. Monitor use when you need to work with monitoring and observability.

When should I use Monitoring Database Health?

Monitoring Database Health fits situations like: you need to work with monitoring and observability; with phrases like monitor system health.

How do I install Monitoring Database Health in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill monitoring-database-health -a claude-code`. Or copy the skill folder (skills/.curated/monitoring-database-health in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/monitoring-database-health in your project. Claude Code loads it when a task matches its description.

How do I install Monitoring Database Health in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill monitoring-database-health -a codex`. Or copy the skill folder (skills/.curated/monitoring-database-health in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/monitoring-database-health in your project. Codex loads it when a task matches its description.

Can I use Monitoring Database Health in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill monitoring-database-health -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/monitoring-database-health, .gemini/skills/monitoring-database-health, .github/skills/monitoring-database-health and .opencode/skills/monitoring-database-health in your project.

What does Monitoring Database Health need to run?

SKILL.md names no scripts, command-line tools or credentials: Monitoring Database Health is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(psql:*), Bash(mysql:*), Bash(mongosh:*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Monitoring Database Health access the network?

SKILL.md names 3 domains. As links in the text: postgresql.org, mongodb.com and bucardo.org. This is read from the text; nothing was executed.

Is Monitoring Database Health safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Monitoring Database Health use?

Monitoring Database Health is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Monitoring Database Health use?

About 2k tokens (SKILL.md is roughly 7.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 17 tokens, read only when the agent opens those files.

What are the alternatives to Monitoring Database Health?

Skills that share tags, products or a category with Monitoring Database Health: Database Observability (grafana/skills, 282 stars), Database Observability (Kilo-Org/kilo-marketplace, 190 stars), Neon (smontlouis/bible-strong, 172 stars) and OpenTelemetry Pipeline Metrics Spec (comet-ml/opik, 22k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Monitoring Database Health?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.