{
  "checks": [
    {
      "name": "CPU",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_cpu",
      "parameters": {},
      "sort_order": 0,
      "value_type": "gauge",
      "description": "",
      "check_config": {},
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 95,
      "threshold_warn": 80,
      "interval_seconds": 60,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Memory",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_memory",
      "parameters": {},
      "sort_order": 1,
      "value_type": "gauge",
      "description": "",
      "check_config": {},
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 95,
      "threshold_warn": 85,
      "interval_seconds": 60,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Disk",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_disk",
      "parameters": {
        "crit": 90,
        "warn": 80
      },
      "sort_order": 2,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "crit": 90,
        "warn": 80
      },
      "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": "Load Average %",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": {
        "script_id": "af11cbd5-388d-5a54-b153-379e8ecaadbd"
      },
      "sort_order": 3,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "af11cbd5-388d-5a54-b153-379e8ecaadbd"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 95,
      "threshold_warn": 80,
      "interval_seconds": 120,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Swap %",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": {
        "script_id": "9064100c-dd0b-556b-abf8-10906386e1e3"
      },
      "sort_order": 4,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "9064100c-dd0b-556b-abf8-10906386e1e3"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 80,
      "threshold_warn": 50,
      "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": "Logged Users",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": {
        "script_id": "b416052f-c953-51c6-b277-8cf31ca856f1"
      },
      "sort_order": 5,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "b416052f-c953-51c6-b277-8cf31ca856f1"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 25,
      "threshold_warn": 10,
      "interval_seconds": 300,
      "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": "Zombie Processes",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": {
        "script_id": "3769a9d6-1382-52cd-8f86-02a20786a892"
      },
      "sort_order": 6,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "3769a9d6-1382-52cd-8f86-02a20786a892"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 5,
      "threshold_warn": 1,
      "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": "Total Processes",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": {
        "script_id": "d6b5f88f-aa72-5912-aee5-931a6f5309da"
      },
      "sort_order": 7,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "d6b5f88f-aa72-5912-aee5-931a6f5309da"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 500,
      "threshold_warn": 300,
      "interval_seconds": 300,
      "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": "sshd",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_service",
      "parameters": {
        "service": "sshd"
      },
      "sort_order": 8,
      "value_type": "status",
      "description": "",
      "check_config": {
        "service": "sshd"
      },
      "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": "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
    },
    {
      "name": "Journal Errors",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_eventlog",
      "parameters": {},
      "sort_order": 90,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "level": "error",
        "minutes": "60"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 5,
      "threshold_warn": 1,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Enabled Services",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_services_auto",
      "parameters": {},
      "sort_order": 91,
      "value_type": "status",
      "description": "",
      "check_config": {
        "exclude": []
      },
      "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": "Docker-Daemon",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": null,
      "sort_order": 500,
      "value_type": "status",
      "description": "Prüft ob der Docker-Daemon läuft und erreichbar ist; nennt Version und Anzahl aktiver Container.",
      "check_config": {
        "script_id": "b2789810-4b48-5988-925e-a22b0c5dd8d7"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": null,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Container-Gesundheit",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": null,
      "sort_order": 510,
      "value_type": "gauge",
      "description": "Container mit fehlgeschlagenem Healthcheck (Docker health=unhealthy); nennt die betroffenen Container.",
      "check_config": {
        "script_id": "66cdad98-229f-5d52-820a-632480511a2c"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": null,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Restart-Schleifen",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": null,
      "sort_order": 520,
      "value_type": "gauge",
      "description": "Erkennt Container in einer Crash-/Restart-Schleife (Backoff oder viele Restarts kurz nacheinander).",
      "check_config": {
        "script_id": "c71446d5-3845-5a38-b0c2-396285246595"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": null,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Fehler-Exits (letzte Stunde)",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": null,
      "sort_order": 530,
      "value_type": "gauge",
      "description": "Container, die in der letzten Stunde mit einem Fehler (Exit-Code ≠ 0) beendet wurden.",
      "check_config": {
        "script_id": "85b680b6-6af0-5164-8e74-2e4e50401787"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 120,
      "threshold_direction": null,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Laufende Container",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": null,
      "sort_order": 540,
      "value_type": "gauge",
      "description": "Anzahl laufender Container als Trend. Optional eine Mindest-Anzahl als Schwellwert setzen.",
      "check_config": {
        "script_id": "47d90df6-6396-56bf-8a4c-0d98a739f8a9"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": null,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Docker-Speicher (%)",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": null,
      "sort_order": 550,
      "value_type": "gauge",
      "description": "Füllstand des Docker-Datenverzeichnisses (docker root dir). Warnt ab 80 %, kritisch ab 90 %.",
      "check_config": {
        "script_id": "b6e58e69-41a1-519f-afc4-cdb6468aa7c9"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 90,
      "threshold_warn": 80,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "Verwaiste Images",
      "auto_add": true,
      "check_mode": "agent",
      "check_type": "agent_script",
      "parameters": null,
      "sort_order": 560,
      "value_type": "gauge",
      "description": "Anzahl verwaister (dangling) Images als Aufräum-Hinweis — meldet nie kritisch.",
      "check_config": {
        "script_id": "08e74b8c-d443-5a37-8256-cae6ba72d415"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 3600,
      "threshold_direction": null,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    }
  ],
  "profile": {
    "icon": "box",
    "name": "Docker Host",
    "tags": [
      "docker",
      "container",
      "agent"
    ],
    "vendor": "generic",
    "category": "server",
    "os_family": "linux",
    "description": "Linux-VM mit Docker (Agent): Host-Vitals (CPU/RAM/Disk) plus Docker-Daemon, Container-Gesundheit, Restart-Schleifen, Fehler-Exits, Speicher — alles über den Agenten, ohne SSH.",
    "ip_required": false,
    "match_rules": null,
    "port_layout": null,
    "visual_type": null,
    "snmp_enabled": false,
    "agent_capable": true,
    "requires_snmp": true,
    "description_md": "Comprehensive Linux monitoring via Vesana Agent: CPU, RAM, disk, load, swap, users, processes.",
    "requires_agent": true,
    "sysoid_patterns": null,
    "sysdescr_patterns": null,
    "requires_collector": true
  },
  "scripts": [
    {
      "name": "Linux Load Average %",
      "script_id": "af11cbd5-388d-5a54-b153-379e8ecaadbd",
      "is_builtin": true,
      "description": "Returns load average as percentage of cores",
      "interpreter": "bash",
      "script_body": "#!/bin/bash\n# Mess-Fehler -> UNKNOWN (exit 3), nie stilles 0%.\nload=$(awk '{print $1}' /proc/loadavg 2>/dev/null)\n[ -n \"$load\" ] || exit 3\ncores=$(nproc 2>/dev/null || echo 1)\necho \"$load $cores\" | awk '{printf \"%d\", ($1/$2)*100}'",
      "expected_output": "text"
    },
    {
      "name": "Linux Swap Usage %",
      "script_id": "9064100c-dd0b-556b-abf8-10906386e1e3",
      "is_builtin": true,
      "description": "Returns swap usage percentage",
      "interpreter": "bash",
      "script_body": "#!/bin/bash\n# /proc/meminfo statt `free` (locale-fest); Mess-Fehler -> UNKNOWN.\ntotal=$(awk '/^SwapTotal:/{print $2}' /proc/meminfo 2>/dev/null)\nfree_=$(awk '/^SwapFree:/{print $2}' /proc/meminfo 2>/dev/null)\n[ -n \"$total\" ] && [ -n \"$free_\" ] || exit 3\nif [ \"$total\" -eq 0 ]; then echo \"0\"; exit 0; fi\necho $(( (total - free_) * 100 / total ))",
      "expected_output": "text"
    },
    {
      "name": "Linux Logged Users",
      "script_id": "b416052f-c953-51c6-b277-8cf31ca856f1",
      "is_builtin": true,
      "description": "Returns count of logged-in users",
      "interpreter": "bash",
      "script_body": "#!/bin/bash\n# `who` fehlt/scheitert (Minimal-Container ohne utmp) -> UNKNOWN statt 0.\nout=$(who 2>/dev/null) || exit 3\nprintf '%s\\n' \"$out\" | grep -c . || echo 0",
      "expected_output": "text"
    },
    {
      "name": "Linux Zombie Processes",
      "script_id": "3769a9d6-1382-52cd-8f86-02a20786a892",
      "is_builtin": true,
      "description": "Returns count of zombie processes",
      "interpreter": "bash",
      "script_body": "#!/bin/bash\n# ps-Fehler EHRLICH als UNKNOWN melden — vorher wurde stderr verworfen und\n# awk druckte 0 → falsches gruenes \"0 Zombies\" obwohl nichts gemessen wurde.\nout=$(ps aux 2>/dev/null) || exit 3\n[ -n \"$out\" ] || exit 3\nprintf '%s\\n' \"$out\" | awk '$8 ~ /^Z/ {c++} END {print c+0}'",
      "expected_output": "text"
    },
    {
      "name": "Linux Total Processes",
      "script_id": "d6b5f88f-aa72-5912-aee5-931a6f5309da",
      "is_builtin": true,
      "description": "Returns total process count",
      "interpreter": "bash",
      "script_body": "#!/bin/bash\n# ps-Fehler oder unmoegliche 0 -> UNKNOWN, nie stilles gruenes 0.\nout=$(ps aux --no-heading 2>/dev/null) || exit 3\nn=$(printf '%s\\n' \"$out\" | grep -c .)\n[ \"$n\" -gt 0 ] || exit 3\necho \"$n\"",
      "expected_output": "text"
    },
    {
      "name": "Docker — Daemon",
      "script_id": "b2789810-4b48-5988-925e-a22b0c5dd8d7",
      "is_builtin": false,
      "description": "Prüft ob der Docker-Daemon läuft und erreichbar ist; nennt Version und Anzahl aktiver Container.",
      "interpreter": "bash",
      "script_body": "# Docker-Daemon erreichbar? (Nagios: 0=OK 2=CRITICAL 3=UNKNOWN)\ncommand -v docker >/dev/null 2>&1 || { echo \"UNKNOWN - docker-CLI nicht gefunden (Docker installiert?)\"; exit 3; }\nver=$(docker version --format '{{.Server.Version}}' 2>/dev/null)\nif [ -z \"$ver\" ]; then\n  echo \"CRITICAL - Docker-Daemon nicht erreichbar (Dienst gestoppt oder Socket-Berechtigung fehlt)\"; exit 2\nfi\nrunning=$(docker ps -q 2>/dev/null | wc -l | tr -d ' ')\ntotal=$(docker ps -aq 2>/dev/null | wc -l | tr -d ' ')\necho \"OK - Docker laeuft - v$ver - $running/$total Container aktiv | running=$running\"\nexit 0\n",
      "expected_output": "nagios"
    },
    {
      "name": "Docker — Container-Gesundheit",
      "script_id": "66cdad98-229f-5d52-820a-632480511a2c",
      "is_builtin": false,
      "description": "Container mit fehlgeschlagenem Healthcheck (Docker health=unhealthy); nennt die betroffenen Container.",
      "interpreter": "bash",
      "script_body": "# Container mit fehlgeschlagenem Healthcheck (Nagios)\ncommand -v docker >/dev/null 2>&1 || { echo \"UNKNOWN - docker nicht gefunden\"; exit 3; }\ndocker version >/dev/null 2>&1 || { echo \"UNKNOWN - Docker-Daemon nicht erreichbar\"; exit 3; }\nunhealthy=$(docker ps --filter health=unhealthy --format '{{.Names}}' 2>/dev/null | paste -sd, - | sed 's/,/, /g')\nn=$(docker ps --filter health=unhealthy -q 2>/dev/null | wc -l | tr -d ' ')\nwithhc=$(docker ps --filter health=healthy -q 2>/dev/null | wc -l | tr -d ' ')\nif [ \"$n\" -eq 0 ]; then\n  echo \"OK - Keine ungesunden Container ($withhc mit aktivem Healthcheck, alle OK) | unhealthy=0\"\n  exit 0\nfi\necho \"CRITICAL - $n Container ungesund: $unhealthy | unhealthy=$n\"\nexit 2\n",
      "expected_output": "nagios"
    },
    {
      "name": "Docker — Restart-Schleifen",
      "script_id": "c71446d5-3845-5a38-b0c2-396285246595",
      "is_builtin": false,
      "description": "Erkennt Container in einer Crash-/Restart-Schleife (Backoff oder viele Restarts kurz nacheinander).",
      "interpreter": "bash",
      "script_body": "# Container in einer Restart-Schleife: entweder gerade im Docker-Backoff\n# (Status \"restarting\") ODER laufend, aber mit vielen Restarts erst kuerzlich\n# (faengt schnelle Crash-Loops, die zwischen den Abstuerzen kurz \"Up\" sind).\ncommand -v docker >/dev/null 2>&1 || { echo \"UNKNOWN - docker nicht gefunden\"; exit 3; }\ndocker version >/dev/null 2>&1 || { echo \"UNKNOWN - Docker-Daemon nicht erreichbar\"; exit 3; }\nnow=$(date +%s); loop=\"\"; n=0\nwhile IFS='|' read -r name st rc started; do\n  [ -z \"$name\" ] && continue\n  name=${name#/}\n  if [ \"$st\" = \"restarting\" ]; then\n    loop=\"$loop, $name (${rc}x, Backoff)\"; n=$((n+1)); continue\n  fi\n  if [ \"${rc:-0}\" -ge 5 ]; then\n    sts=$(date -d \"$started\" +%s 2>/dev/null || echo 0)\n    if [ \"$sts\" -gt 0 ] && [ $((now - sts)) -le 300 ]; then\n      loop=\"$loop, $name (${rc}x Restarts, vor $((now-sts))s neu gestartet)\"; n=$((n+1))\n    fi\n  fi\ndone <<INNER\n$(docker ps -aq 2>/dev/null | xargs -r docker inspect --format '{{.Name}}|{{.State.Status}}|{{.RestartCount}}|{{.State.StartedAt}}' 2>/dev/null)\nINNER\nloop=${loop#, }\nif [ \"$n\" -eq 0 ]; then echo \"OK - Kein Container in einer Restart-Schleife | looping=0\"; exit 0; fi\necho \"CRITICAL - Restart-Schleife: $loop | looping=$n\"; exit 2\n",
      "expected_output": "nagios"
    },
    {
      "name": "Docker — Fehler-Exits",
      "script_id": "85b680b6-6af0-5164-8e74-2e4e50401787",
      "is_builtin": false,
      "description": "Container, die in der letzten Stunde mit einem Fehler (Exit-Code ≠ 0) beendet wurden.",
      "interpreter": "bash",
      "script_body": "# Container, die in der letzten Stunde mit Fehler (Exit != 0) beendet wurden.\n# Ein Batch-inspect statt eines pro Container (schnell auch bei vielen).\ncommand -v docker >/dev/null 2>&1 || { echo \"UNKNOWN - docker nicht gefunden\"; exit 3; }\ndocker version >/dev/null 2>&1 || { echo \"UNKNOWN - Docker-Daemon nicht erreichbar\"; exit 3; }\nnow=$(date +%s); bad=\"\"; n=0\nwhile IFS='|' read -r name code fin; do\n  [ -z \"$name\" ] && continue\n  name=${name#/}\n  [ \"$code\" = \"0\" ] && continue\n  fints=$(date -d \"$fin\" +%s 2>/dev/null || echo 0)\n  [ \"$fints\" -eq 0 ] && continue\n  if [ $((now - fints)) -le 3600 ]; then bad=\"$bad, $name (exit $code)\"; n=$((n+1)); fi\ndone <<INNER\n$(docker ps -a --filter status=exited -q 2>/dev/null | xargs -r docker inspect --format '{{.Name}}|{{.State.ExitCode}}|{{.State.FinishedAt}}' 2>/dev/null)\nINNER\nbad=${bad#, }\nif [ \"$n\" -eq 0 ]; then echo \"OK - Keine unerwartet beendeten Container (letzte Stunde) | exited_error=0\"; exit 0; fi\necho \"WARNING - $n mit Fehler beendet: $bad | exited_error=$n\"; exit 1\n",
      "expected_output": "nagios"
    },
    {
      "name": "Docker — Laufende Container",
      "script_id": "47d90df6-6396-56bf-8a4c-0d98a739f8a9",
      "is_builtin": false,
      "description": "Anzahl laufender Container als Trend. Optional eine Mindest-Anzahl als Schwellwert setzen.",
      "interpreter": "bash",
      "script_body": "# Anzahl laufender Container - Gauge/Trend (Schwellwerte optional per Check)\ncommand -v docker >/dev/null 2>&1 || { echo \"UNKNOWN - docker nicht gefunden\"; exit 3; }\ndocker version >/dev/null 2>&1 || { echo \"UNKNOWN - Docker-Daemon nicht erreichbar\"; exit 3; }\nn=$(docker ps -q 2>/dev/null | wc -l | tr -d ' ')\necho \"OK - $n Container laufen | running=$n\"\nexit 0\n",
      "expected_output": "nagios"
    },
    {
      "name": "Docker — Speicherbelegung",
      "script_id": "b6e58e69-41a1-519f-afc4-cdb6468aa7c9",
      "is_builtin": false,
      "description": "Füllstand des Docker-Datenverzeichnisses (docker root dir). Warnt ab 80 %, kritisch ab 90 %.",
      "interpreter": "bash",
      "script_body": "# Fuellstand des Docker-Datenverzeichnisses (/var/lib/docker) - Gauge (warn/crit am Check)\ncommand -v docker >/dev/null 2>&1 || { echo \"UNKNOWN - docker nicht gefunden\"; exit 3; }\ndir=$(docker info --format '{{.DockerRootDir}}' 2>/dev/null); [ -z \"$dir\" ] && dir=/var/lib/docker\nline=$(df -P \"$dir\" 2>/dev/null | tail -1)\n[ -z \"$line\" ] && { echo \"UNKNOWN - Fuellstand fuer $dir nicht ermittelbar\"; exit 3; }\npct=$(echo \"$line\" | awk '{gsub(/%/,\"\",$5); print $5+0}')\nrecl=$(docker system df 2>/dev/null | awk 'NR>1{print $NF}' | grep -Eo '^[0-9.]+[A-Za-z]+' | paste -sd+ - )\necho \"Docker-Speicher ${pct}% belegt auf $dir (rueckgewinnbar: ${recl:-n/a}) | usage=${pct}%\"\nexit 0\n",
      "expected_output": "nagios"
    },
    {
      "name": "Docker — Verwaiste Images",
      "script_id": "08e74b8c-d443-5a37-8256-cae6ba72d415",
      "is_builtin": false,
      "description": "Anzahl verwaister (dangling) Images als Aufräum-Hinweis — meldet nie kritisch.",
      "interpreter": "bash",
      "script_body": "# Verwaiste (dangling) Images - reiner Hygiene-Hinweis, meldet nie kritisch\ncommand -v docker >/dev/null 2>&1 || { echo \"UNKNOWN - docker nicht gefunden\"; exit 3; }\ndocker version >/dev/null 2>&1 || { echo \"UNKNOWN - Docker-Daemon nicht erreichbar\"; exit 3; }\nn=$(docker images -f dangling=true -q 2>/dev/null | wc -l | tr -d ' ')\nif [ \"$n\" -eq 0 ]; then\n  echo \"OK - Keine verwaisten Images | dangling=0\"; exit 0\nfi\necho \"OK - $n verwaiste Images - mit 'docker image prune' aufraeumbar | dangling=$n\"\nexit 0\n",
      "expected_output": "nagios"
    }
  ],
  "schema_version": 1
}