Kunde + mehrere Monitore anlegen
Beispiel: Kunde erstellen und mehrere Monitore einrichten (gleicher Typ und gemischte Typen).
Kunde + mehrere Monitore anlegen
Dieses Beispiel zeigt, wie du für einen Kunden mehrere Monitore einrichtest, z.B.:
- Zwei unterschiedliche Hostnamen für DNS Monitoring
- Mehrere Server für ICMP
- Eine Mischung aus DNS + ICMP + SMTP
1) Kunde + Website erstellen
2) Mehrere Monitore anlegen
Option A: Mehrere Monitore vom selben Typ (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: Gemischte Monitor-Typen
# 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
}'
Tipps
- Nutze konsistente Namen (Prefix nach Typ:
DNS:,Ping:,SMTP:). - Starte mit konservativen Intervallen und verschärfe später.