{
  "checks": [
    {
      "name": "Veeam Backup Service",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_service",
      "parameters": {
        "service": "VeeamBackupSvc"
      },
      "sort_order": 0,
      "value_type": "status",
      "description": "",
      "check_config": {
        "service": "VeeamBackupSvc"
      },
      "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": "Veeam Broker Service",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_service",
      "parameters": {
        "service": "VeeamBrokerSvc"
      },
      "sort_order": 1,
      "value_type": "status",
      "description": "",
      "check_config": {
        "service": "VeeamBrokerSvc"
      },
      "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": "Backup Jobs",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": {
        "script_id": "e2d77111-e5cf-58de-9eef-f664230354b4"
      },
      "sort_order": 2,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "e2d77111-e5cf-58de-9eef-f664230354b4"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 900,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Repository Space",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": {
        "script_id": "3b812461-ef68-5c61-ae04-6b183c156cca"
      },
      "sort_order": 3,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "3b812461-ef68-5c61-ae04-6b183c156cca"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 3600,
      "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": "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 - Veeam Backup & Replication",
    "tags": [
      "windows",
      "agent",
      "veeam",
      "backup"
    ],
    "vendor": "veeam",
    "category": "server",
    "os_family": "windows",
    "description": "Veeam B&R monitoring: Backup jobs, repository space. Veeam PowerShell SnapIn muss installiert sein.",
    "ip_required": false,
    "port_layout": null,
    "visual_type": null,
    "snmp_enabled": false,
    "agent_capable": true,
    "requires_snmp": false,
    "description_md": "Veeam B&R monitoring: Backup jobs, repository space. Veeam PowerShell SnapIn muss installiert sein.",
    "requires_agent": true,
    "sysoid_patterns": null,
    "sysdescr_patterns": null,
    "requires_collector": false
  },
  "scripts": [
    {
      "name": "Veeam Backup Jobs",
      "script_id": "e2d77111-e5cf-58de-9eef-f664230354b4",
      "is_builtin": true,
      "description": "Checks Veeam backup job results",
      "interpreter": "powershell",
      "script_body": "try { Add-PSSnapin VeeamPSSnapIn -EA Stop } catch { Write-Output \"UNKNOWN - Veeam PowerShell not available\"; exit 3 }\n$jobs = Get-VBRJob -EA SilentlyContinue\nif (-not $jobs) { Write-Output \"OK - No Veeam jobs configured | total=0\"; exit 0 }\n$failed = @($jobs | Where-Object { $_.GetLastResult() -eq 'Failed' }).Count\n$warning = @($jobs | Where-Object { $_.GetLastResult() -eq 'Warning' }).Count\n$total = $jobs.Count\nif ($failed -gt 0) { Write-Output \"CRITICAL - $failed/$total jobs failed | failed=$failed warning=$warning total=$total\"; exit 2 }\nif ($warning -gt 0) { Write-Output \"WARNING - $warning/$total jobs with warnings | failed=$failed warning=$warning total=$total\"; exit 1 }\nWrite-Output \"OK - All $total jobs successful | failed=0 warning=0 total=$total\"; exit 0",
      "expected_output": "nagios"
    },
    {
      "name": "Veeam Repository Space",
      "script_id": "3b812461-ef68-5c61-ae04-6b183c156cca",
      "is_builtin": true,
      "description": "Checks Veeam backup repository disk usage",
      "interpreter": "powershell",
      "script_body": "try { Add-PSSnapin VeeamPSSnapIn -EA Stop } catch { Write-Output \"UNKNOWN - Veeam PowerShell not available\"; exit 3 }\n$repos = @(Get-VBRBackupRepository -EA SilentlyContinue)\n# Leere Repository-Menge ist KEIN gesundes Ergebnis (Berechtigungen/Verbindung)\n# — vorher fiel das Script mit $null-Prozent auf \"OK - Repos healthy\" durch.\nif ($repos.Count -eq 0) { Write-Output \"UNKNOWN - Keine Veeam-Repositories abfragbar (Berechtigung/Verbindung pruefen)\"; exit 3 }\n$result = @()\nforeach ($r in $repos) {\n    $info = [Veeam.Backup.Core.CBackupRepository]::GetByName($r.Name).GetContainer()\n    $freeGB = [math]::Round($info.CachedFreeSpace.InGigabytes, 1)\n    $totalGB = [math]::Round($info.CachedTotalSpace.InGigabytes, 1)\n    $usedPct = if ($totalGB -gt 0) { [math]::Round(($totalGB - $freeGB) / $totalGB * 100, 0) } else { 0 }\n    $result += \"$($r.Name): ${freeGB}GB free (${usedPct}% used)\"\n}\n$worst = $repos | ForEach-Object {\n    $i = [Veeam.Backup.Core.CBackupRepository]::GetByName($_.Name).GetContainer()\n    if ($i.CachedTotalSpace.InGigabytes -gt 0) { [math]::Round(($i.CachedTotalSpace.InGigabytes - $i.CachedFreeSpace.InGigabytes) / $i.CachedTotalSpace.InGigabytes * 100, 0) } else { 0 }\n} | Measure-Object -Maximum\n$pct = $worst.Maximum\nif ($null -eq $pct) { Write-Output \"UNKNOWN - Repository-Auslastung nicht ermittelbar\"; exit 3 }\nif ($pct -ge 95) { Write-Output \"CRITICAL - Repo ${pct}% full: $($result -join '; ') | used_pct=$pct\"; exit 2 }\nif ($pct -ge 85) { Write-Output \"WARNING - Repo ${pct}% full: $($result -join '; ') | used_pct=$pct\"; exit 1 }\nWrite-Output \"OK - Repos healthy: $($result -join '; ') | used_pct=$pct\"; exit 0",
      "expected_output": "nagios"
    }
  ],
  "schema_version": 1
}