$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
Monitoring & Loggingbeginner

Uptime Monitor

Share

Set up uptime monitoring

Works with OpenClaude

You are a DevOps engineer setting up application availability monitoring. The user wants to create an uptime monitor that tracks service availability and alerts when services go down.

What to check first

  • Verify you have Node.js 14+ installed: node --version
  • Confirm you have curl or a similar HTTP client available: which curl
  • Check that you can access the services you want to monitor (test with curl -I https://example.com)

Steps

  1. Install the uptime-monitor or axios package for HTTP requests: npm install axios node-cron
  2. Create a configuration file listing all endpoints with expected response codes and check intervals
  3. Set up a monitoring loop that runs at regular intervals using node-cron scheduler
  4. Make HTTP HEAD or GET requests to each endpoint and record response times
  5. Compare response codes against expected values (typically 200-299 for healthy services)
  6. Calculate uptime percentage over rolling 24-hour and 30-day windows
  7. Store metrics in a JSON file or simple database for historical tracking
  8. Configure alert thresholds (e.g., trigger alert if downtime exceeds 5 minutes)

Code

const axios = require('axios');
const cron = require('node-cron');
const fs = require('fs');
const path = require('path');

const CONFIG = {
  endpoints: [
    { name: 'API', url: 'https://api.example.com/health', expectedCode: 200 },
    { name: 'Website', url: 'https://example.com', expectedCode: 200 },
    { name: 'Database', url: 'https://db.example.com/status', expectedCode: 200 }
  ],
  checkInterval: '*/5 * * * *', // Every 5 minutes
  alertEmail: 'admin@example.com',
  metricsFile: './uptime_metrics.json'
};

const initMetricsFile = () => {
  if (!fs.existsSync(CONFIG.metricsFile)) {
    fs.writeFileSync(CONFIG.metricsFile, JSON.stringify({
      checks: [],
      alerts: []
    }, null, 2));
  }
};

const checkEndpoint = async (endpoint) => {
  const startTime = Date.now();
  try {
    const response = await axios.head(endpoint.url, { timeout: 10000 });
    const responseTime = Date.now() - startTime;
    return {
      name: endpoint.name,
      status: response.status === endpoint.expectedCode ? 'up' : 'down',
      responseCode: response.status,
      responseTime,
      timestamp: new Date().toISOString(),
      success: true
    };
  } catch (error) {
    return {
      name: endpoint.name,
      status: 'down',
      responseCode: error.response?.status || null,

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

Difficultybeginner
Version1.0.0
AuthorClaude Skills Hub
monitoringuptimeavailability

Install command:

curl -o ~/.claude/skills/uptime-monitor.md https://claude-skills-hub.vercel.app/skills/monitoring/uptime-monitor.md

Related Monitoring & Logging Skills

Other Claude Code skills in the same category — free to download.

Want a Monitoring & Logging skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.