> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pulseguard.nl/llms.txt
> Use this file to discover all available pages before exploring further.

# Service Monitoring

> Monitor any network service with custom protocols

## Overview

Service monitoring in PulseGuard gaat verder dan alleen websites en domeinen. Je kunt elke netwerk service monitoren met ondersteuning voor meerdere protocollen zoals HTTP/HTTPS, TCP, DNS, IMAP, SMTP, FTP, SSH, POP3 en meer. Dit maakt PulseGuard ideaal voor het monitoren van API's, databases, email servers, en andere kritieke infrastructuur componenten.

<Note>
  Service monitoring is beschikbaar vanaf de Pro plannen. Free accounts kunnen alleen basis HTTP monitoring gebruiken.
</Note>

## Ondersteunde Protocollen

PulseGuard ondersteunt een breed scala aan netwerk protocollen:

<CardGroup cols={4}>
  <Card title="HTTP/HTTPS" icon="globe" color="#22C55E">
    Web services, REST APIs, GraphQL endpoints
  </Card>

  <Card title="TCP" icon="network-wired" color="#3B82F6">
    Any TCP-based service (custom ports)
  </Card>

  <Card title="DNS" icon="search" color="#8B5CF6">
    DNS servers en name resolution
  </Card>

  <Card title="IMAP/IMAPS" icon="envelope" color="#EC4899">
    Email servers (inbox access)
  </Card>

  <Card title="SMTP/SMTPS" icon="paper-plane" color="#F59E0B">
    Email sending services
  </Card>

  <Card title="FTP/FTPS" icon="file" color="#6366F1">
    File transfer servers
  </Card>

  <Card title="SSH" icon="terminal" color="#14B8A6">
    Secure shell connections
  </Card>

  <Card title="POP3/POP3S" icon="inbox" color="#F97316">
    Email retrieval services
  </Card>
</CardGroup>

## Service Toevoegen

<Steps>
  <Step title="Navigeer naar Services sectie">
    Klik op "Services" in de hoofdnavigatie sidebar.
  </Step>

  <Step title="Nieuwe service toevoegen">
    Klik op "Add New" en selecteer "Add New Service".
  </Step>

  <Step title="Kies protocol">
    Selecteer het protocol dat je wilt monitoren.
  </Step>

  <Step title="Configureer connection details">
    Voer host, port, authenticatie en andere protocol-specifieke settings in.
  </Step>

  <Step title="Test verbinding">
    PulseGuard test automatisch de verbinding voordat je opslaat.
  </Step>
</Steps>

## Protocol Configuratie

### HTTP/HTTPS Services

Voor web services, REST APIs en andere HTTP-gebaseerde endpoints:

#### Basis Configuratie

```json theme={null}
{
  "protocol": "http",
  "protocolConfig": {
    "host": "api.example.com",
    "port": 443,
    "path": "/health",
    "method": "GET"
  },
  "timeout": 30
}
```

#### Geavanceerde Opties

* **Expected Response**: Verwachte JSON response voor health checks
* **HTTP Method**: GET, POST, PUT, DELETE, HEAD, OPTIONS
* **Custom Headers**: Authorization, User-Agent, etc.
* **Request Body**: Voor POST/PUT requests
* **Status Code Check**: Verwachte HTTP status codes
* **Response Time Thresholds**: Maximum acceptable response times

#### Voorbeeld: REST API Health Check

```json theme={null}
{
  "name": "User API",
  "protocol": "https",
  "protocolConfig": {
    "host": "api.users.example.com",
    "port": 443,
    "path": "/health",
    "method": "GET",
    "expectedResponse": {
      "status": "healthy",
      "database": "connected"
    }
  }
}
```

### TCP Services

Voor elke TCP-gebaseerde service die niet HTTP is:

```json theme={null}
{
  "protocol": "tcp",
  "protocolConfig": {
    "host": "database.example.com",
    "port": 5432
  },
  "timeout": 10
}
```

**Use Cases:**

* PostgreSQL, MySQL, MongoDB databases
* Redis, Memcached caches
* Custom TCP services
* Load balancers
* Message queues (RabbitMQ, Kafka)

### DNS Services

Voor DNS server monitoring:

```json theme={null}
{
  "protocol": "dns",
  "protocolConfig": {
    "host": "ns1.example.com",
    "port": 53,
    "query": "example.com",
    "recordType": "A"
  }
}
```

**DNS Specifieke Checks:**

* Query response time
* Record existence
* NXDOMAIN responses
* Recursive queries
* Zone transfers (indien toegestaan)

### Email Services (IMAP/SMTP/POP3)

Voor email server monitoring:

#### IMAP/IMAPS

```json theme={null}
{
  "protocol": "imaps",
  "protocolConfig": {
    "host": "imap.gmail.com",
    "port": 993,
    "username": "monitoring@example.com",
    "password": "app-password"
  }
}
```

#### SMTP/SMTPS

```json theme={null}
{
  "protocol": "smtp",
  "protocolConfig": {
    "host": "smtp.gmail.com",
    "port": 587,
    "username": "monitoring@example.com",
    "password": "app-password",
    "useTLS": true
  }
}
```

**Email Monitoring Features:**

* Connection establishment
* Authentication verification
* Mailbox access (IMAP/POP3)
* Send capability testing (SMTP)
* SSL/TLS encryption validation

### FTP/FTPS Services

Voor file transfer server monitoring:

```json theme={null}
{
  "protocol": "ftps",
  "protocolConfig": {
    "host": "ftp.example.com",
    "port": 21,
    "username": "monitor",
    "password": "monitor-pass",
    "secure": true
  }
}
```

**FTP Checks:**

* Connection establishment
* Authentication
* Directory listing
* File upload/download (optional)
* Passive/active mode support

### SSH Services

Voor secure shell server monitoring:

```json theme={null}
{
  "protocol": "ssh",
  "protocolConfig": {
    "host": "server.example.com",
    "port": 22,
    "username": "monitor",
    "password": "monitor-pass",
    "keyPath": "/path/to/private/key" // Alternative to password
  }
}
```

**SSH Monitoring:**

* Connection establishment
* Authentication verification
* Command execution (optional)
* Key-based authentication support
* SSH version detection

## Authenticatie & Security

### Ondersteunde Auth Types

#### Basic Authentication

```json theme={null}
{
  "authType": "basic",
  "authUsername": "username",
  "authPassword": "password"
}
```

#### Bearer Token

```json theme={null}
{
  "authType": "bearer",
  "authToken": "your-jwt-token"
}
```

#### API Key

```json theme={null}
{
  "authType": "api_key",
  "authToken": "your-api-key",
  "authHeader": "X-API-Key"
}
```

#### Custom Headers

```json theme={null}
{
  "headers": {
    "Authorization": "Bearer token",
    "X-API-Key": "key",
    "User-Agent": "PulseGuard/1.0"
  }
}
```

## Monitoring Dashboard

### Service Status Overview

* **🟢 Up**: Service responding normally
* **🔴 Down**: Service niet bereikbaar of geeft errors
* **🟡 Degraded**: Service traag of gedeeltelijk werkend
* **⚫ Unknown**: Status onbekend (tijdens eerste checks)

### Real-time Metrics

* **Response Time**: Gemiddelde response tijd per protocol
* **Uptime Percentage**: Service beschikbaarheid
* **Error Rate**: Percentage failed checks
* **Last Check**: Timestamp van laatste check

### Historische Data

* **24h Uptime Graph**: Uptime over afgelopen 24 uur
* **Response Time Trends**: Performance trends
* **Error Patterns**: Wanneer en waarom services falen
* **Incident History**: Vorige downtime incidenten

## Alert Configuratie

Configureer intelligente alerts gebaseerd op:

### Response Time Alerts

* **Slow Response**: Alert wanneer response time > threshold
* **Degraded Performance**: Progressieve alerts bij performance degradation

### Availability Alerts

* **Service Down**: Alert bij connection failures
* **Partial Outage**: Alert bij degraded service status
* **Intermittent Issues**: Alert bij onregelmatige failures

### Content-based Alerts

* **Unexpected Response**: Alert bij afwijkende responses
* **Status Code Changes**: Alert bij HTTP status code changes
* **Content Validation**: Alert bij verwachte content niet aanwezig

### Protocol-specifieke Alerts

* **DNS Resolution Failures**: Alert bij DNS query failures
* **Email Delivery Issues**: Alert bij SMTP send failures
* **Database Connection Loss**: Alert bij database connectivity issues

## Integration Providers

PulseGuard heeft ingebouwde integraties voor populaire platforms:

### Azure Services

Automatische discovery en monitoring van:

* Azure App Services
* Azure Functions
* Azure SQL Databases
* Azure Storage Accounts
* Azure VMs

### Coolify Instances

Monitoring van Coolify-managed services:

* Docker containers
* Web applications
* Databases
* Background services

### Vercel Deployments

Vercel project monitoring:

* Production deployments
* Preview deployments
* Function endpoints
* Build status

## Advanced Features

### Custom Protocols

Voor services die niet in de standaard lijst staan, kun je custom TCP-based protocols configureren:

```json theme={null}
{
  "protocol": "tcp",
  "protocolConfig": {
    "host": "custom-service.example.com",
    "port": 9999,
    "customProtocol": {
      "connectTimeout": 5000,
      "readTimeout": 10000,
      "expectedBanner": "SERVICE READY",
      "sendCommand": "STATUS\n",
      "expectedResponse": "OK"
    }
  }
}
```

### Multi-Location Monitoring

Services worden gecontroleerd vanaf meerdere globale locaties:

* **Amsterdam (NL)**: Europese monitoring
* **Frankfurt (DE)**: Backup Europese monitoring
* **New York (US)**: Noord-Amerikaanse monitoring

Dit helpt bij het detecteren van regionale availability problemen.

### Scheduled Maintenance

Stel maintenance windows in om false alerts te voorkomen:

```json theme={null}
{
  "maintenanceWindows": [
    {
      "name": "Database Maintenance",
      "startTime": "2024-01-15T02:00:00Z",
      "endTime": "2024-01-15T04:00:00Z",
      "recurrence": "weekly"
    }
  ]
}
```

## Plan Limits

<table>
  <thead>
    <tr>
      <th>Plan</th>
      <th>Services</th>
      <th>Check Interval</th>
      <th>Protocollen</th>
      <th>Geavanceerde Features</th>
      <th>Historie</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>Free</td>
      <td>0</td>
      <td>N/A</td>
      <td>Geen</td>
      <td>❌</td>
      <td>N/A</td>
    </tr>

    <tr>
      <td>Pro</td>
      <td>15</td>
      <td>1 min</td>
      <td>HTTP, TCP</td>
      <td>Basic</td>
      <td>30 dagen</td>
    </tr>

    <tr>
      <td>Expert</td>
      <td>100</td>
      <td>30 sec</td>
      <td>Alles</td>
      <td>Advanced</td>
      <td>90 dagen</td>
    </tr>
  </tbody>
</table>

## API Integration

Gebruik de REST API voor service beheer:

```bash theme={null}
# Alle services ophalen
curl -H "Authorization: Bearer YOUR_TOKEN" https://api.ipulse.one/services

# Nieuwe service toevoegen
curl -X POST https://api.ipulse.one/services \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "API Health Check",
    "protocol": "https",
    "protocolConfig": {
      "host": "api.example.com",
      "port": 443,
      "path": "/health"
    },
    "checkInterval": 5
  }'

# Service status controleren
curl -H "Authorization: Bearer YOUR_TOKEN" https://api.ipulse.one/services/SERVICE_ID

# Handmatige check uitvoeren
curl -X POST https://api.ipulse.one/services/SERVICE_ID/check \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Troubleshooting

### Veelvoorkomende Problemen

**Connection Timeouts**

* Controleer firewall instellingen
* Verificeer dat service draait op gespecificeerde poort
* Controleer network connectivity van monitoring locaties

**Authentication Failures**

* Verificeer credentials
* Controleer of account actief is
* Test handmatig met dezelfde credentials

**Unexpected Response Formats**

* Update expected response configuration
* Controleer API documentation van service
* Gebruik flexible response matching

**SSL/TLS Issues**

* Controleer certificaat validiteit
* Verificeer hostname matching
* Update cipher suite ondersteuning

### Best Practices

1. **Realistische Timeouts**: Stel timeouts in gebaseerd op service performance
2. **Appropriate Intervals**: Gebruik niet te frequente checks voor kritieke services
3. **Content Validation**: Gebruik expected responses voor accurate health checks
4. **Maintenance Windows**: Stel maintenance schedules in om false alerts te voorkomen
5. **Regional Monitoring**: Gebruik multi-location monitoring voor geografisch distributeerde services

### Performance Optimization

1. **Batch Checks**: Gebruik lagere intervals voor non-critical services
2. **Smart Alerting**: Configureer alerts alleen voor echte problemen
3. **Resource Limits**: Stel rate limits in voor API endpoints
4. **Caching**: Cache responses waar mogelijk voor betere performance

### Security Considerations

1. **Credential Management**: Gebruik dedicated monitoring accounts met minimale privileges
2. **Network Security**: Beperk monitoring toegang tot trusted IP ranges
3. **Data Encryption**: Gebruik HTTPS waar mogelijk
4. **Audit Logging**: Controleer service access logs voor security events
