agentleFS
skyvanguardskyvanguard/infra-ops/skills/service-monitor/SKILL.md

service-monitor

Skill1 starsChanged 10 months agoMITView on GitHub

Use when the user wants to check if services are running, verify endpoints are responding, or set up health checks for applications and infrastructure components.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check the health of services, APIs, and infrastructure components.

    line 10
  2. Distinctive:

    Ask the user OR auto-detect:

    line 16
  3. Distinctive:

    Run multiple checks to assess consistency:

    line 74
  4. Distinctive:

    NEVER send credentials in health check commands

    line 156
  5. Distinctive:

    NEVER modify service configuration

    line 157
  6. Distinctive:

    Use timeouts on ALL network checks (max 10s)

    line 158
  7. Distinctive:

    If a service requires auth to check, ask user for method

    line 159
  8. Distinctive:

    Don't flood services with requests (max 5 checks per endpoint)

    line 160
  9. Distinctive:

    Check from the host's perspective, not externally

    line 162

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Service Monitor

Overview

Check the health of services, APIs, and infrastructure components. Verify uptime, response times, and correct behavior of endpoints. Produce a service health dashboard.

Process

Step 1: Identify Services to Monitor

Ask the user OR auto-detect:

Auto-detect running services:

PlatformCommand
WindowsGet-Service | Where-Object {$_.Status -eq 'Running'} | Select Name, DisplayName
Linuxsystemctl list-units --type=service --state=running --no-pager
macOSlaunchctl list | grep -v "^-|com.apple"

Auto-detect listening ports:

PlatformCommand
WindowsGet-NetTCPConnection -State Listen | Select LocalPort, @{N='Process';E={(Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).Name}} | Sort LocalPort -Unique
Linuxss -tlnp | tail -n +2
macOSlsof -iTCP -sTCP:LISTEN -n -P | awk '{print $1, $9}'

Step 2: Health Checks

HTTP/HTTPS endpoints:

# Basic availability + response time
curl -s -o /dev/null -w "HTTP %{http_code} | Time: %{time_total}s | Size: %{size_download}B" [url]

# With timeout
curl -s --max-time 10 -o /dev/null -w "%{http_code}" [url]

# Follow redirects
curl -sL -o /dev/null -w "%{http_code} %{url_effective}" [url]

# Check specific header
curl -sI [url] | grep -i [header]

TCP port checks:

PlatformCommand
WindowsTest-NetConnection -ComputerName [host] -Port [port] -InformationLevel Quiet
Linuxtimeout 5 bash -c "echo > /dev/tcp/[host]/[port]" 2>/dev/null && echo "OPEN" || echo "CLOSED"
macOSnc -z -w5 [host] [port] 2>&1

Database connectivity:

DatabaseCheck Command
PostgreSQLpg_isready -h [host] -p [port]
MySQLmysqladmin ping -h [host] -P [port] 2>&1
Redisredis-cli -h [host] -p [port] ping
MongoDBmongosh --host [host] --port [port] --eval "db.runCommand({ping:1})" --quiet

Service-specific checks:

ServiceCheck
DNSdig @[server] [domain] +short +time=5
SMTPnc -z -w5 [host] 25 || nc -z -w5 [host] 587
NTPntpdate -q [server] 2>&1 || timedatectl show-timesync
LDAPldapsearch -x -H ldap://[host] -b "" -s base 2>&1 | head -5

Step 3: Response Time Analysis

Run multiple checks to assess consistency:

# 5 requests to measure consistency
for i in 1 2 3 4 5; do
  curl -s -o /dev/null -w "%{time_total}\n" [url]
  sleep 1
done

Response time thresholds:

Response TimeRatingAction
< 200msExcellentNo action
200-500msGoodMonitor
500ms-1sSlowInvestigate
1s-5sPoorNeeds optimization
> 5sCriticalImmediate attention
TimeoutDownAlert/escalate

Step 4: Process Health

Check if process is running:

PlatformCommand
WindowsGet-Process -Name [name] -ErrorAction SilentlyContinue | Select Name, Id, CPU, @{N='Mem(MB)';E={[math]::Round($_.WorkingSet64/1MB)}}
Linuxpgrep -a [name]
macOSpgrep -l [name]

Process resource consumption:

PlatformCommand
WindowsGet-Process -Name [name] | Select Id, CPU, WorkingSet64, HandleCount, StartTime
Linuxps -p $(pgrep [name]) -o pid,pcpu,pmem,vsz,rss,etime

Check for zombie/defunct processes:

PlatformCommand
Linuxps aux | grep -w Z | grep -v grep

Step 5: Dependency Chain Check

Map and verify service dependencies:

Service A → depends on → Service B → depends on → Database
   ✓                         ✓                        ?

For each dependency:

  1. Is it running?
  2. Is it responding?
  3. Is the response correct (not just 200 OK)?

Step 6: Present Health Dashboard

## Service Health Dashboard
**Checked:** [timestamp] | **Host:** [hostname]

### Service Status
| Service | Port | Status | Response | Latency |
|---------|------|--------|----------|---------|
| [name] | [port] | [UP/DOWN] | [code] | [ms] |
| [name] | [port] | [UP/DOWN] | [code] | [ms] |

### Summary
- Total services: [N]
- Healthy: [N] ✓
- Degraded: [N] ⚠
- Down: [N] ✗

### Issues Detected
1. [Service X] - [issue description]
2. [Service Y] - [issue description]

### Recommendations
- [Action items for degraded/down services]

Rules

  • NEVER send credentials in health check commands
  • NEVER modify service configuration
  • Use timeouts on ALL network checks (max 10s)
  • If a service requires auth to check, ask user for method
  • Don't flood services with requests (max 5 checks per endpoint)
  • Report response codes accurately (don't assume 200 = healthy)
  • Check from the host's perspective, not externally

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.