Monitor Types

NightPanel supports four types of monitors. Each type checks something different and has its own settings.


HTTP Monitor

What it does: Sends an HTTP request to a URL and checks if the response is what you expect.

When to use: To monitor websites, APIs, health check endpoints — anything that responds to HTTP requests.

Settings

FieldRequiredDescription
URLYesThe address to check, e.g., https://mysite.com/health
MethodNoHTTP method: GET (default), POST, PUT, etc.
Expected StatusNoExpected HTTP status code. Default: 200
TimeoutNoHow long to wait before giving up (milliseconds). Default: 10000 (10 sec)
Warning TimeNoIf response takes longer than this, status becomes yellow (ms). Default: 3000
HeadersNoCustom headers to send with the request
BodyNoRequest body (for POST/PUT requests)

Example Configuration

When you create an HTTP monitor, the system generates a JSON configuration like this:

{
  "url": "https://mysite.com/health",
  "method": "GET",
  "expectedStatus": 200,
  "timeoutMs": 10000,
  "warningTimeMs": 3000
}

How to read this:

  • url — the address being checked
  • method — the type of HTTP request (GET = just fetch the page)
  • expectedStatus — the system expects HTTP status 200 (meaning "OK")
  • timeoutMs — if no response in 10,000 milliseconds (10 seconds), the check fails
  • warningTimeMs — if the response takes more than 3,000 ms (3 seconds), it's a warning (yellow)

How Status is Determined

ConditionStatus
Response received, correct status code, fast response🟢 Green
Response received, correct status code, but slow (> warningTimeMs)🟡 Yellow
Wrong status code, timeout, or connection error🔴 Red

SSL Monitor

What it does: Checks the SSL/TLS certificate of a domain and reports how many days until it expires.

When to use: To get an early warning before your SSL certificate expires (which would break HTTPS on your site).

Settings

FieldRequiredDescription
HostYesDomain name, e.g., mysite.com (no https://)
PortNoPort number. Default: 443
Warning DaysNoYellow status if certificate expires within this many days. Default: 30
Critical DaysNoRed status if certificate expires within this many days. Default: 7

Example Configuration

{
  "host": "mysite.com",
  "port": 443,
  "warningDays": 30,
  "criticalDays": 7
}

How to read this:

  • host — the domain whose certificate is being checked
  • port — standard HTTPS port (443)
  • warningDays — if the certificate expires in less than 30 days, status goes yellow
  • criticalDays — if it expires in less than 7 days, status goes red

How Status is Determined

ConditionStatus
Certificate valid for more than 30 days🟢 Green
Certificate expires in 8–30 days🟡 Yellow
Certificate expires in 7 days or less🔴 Red
Certificate already expired or unreachable🔴 Red

Database Monitor

What it does: Connects to a PostgreSQL database, runs a SQL query, and checks if it completes successfully and how fast.

When to use: To make sure your database is alive and responding within acceptable time.

Settings

FieldRequiredDescription
Connection StringYesPostgreSQL connection URL
QueryNoSQL query to run. Default: SELECT 1
Warning ThresholdNoYellow if query takes longer (ms). Default: 1000
Critical ThresholdNoRed if query takes longer (ms). Default: 5000

Example Configuration

{
  "connectionString": "postgresql://user:password@host:5432/mydb",
  "query": "SELECT 1",
  "warningThresholdMs": 1000,
  "criticalThresholdMs": 5000
}

How to read this:

  • connectionString — the database address with credentials
  • query — a simple query to test the connection (SELECT 1 just checks if the database responds)
  • warningThresholdMs — if the query takes more than 1 second, it's a warning
  • criticalThresholdMs — if it takes more than 5 seconds, it's critical

Security note: Your connection string contains a password. It's stored encrypted on our server and never exposed through the API.

How Status is Determined

ConditionStatus
Query succeeds in under 1 second🟢 Green
Query succeeds but takes 1–5 seconds🟡 Yellow
Query takes more than 5 seconds or fails🔴 Red

Integration Monitor

What it does: Compares data between two systems (files in JSON or XLSX format) to verify they match.

When to use: When you need to verify that data in one system (e.g., an ERP) matches data in another system (e.g., a CRM). Commonly used for employee counts, order totals, inventory levels.

Example Configuration

{
  "sourceFile": "employees.json",
  "sourceFormat": "json",
  "sourceRootKey": "employees",
  "targetFile": "users.xlsx",
  "targetFormat": "xlsx",
  "rules": [
    {
      "name": "Active users count",
      "type": "count_match",
      "sourceFilter": { "employmentStatus": "active" },
      "targetFilter": { "status": "active" }
    }
  ]
}

How to read this:

  • sourceFile / targetFile — the two files being compared
  • sourceFormat / targetFormat — file formats (json or xlsx)
  • sourceRootKey — which key in the JSON contains the data array
  • rules — comparison rules:
    • name — a label for this rule
    • type — what to compare (count_match = check if counts are equal)
    • sourceFilter / targetFilter — filters to apply before comparing

Common Settings for All Monitors

These settings are available for every monitor type:

FieldDescription
NameA friendly name to identify the monitor (e.g., "Production API")
TypeOne of: http, ssl, database, integration
IntervalHow often to run the check, in seconds (e.g., 300 = every 5 minutes)
EnabledWhether the monitor is active (true/false)
CriticalIf true, a red status on this monitor makes the overall icon red. If false, it only makes it yellow
GroupOptional group to organize monitors together

About the "Critical" Flag

This is an important concept. Imagine you have 10 monitors. If one of them goes red:

  • Critical = true → The overall icon in your browser turns red (immediate attention needed)
  • Critical = false → The overall icon turns yellow (something is wrong, but it's not critical)

Use "Critical" for your most important services — production servers, payment systems, main databases. Leave it off for less important checks like staging environments or secondary services.