{
  "checks": [
    {
      "name": "Exchange Services",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": {
        "script_id": "fdf8f8a7-b432-5d9c-8e60-718dd653a083"
      },
      "sort_order": 0,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "fdf8f8a7-b432-5d9c-8e60-718dd653a083"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 120,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Exchange DB Status",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": {
        "script_id": "c54ffe79-6f3e-5541-b754-a5c49c6f9935"
      },
      "sort_order": 1,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "c54ffe79-6f3e-5541-b754-a5c49c6f9935"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Public Folder Size (MB)",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": {
        "script_id": "99080e6c-7515-5943-a02a-3c18a2df5ad7"
      },
      "sort_order": 2,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "99080e6c-7515-5943-a02a-3c18a2df5ad7"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 10000,
      "threshold_warn": 5000,
      "interval_seconds": 3600,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "OWA Health",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": {
        "script_id": "b106f2a9-bbf2-5060-a0fb-3d5e4b8ee81d"
      },
      "sort_order": 3,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "b106f2a9-bbf2-5060-a0fb-3d5e4b8ee81d"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "SMTP Port",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "port",
      "parameters": {
        "port": 25
      },
      "sort_order": 4,
      "value_type": "status",
      "description": "",
      "check_config": {
        "port": 25
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "HTTPS/OWA Port",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "port",
      "parameters": {
        "port": 443
      },
      "sort_order": 5,
      "value_type": "status",
      "description": "",
      "check_config": {
        "port": 443
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Agent Overview",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_overview",
      "parameters": {},
      "sort_order": 5,
      "value_type": "info",
      "description": "Live-Telemetrie (CPU, RAM, Disks, Netzwerk, Top-Prozesse, Eventlog, Benutzer) für das Command Center Dashboard.",
      "check_config": {},
      "is_telemetry": true,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 30,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Agent Netzwerk-Status",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_network_state",
      "parameters": {},
      "sort_order": 6,
      "value_type": "info",
      "description": "Interfaces, Listener, Verbindungen, Routing.",
      "check_config": {},
      "is_telemetry": true,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "SSL Certificate",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssl_certificate",
      "parameters": {
        "port": 443,
        "hostname": "{host}",
        "crit_days": 7,
        "warn_days": 30
      },
      "sort_order": 6,
      "value_type": "duration",
      "description": "",
      "check_config": {
        "port": 443,
        "hostname": "{host}",
        "crit_days": 7,
        "warn_days": 30
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 86400,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Agent Sicherheit",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_security",
      "parameters": {},
      "sort_order": 7,
      "value_type": "info",
      "description": "Defender, Firewall, TPM, BitLocker, offene Ports, Zertifikate.",
      "check_config": {},
      "is_telemetry": true,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 3600,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Agent Lebenszyklus",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_lifecycle",
      "parameters": {},
      "sort_order": 8,
      "value_type": "info",
      "description": "Aktivierung, Domain, Update-Historie, BSODs, Backup.",
      "check_config": {},
      "is_telemetry": true,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 43200,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Agent Inventar",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_inventory",
      "parameters": {},
      "sort_order": 9,
      "value_type": "info",
      "description": "Installierte Programme, geplante Tasks, Autostart, Dienste.",
      "check_config": {},
      "is_telemetry": true,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 21600,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Agent Hardware",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_hardware",
      "parameters": {},
      "sort_order": 10,
      "value_type": "info",
      "description": "CPU, Speicher, Mainboard, BIOS, Disks, GPUs, Akku.",
      "check_config": {},
      "is_telemetry": true,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 86400,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    }
  ],
  "profile": {
    "icon": "server",
    "name": "Windows - Microsoft Exchange",
    "tags": [
      "windows",
      "agent",
      "exchange",
      "mail"
    ],
    "vendor": "microsoft",
    "category": "server",
    "os_family": "windows",
    "description": "Exchange Server: Services, Database, Public Folders, OWA, Zertifikate. Exchange Management Shell muss verfügbar sein.",
    "ip_required": true,
    "port_layout": null,
    "visual_type": null,
    "snmp_enabled": false,
    "agent_capable": true,
    "requires_snmp": false,
    "description_md": "Exchange Server: Services, Database, Public Folders, OWA, Zertifikate. Exchange Management Shell muss verfügbar sein.",
    "requires_agent": true,
    "sysoid_patterns": null,
    "sysdescr_patterns": null,
    "requires_collector": true
  },
  "scripts": [
    {
      "name": "Exchange Services",
      "script_id": "fdf8f8a7-b432-5d9c-8e60-718dd653a083",
      "is_builtin": true,
      "description": "Checks Exchange Server service status",
      "interpreter": "powershell",
      "script_body": "$svcNames = @('MSExchangeServiceHost','MSExchangeTransport','MSExchangeIS',\n               'MSExchangeADTopology','MSExchangeMailboxReplication','MSExchangeRPC')\n$stopped = @()\nforeach ($s in $svcNames) {\n    $svc = Get-Service $s -EA SilentlyContinue\n    if ($svc -and $svc.Status -ne 'Running') { $stopped += $s }\n    elseif (-not $svc) { $stopped += \"$s (missing)\" }\n}\nif ($stopped.Count -gt 0) {\n    Write-Output \"CRITICAL - $($stopped.Count) Exchange services down: $($stopped -join ', ') | stopped=$($stopped.Count)\"\n    exit 2\n}\nWrite-Output \"OK - All Exchange services running | stopped=0\"; exit 0",
      "expected_output": "nagios"
    },
    {
      "name": "Exchange Database Status",
      "script_id": "c54ffe79-6f3e-5541-b754-a5c49c6f9935",
      "is_builtin": true,
      "description": "Checks Exchange mailbox database mount status",
      "interpreter": "powershell",
      "script_body": "Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn -EA SilentlyContinue\n$dbs = Get-MailboxDatabase -Status -EA SilentlyContinue\nif (-not $dbs) { Write-Output \"UNKNOWN - Cannot query Exchange databases\"; exit 3 }\n$unmounted = @($dbs | Where-Object { -not $_.Mounted })\nif ($unmounted.Count -gt 0) {\n    Write-Output \"CRITICAL - $($unmounted.Count) DBs not mounted: $(($unmounted|ForEach-Object{$_.Name}) -join ', ') | unmounted=$($unmounted.Count) total=$($dbs.Count)\"\n    exit 2\n}\nWrite-Output \"OK - All $($dbs.Count) databases mounted | unmounted=0 total=$($dbs.Count)\"; exit 0",
      "expected_output": "nagios"
    },
    {
      "name": "Exchange Public Folder Size",
      "script_id": "99080e6c-7515-5943-a02a-3c18a2df5ad7",
      "is_builtin": true,
      "description": "Returns Exchange public folder size in MB",
      "interpreter": "powershell",
      "script_body": "Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn -EA SilentlyContinue\n$stats = Get-PublicFolderStatistics -EA SilentlyContinue | Measure-Object -Property TotalItemSize -Sum\n$sizeMB = [math]::Round($stats.Sum / 1MB, 0)\nWrite-Output \"$sizeMB\"",
      "expected_output": "text"
    },
    {
      "name": "Exchange OWA Health",
      "script_id": "b106f2a9-bbf2-5060-a0fb-3d5e4b8ee81d",
      "is_builtin": true,
      "description": "Checks Outlook Web Access health endpoint",
      "interpreter": "powershell",
      "script_body": "try {\n    $r = Invoke-WebRequest -Uri \"https://localhost/owa/healthcheck.htm\" -UseBasicParsing -TimeoutSec 10 -SkipCertificateCheck -EA Stop\n    if ($r.StatusCode -eq 200) { Write-Output \"OK - OWA responding (HTTP $($r.StatusCode)) | status=$($r.StatusCode)\"; exit 0 }\n    Write-Output \"WARNING - OWA returned HTTP $($r.StatusCode) | status=$($r.StatusCode)\"; exit 1\n} catch {\n    Write-Output \"CRITICAL - OWA not responding: $_ | status=0\"; exit 2\n}",
      "expected_output": "nagios"
    }
  ],
  "schema_version": 1
}