{
  "checks": [
    {
      "name": "Ping",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ping",
      "parameters": {},
      "sort_order": 0,
      "value_type": "duration",
      "description": "",
      "check_config": {},
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": "upper",
      "is_reachability_hint": true,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "HTTPS Port",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "port",
      "parameters": {
        "port": 443
      },
      "sort_order": 1,
      "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",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "SSH Port",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "port",
      "parameters": {
        "port": 22
      },
      "sort_order": 2,
      "value_type": "status",
      "description": "",
      "check_config": {
        "port": 22
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "vSphere Agent Port (902)",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "port",
      "parameters": {
        "port": 902
      },
      "sort_order": 3,
      "value_type": "status",
      "description": "",
      "check_config": {
        "port": 902
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 60,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "ESXi — Verbindungsstatus (hostd)",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "6e41463c-8f30-5bc2-afcb-5d2485d6a47a",
        "match_regex": "^connected$",
        "fail_if_match": false
      },
      "sort_order": 5,
      "value_type": "status",
      "description": "",
      "check_config": {
        "script_id": "281cbc6e-49ab-5331-ad27-8d795cb81662"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "ESXi — Datastore-Belegung max (%)",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "5dcb57e9-b330-54a9-8767-49b5ef2193f4",
        "value_unit": "%",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 6,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "a3a55bb3-e4a6-54de-9f8b-6974ab6359db",
        "value_unit": "%"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 95.0,
      "threshold_warn": 85.0,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "ESXi — VMs (an/gesamt)",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "da4557bb-a17f-5941-9167-cbec5c19073b",
        "value_unit": "vms",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 8,
      "value_type": "info",
      "description": "",
      "check_config": {
        "script_id": "ff0225af-3210-55b9-9778-41d3779cec50",
        "value_unit": "vms"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 600,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "ESXi — Hardware-Sensoren (IPMI)",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "398c33af-5fe9-591f-94db-d45cdbba41ba",
        "value_unit": "sensors",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 9,
      "value_type": "status",
      "description": "",
      "check_config": {
        "script_id": "6edddc58-0be2-50fc-8cc4-29af221d1bb8"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "SSL Certificate",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssl_certificate",
      "parameters": {
        "port": 443
      },
      "sort_order": 9,
      "value_type": "duration",
      "description": "",
      "check_config": {
        "port": 443,
        "crit_days": 7,
        "warn_days": 30,
        "allow_self_signed": true
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 86400,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "ESXi — CPU-Auslastung (%)",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "e249bbf3-c8a2-5359-9d44-750a67cbdf06",
        "value_unit": "%",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 10,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "584acd67-bdcb-52e5-b6f9-813b618e3b5e",
        "value_unit": "%"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 95.0,
      "threshold_warn": 80.0,
      "interval_seconds": 120,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "ESXi — RAM-Auslastung (%)",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "9648d6fb-29d0-5b62-a4ee-1331b879bff8",
        "value_unit": "%",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 11,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "1ca33a0c-459a-5ced-b8a7-5bd1856045c6",
        "value_unit": "%"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": 95.0,
      "threshold_warn": 90.0,
      "interval_seconds": 120,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "ESXi — Uptime",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "4c1836c8-f6ee-5a0d-9128-486e0c27e18d",
        "value_unit": "days",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 12,
      "value_type": "info",
      "description": "",
      "check_config": {
        "script_id": "603ffa79-d290-5277-9f45-b3cc9de5af3d",
        "value_unit": "days"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 3600,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "ESXi — Datastores nicht eingehängt",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "3e0ba34c-bc07-5a75-a64c-f6d67bb2044d",
        "value_unit": "ds",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 13,
      "value_type": "gauge",
      "description": "",
      "check_config": {
        "script_id": "a4b32a08-b555-5107-876e-240d150edde1",
        "value_unit": "ds"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "ESXi — Uplinks ohne Link",
      "auto_add": true,
      "check_mode": "passive",
      "check_type": "ssh_script",
      "parameters": {
        "script_id": "d54eb2cd-6892-5016-a712-b3f1e1342f9b",
        "value_unit": "nics",
        "extract_value": "^(\\d+)"
      },
      "sort_order": 14,
      "value_type": "status",
      "description": "",
      "check_config": {
        "script_id": "84ea12fe-d219-50cf-b664-edd5b3b6a4c7"
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 300,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    },
    {
      "name": "System Description",
      "auto_add": false,
      "check_mode": "passive",
      "check_type": "snmp_oid",
      "parameters": {
        "oid": "1.3.6.1.2.1.1.1.0",
        "unit": ""
      },
      "sort_order": 15,
      "value_type": "info",
      "description": "",
      "check_config": {
        "oid": "1.3.6.1.2.1.1.1.0",
        "unit": ""
      },
      "is_telemetry": false,
      "interpretation": null,
      "threshold_crit": null,
      "threshold_warn": null,
      "interval_seconds": 86400,
      "threshold_direction": "upper",
      "is_reachability_hint": false,
      "confirmation_attempts": 1,
      "confirmation_interval_seconds": 10
    }
  ],
  "profile": {
    "icon": "server",
    "name": "VMware ESXi Host",
    "tags": [
      "vmware",
      "esxi",
      "snmp",
      "virtualization"
    ],
    "vendor": "vmware",
    "category": "server",
    "os_family": null,
    "description": "ESXi Host via SNMP: CPU, Memory, Uptime, Hardware-Sensoren, Datastore.",
    "ip_required": true,
    "port_layout": null,
    "visual_type": null,
    "snmp_enabled": true,
    "agent_capable": false,
    "sysoid_patterns": null,
    "sysdescr_patterns": null
  },
  "scripts": [
    {
      "name": "ESXi — CPU-Auslastung (%)",
      "script_id": "584acd67-bdcb-52e5-b6f9-813b618e3b5e",
      "is_builtin": true,
      "description": "CPU-Auslastung des ESXi-Hosts aus vim-cmd hostsvc/hostsummary (funktioniert auf ESXi 6.x-8.x, kein esxtop nötig).",
      "interpreter": "bash",
      "script_body": "s=$(vim-cmd hostsvc/hostsummary 2>/dev/null)\n[ -z \"$s\" ] && { echo \"UNKNOWN - keine Antwort von vim-cmd (SSH-Zugang/Shell pruefen)\"; exit 3; }\nvals=$(printf '%s\\n' \"$s\" | awk '\n/overallCpuUsage =/ {gsub(/[^0-9]/,\"\",$3); use=$3}\n/cpuMhz =/          {gsub(/[^0-9]/,\"\",$3); mhz=$3}\n/numCpuCores =/     {gsub(/[^0-9]/,\"\",$3); c=$3}\nEND { if (use==\"\" || mhz==\"\" || c==\"\" || mhz*c==0) exit 1; printf \"%d %d %d\", (use*100)/(mhz*c), use, mhz*c }')\n[ -z \"$vals\" ] && { echo \"UNKNOWN - hostsummary nicht lesbar\"; exit 3; }\nset -- $vals\necho \"CPU: ${1}% (${2} von ${3} MHz)\"",
      "expected_output": "exit_code"
    },
    {
      "name": "ESXi — RAM-Auslastung (%)",
      "script_id": "1ca33a0c-459a-5ced-b8a7-5bd1856045c6",
      "is_builtin": true,
      "description": "RAM-Auslastung des ESXi-Hosts aus vim-cmd hostsvc/hostsummary.",
      "interpreter": "bash",
      "script_body": "s=$(vim-cmd hostsvc/hostsummary 2>/dev/null)\n[ -z \"$s\" ] && { echo \"UNKNOWN - keine Antwort von vim-cmd (SSH-Zugang/Shell pruefen)\"; exit 3; }\nvals=$(printf '%s\\n' \"$s\" | awk '\n/overallMemoryUsage =/ {gsub(/[^0-9]/,\"\",$3); used=$3}\n/memorySize =/         {gsub(/[^0-9]/,\"\",$3); size=$3}\nEND { if (used==\"\" || size==\"\" || size==0) exit 1; printf \"%d %d %d\", (used*1048576*100)/size, used/1024, size/1073741824 }')\n[ -z \"$vals\" ] && { echo \"UNKNOWN - hostsummary nicht lesbar\"; exit 3; }\nset -- $vals\necho \"RAM: ${1}% (${2} von ${3} GB)\"",
      "expected_output": "exit_code"
    },
    {
      "name": "ESXi — Uptime",
      "script_id": "603ffa79-d290-5277-9f45-b3cc9de5af3d",
      "is_builtin": true,
      "description": "Host-Uptime in Tagen aus vim-cmd hostsvc/hostsummary.",
      "interpreter": "bash",
      "script_body": "s=$(vim-cmd hostsvc/hostsummary 2>/dev/null | awk '/uptime =/ {gsub(/[^0-9]/,\"\",$3); print $3; exit}')\n[ -z \"$s\" ] && { echo \"UNKNOWN - keine Antwort von vim-cmd\"; exit 3; }\nd=$((s/86400)); h=$(( (s%86400)/3600 ))\necho \"Uptime: ${d}d ${h}h\"",
      "expected_output": "exit_code"
    },
    {
      "name": "ESXi — Verbindungsstatus (hostd)",
      "script_id": "281cbc6e-49ab-5331-ad27-8d795cb81662",
      "is_builtin": true,
      "description": "hostd-Verbindungsstatus (connected/disconnected/notResponding).",
      "interpreter": "bash",
      "script_body": "state=$(vim-cmd hostsvc/runtimeinfo 2>/dev/null | sed -n 's/.*connectionState = \"\\([a-zA-Z]*\\)\".*/\\1/p' | head -1)\n[ -z \"$state\" ] && { echo \"UNKNOWN - keine Antwort von vim-cmd (hostd laeuft nicht?)\"; exit 3; }\n[ \"$state\" = \"connected\" ] && { echo \"verbunden (connected)\"; exit 0; }\necho \"Verbindungsstatus: $state\"; exit 2",
      "expected_output": "exit_code"
    },
    {
      "name": "ESXi — Datastore-Belegung",
      "script_id": "a3a55bb3-e4a6-54de-9f8b-6974ab6359db",
      "is_builtin": true,
      "description": "Belegung aller VMFS-Datastores (CSV-Parsing, space-sicher); Wert = vollster Datastore in %.",
      "interpreter": "bash",
      "script_body": "get_fs() { esxcli --formatter=csv storage filesystem list 2>/dev/null | grep -v \"^Error:\"; }\nout=$(get_fs)\n[ -z \"$out\" ] && { sleep 4; out=$(get_fs); }\n[ -z \"$out\" ] && { echo \"UNKNOWN - esxcli liefert keine Datastore-Liste\"; exit 3; }\nmsg=$(printf '%s\\n' \"$out\" | awk -F, 'NR>1 && $5 ~ /^VMFS/ && $4+0>0 {\n  name=$7; gsub(/\"/,\"\",name); pct=int((1-$1/$4)*100+0.5);\n  if (pct>m) m=pct;\n  s=s sprintf(\"%s %d%%, \", name, pct)\n} END { if (s==\"\") exit 1; sub(/, $/,\"\",s); printf \"%d%% max — %s\", m, s }')\n[ -z \"$msg\" ] && { echo \"UNKNOWN - keine VMFS-Datastores in esxcli-Ausgabe\"; exit 3; }\necho \"$msg\"",
      "expected_output": "exit_code"
    },
    {
      "name": "ESXi — Datastores nicht eingehängt",
      "script_id": "a4b32a08-b555-5107-876e-240d150edde1",
      "is_builtin": true,
      "description": "Zählt VMFS-Datastores, die nicht eingehängt (mounted=false) sind.",
      "interpreter": "bash",
      "script_body": "get_fs() { esxcli --formatter=csv storage filesystem list 2>/dev/null | grep -v \"^Error:\"; }\nout=$(get_fs)\n[ -z \"$out\" ] && { sleep 4; out=$(get_fs); }\n[ -z \"$out\" ] && { echo \"UNKNOWN - esxcli liefert keine Datastore-Liste\"; exit 3; }\nbad=$(printf '%s\\n' \"$out\" | awk -F, 'NR>1 && $5 ~ /^VMFS/ && $3!=\"true\" {name=$7; gsub(/\"/,\"\",name); s=s name \" \"} END {printf \"%s\", s}')\nok=$(printf '%s\\n' \"$out\" | awk -F, 'NR>1 && $5 ~ /^VMFS/ && $3==\"true\" {n++} END {print n+0}')\nif [ -n \"$bad\" ]; then\n  n=$(echo \"$bad\" | wc -w)\n  echo \"$n Datastore(s) nicht eingehängt: $bad\"; exit 2\nfi\necho \"0 nicht eingehängt — alle $ok VMFS-Datastores verfügbar\"",
      "expected_output": "exit_code"
    },
    {
      "name": "ESXi — VMs (an/gesamt)",
      "script_id": "ff0225af-3210-55b9-9778-41d3779cec50",
      "is_builtin": true,
      "description": "Anzahl eingeschalteter VMs / Gesamtzahl registrierter VMs.",
      "interpreter": "bash",
      "script_body": "vim-cmd vmsvc/getallvms >/dev/null 2>&1 || { echo \"UNKNOWN - vim-cmd vmsvc nicht verfuegbar\"; exit 3; }\ntotal=0; run=0\nfor id in $(vim-cmd vmsvc/getallvms 2>/dev/null | awk 'NR>1 && $1+0>0 {print $1}'); do\n  total=$((total+1))\n  vim-cmd vmsvc/power.getstate \"$id\" 2>/dev/null | grep -q \"Powered on\" && run=$((run+1))\ndone\necho \"$run von $total VMs eingeschaltet\"",
      "expected_output": "exit_code"
    },
    {
      "name": "ESXi — Hardware-Sensoren (IPMI)",
      "script_id": "6edddc58-0be2-50fc-8cc4-29af221d1bb8",
      "is_builtin": true,
      "description": "IPMI-Sensor-Alarme (Critical/Non-recoverable/Limit Exceeded = CRITICAL, Non-Critical/Warning = WARNING) mit Sensor-Namen.",
      "interpreter": "bash",
      "script_body": "out=$(esxcli hardware ipmi sdr list 2>/dev/null)\n[ -z \"$out\" ] && { sleep 4; out=$(esxcli hardware ipmi sdr list 2>/dev/null); }\n[ -z \"$out\" ] && { echo \"Keine IPMI-Sensordaten verfügbar (kein BMC?)\"; exit 0; }\ncrit=$(printf '%s\\n' \"$out\" | grep -E 'Transition to Critical|Transition to Non-recoverable|Limit Exceeded|Predictive Failure' | grep -v 'Limit not Exceeded')\nwarn=$(printf '%s\\n' \"$out\" | grep -E 'Transition to Non-Critical|Transition to Warning')\nnc=$(printf '%s' \"$crit\" | grep -c .)\nnw=$(printf '%s' \"$warn\" | grep -c .)\nif [ \"$nc\" -gt 0 ]; then\n  names=$(printf '%s\\n' \"$crit\" | awk -F'  +' 'NR<=3{printf \"%s; \", $2}')\n  echo \"$nc kritische(r) Sensor-Alarm(e): $names\"; exit 2\nfi\nif [ \"$nw\" -gt 0 ]; then\n  names=$(printf '%s\\n' \"$warn\" | awk -F'  +' 'NR<=3{printf \"%s; \", $2}')\n  echo \"$nw Sensor-Warnung(en): $names\"; exit 1\nfi\necho \"Alle IPMI-Sensoren unauffällig\"",
      "expected_output": "exit_code"
    },
    {
      "name": "ESXi — Uplinks ohne Link",
      "script_id": "84ea12fe-d219-50cf-b664-edd5b3b6a4c7",
      "is_builtin": true,
      "description": "Warnt nur, wenn ein tatsächlich als vSwitch-Uplink genutzter vmnic keinen Link hat; ungenutzte tote Ports sind nur Info.",
      "interpreter": "bash",
      "script_body": "nicraw=$(esxcli network nic list 2>/dev/null)\n[ -z \"$nicraw\" ] && { sleep 5; nicraw=$(esxcli network nic list 2>/dev/null); }\nnics=$(printf \"%s\\n\" \"$nicraw\" | grep -v \"Error:\" | tail -n +3)\n[ -z \"$nics\" ] && { echo \"UNKNOWN - esxcli liefert keine NIC-Liste (hostd beschaeftigt?)\"; exit 3; }\ndown=$(printf '%s\\n' \"$nics\" | awk '$5==\"Down\"{printf \" %s \", $1}')\nvsraw=$(esxcli network vswitch standard list 2>/dev/null)\ndvraw=$(esxcli network vswitch dvs vmware list 2>/dev/null)\nupl=$(printf \"%s\\n%s\\n\" \"$vsraw\" \"$dvraw\" | awk -F\": *\" \"/Uplinks:/{print \\$2}\")\nif [ -z \"$(echo $upl)\" ]; then\n  sleep 4\n  vsraw=$(esxcli network vswitch standard list 2>/dev/null)\n  dvraw=$(esxcli network vswitch dvs vmware list 2>/dev/null)\n  upl=$(printf \"%s\\n%s\\n\" \"$vsraw\" \"$dvraw\" | awk -F\": *\" \"/Uplinks:/{print \\$2}\")\nfi\nif [ -z \"$(echo $upl)\" ]; then\n  if [ -n \"$(echo $down)\" ]; then echo \"vSwitch-Konfiguration nicht lesbar — vmnic ohne Link:$down\"; else echo \"Alle vmnic haben Link\"; fi\n  exit 0\nfi\nbad=\"\"\nfor u in $upl; do\n  u=${u%,}\n  case \"$down\" in *\" $u \"*) bad=\"$bad$u \" ;; esac\ndone\nif [ -n \"$bad\" ]; then echo \"Uplink(s) ohne Link: $bad\"; exit 1; fi\nset -- $down\nndown=$#\nif [ \"$ndown\" -gt 0 ]; then echo \"Alle vSwitch-Uplinks haben Link ($ndown ungenutzte vmnic ohne Link)\"; else echo \"Alle vmnic haben Link\"; fi\nexit 0",
      "expected_output": "exit_code"
    }
  ],
  "schema_version": 1
}