Pulse-Check-API

Dead Man's Switch Monitoring System (WatchDog Sentinel)

API documentation and usage instructions are provided below.

About the Application

Pulse-Check-API is a backend monitoring service designed to track remote infrastructure devices operating in unreliable network environments.

Devices register with the system and must periodically send heartbeat signals. If a heartbeat is not received before the configured timeout expires, the system automatically triggers an alert and marks the device as down.

Built using Node.js, MongoDB and Express, this system demonstrates stateful timer management and failure detection logic.

How It Works

  1. An administrator registers a monitor.
  2. The system starts a countdown timer.
  3. The device sends heartbeat signals.
  4. Each heartbeat resets the timer.
  5. If the timer expires, an alert is triggered.

API Documentation

1. Register Monitor

POST /api/monitors

Creates a new monitor and starts its timer.

{
  "id": "device-123",
  "timeout": 60,
  "alert_email": "admin@critmon.com"
}
        

Response: 201 Created

2. Send Heartbeat

POST /api/monitors/:id/heartbeat

Resets the countdown timer. If the monitor does not exist, returns 404 Not Found.

Response: 200 OK

3. Pause Monitoring

POST /api/monitors/:id/pause

Stops the timer and prevents alerts from firing. Sending a heartbeat automatically resumes monitoring.

Response: 200 OK

4. Get Monitor Status

GET /api/monitors/:id/status

Returns the current state of a monitor.

{
    "deviceId": "device-696",
    "status": "down",
    "timeRemaining": null
}
        

Response: 200 OK

5. Get all Monitoring devices

GET /api/monitors

Returns a json object of all the deploy monitoring devices

{
  "devices": [
    {
      "deviceId": "device-123",
      "status": "paused",
      "timeRemaining": null
    },
    {
      "deviceId": "device-133",
      "status": "down",
      "timeRemaining": null
    },
    {
      "deviceId": "device-143",
      "status": "down",
      "timeRemaining": null
    }
  ]
}
        

Response: 200 OK

5. Delete a Monitor

DELETE /api/monitors/:id/delete

Returns confirmation msg that monitor

{
    "success": true,
    "message": "Monitor deleted successfully",
    "data": {
                "deviceId": "device-143"
            }
}
        

Response: 200 OK

Alert Behavior

If no heartbeat is received before timeout expiration, the system logs:

{
  "ALERT": "Device device-123 is down!",
  "time": "2026-02-14T12:00:00.000Z"
}
        

The monitor status is updated to down.