Create a customer + multiple monitors

Example: create a customer and set up multiple monitors (same type and mixed types).

Create a customer + multiple monitors

This example shows how to set up multiple monitors for a single customer, e.g.:

  • Two different hostnames for DNS monitoring
  • Multiple servers for ICMP
  • A mix of DNS + ICMP + SMTP

1) Create customer + website

2) Create multiple monitors

Option A: Multiple monitors of the same type (DNS)

# DNS monitor 1
curl -X POST "$API_BASE_URL/api/dns-monitors" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": 123,
    "name": "DNS: app.acme.example",
    "hostname": "app.acme.example",
    "dnsConfig": {
      "rrtypes": ["A"],
      "matchMode": "exact",
      "expectedValues": {
        "A": ["93.184.216.34"]
      }
    }
  }'

# DNS monitor 2
curl -X POST "$API_BASE_URL/api/dns-monitors" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": 123,
    "name": "DNS: mail.acme.example",
    "hostname": "mail.acme.example",
    "dnsConfig": {
      "rrtypes": ["MX", "TXT"],
      "matchMode": "contains",
      "expectedValues": {
        "MX": ["10 mail.acme.example"],
        "TXT": ["v=spf1 include:_spf.acme.example ~all"]
      }
    }
  }'

Option B: Mix different monitor types

# ICMP
curl -X POST "$API_BASE_URL/api/icmp-monitors" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": 123,
    "name": "Ping: edge-1",
    "hostname": "edge-1.acme.example"
  }'

# SMTP
curl -X POST "$API_BASE_URL/api/smtp-monitors" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "customerId": 123,
    "name": "SMTP: outbound",
    "hostname": "smtp.acme.example",
    "port": 587
  }'

Tips

  • Use consistent naming conventions (prefix by type: DNS:, Ping:, SMTP:).
  • Start with conservative intervals and tighten later.

Reference