{
  "checks": [
    {
      "name": "SQL Server Service",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_service",
      "parameters": {
        "service": "MSSQLSERVER"
      },
      "sort_order": 0,
      "value_type": "status",
      "description": "",
      "check_config": {
        "service": "MSSQLSERVER"
      },
      "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": "SQL Agent Service",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_service",
      "parameters": {
        "service": "SQLSERVERAGENT"
      },
      "sort_order": 1,
      "value_type": "status",
      "description": "",
      "check_config": {
        "service": "SQLSERVERAGENT"
      },
      "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": "Database Status",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": {
        "script_id": "d68a25c1-eb48-5068-a564-77523b4ff66f"
      },
      "sort_order": 2,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "d68a25c1-eb48-5068-a564-77523b4ff66f"
      },
      "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": "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 - SQL Server",
    "tags": [
      "windows",
      "agent",
      "sql",
      "database"
    ],
    "vendor": "microsoft",
    "category": "server",
    "os_family": "windows",
    "description": "Microsoft SQL Server: Services, Database-Status. SqlServer-Modul oder SQLCMD erforderlich.",
    "ip_required": false,
    "port_layout": null,
    "visual_type": null,
    "snmp_enabled": false,
    "agent_capable": true,
    "requires_snmp": false,
    "description_md": "Microsoft SQL Server: Services, Database-Status. SqlServer-Modul oder SQLCMD erforderlich.",
    "requires_agent": true,
    "sysoid_patterns": null,
    "sysdescr_patterns": null,
    "requires_collector": false
  },
  "scripts": [
    {
      "name": "SQL Server Database Status",
      "script_id": "d68a25c1-eb48-5068-a564-77523b4ff66f",
      "is_builtin": true,
      "description": "Checks SQL Server database online status",
      "interpreter": "powershell",
      "script_body": "try {\n    $dbs = Invoke-Sqlcmd -Query \"SELECT name, state_desc FROM sys.databases WHERE state_desc <> 'ONLINE' AND name NOT IN ('tempdb')\" -EA Stop\n} catch {\n    Write-Output \"UNKNOWN - Cannot query SQL Server: $_\"; exit 3\n}\nif ($dbs -and @($dbs).Count -gt 0) {\n    $names = ($dbs | ForEach-Object { \"$($_.name)=$($_.state_desc)\" }) -join ', '\n    Write-Output \"CRITICAL - $(@($dbs).Count) databases not online: $names | offline=@($dbs).Count\"\n    exit 2\n}\nWrite-Output \"OK - All databases online | offline=0\"; exit 0",
      "expected_output": "nagios"
    }
  ],
  "schema_version": 1
}