{
  "metadata": {
    "os": "Linux",
    "hostname": "example-rocky-host",
    "timestamp": "2026-05-08T02:30:00Z",
    "module": "all",
    "format": "json",
    "script": "linux-health-check.sh"
  },
  "modules": {
    "system": {
      "status": "ok",
      "commands": [
        {
          "name": "uname",
          "command": "uname -a",
          "exit_code": 0,
          "output": "Linux example-rocky-host 5.14.0-427.13.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC x86_64 GNU/Linux"
        },
        {
          "name": "os-release",
          "command": "cat /etc/os-release",
          "exit_code": 0,
          "output": "NAME=\"Rocky Linux\"\nVERSION=\"9.4 (Blue Onyx)\"\nID=\"rocky\"\nVERSION_ID=\"9.4\"\nPLATFORM_ID=\"platform:el9\""
        },
        {
          "name": "uptime",
          "command": "uptime",
          "exit_code": 0,
          "output": " 02:30:00 up 12 days,  3:11,  1 user,  load average: 0.08, 0.12, 0.09"
        },
        {
          "name": "memory",
          "command": "free -h",
          "exit_code": 0,
          "output": "               total        used        free      shared  buff/cache   available\nMem:            15Gi       3.1Gi       9.4Gi       120Mi       2.8Gi        11Gi\nSwap:          4.0Gi          0B       4.0Gi"
        }
      ],
      "warnings": [],
      "errors": []
    },
    "disk": {
      "status": "ok",
      "commands": [
        {
          "name": "disk",
          "command": "df -h",
          "exit_code": 0,
          "output": "Filesystem      Size  Used Avail Use% Mounted on\n/dev/vda1        80G   28G   52G   35% /"
        },
        {
          "name": "inodes",
          "command": "df -i",
          "exit_code": 0,
          "output": "Filesystem     Inodes  IUsed  IFree IUse% Mounted on\n/dev/vda1         5.0M   180K   4.8M    4% /"
        }
      ],
      "warnings": [],
      "errors": []
    },
    "network": {
      "status": "ok",
      "commands": [
        {
          "name": "listening_ports",
          "command": "ss -tulnp",
          "exit_code": 0,
          "output": "Netid State  Recv-Q Send-Q Local Address:Port Peer Address:Port\ntcp   LISTEN 0      128    0.0.0.0:22      0.0.0.0:*"
        },
        {
          "name": "routes",
          "command": "ip route",
          "exit_code": 0,
          "output": "default via 198.51.100.1 dev ens3 proto dhcp src 198.51.100.24\n198.51.100.0/24 dev ens3 proto kernel scope link src 198.51.100.24"
        }
      ],
      "warnings": [],
      "errors": []
    },
    "service": {
      "status": "ok",
      "commands": [
        {
          "name": "failed_services",
          "command": "systemctl --failed --no-pager",
          "exit_code": 0,
          "output": "  UNIT LOAD ACTIVE SUB DESCRIPTION\n0 loaded units listed."
        }
      ],
      "warnings": [],
      "errors": []
    },
    "process": {
      "status": "ok",
      "commands": [
        {
          "name": "top_cpu",
          "command": "ps aux --sort=-%cpu | head -n 10",
          "exit_code": 0,
          "output": "USER PID %CPU %MEM COMMAND\nroot 1 0.1 0.2 /usr/lib/systemd/systemd"
        },
        {
          "name": "top_memory",
          "command": "ps aux --sort=-%mem | head -n 10",
          "exit_code": 0,
          "output": "USER PID %CPU %MEM COMMAND\nroot 800 0.2 1.1 /usr/bin/example-agent"
        }
      ],
      "warnings": [],
      "errors": []
    },
    "package": {
      "status": "ok",
      "commands": [
        {
          "name": "package_managers",
          "command": "for c in apt apt-get dnf yum zypper pacman rpm dpkg; do ...",
          "exit_code": 0,
          "output": "== dnf ==\n4.14.0\n== yum ==\n4.14.0\n== rpm ==\nRPM version 4.16.1.3"
        },
        {
          "name": "dnf_repolist",
          "command": "dnf repolist",
          "exit_code": 0,
          "output": "repo id                     repo name\nbaseos                      Rocky Linux 9 - BaseOS\nappstream                   Rocky Linux 9 - AppStream"
        }
      ],
      "warnings": [],
      "errors": []
    },
    "security": {
      "status": "ok",
      "commands": [
        {
          "name": "sshd_config",
          "command": "grep -E '^(PermitRootLogin|PasswordAuthentication|PubkeyAuthentication|Port)\\b' /etc/ssh/sshd_config || true",
          "exit_code": 0,
          "output": "Port 22\nPermitRootLogin no\nPubkeyAuthentication yes"
        },
        {
          "name": "sudo_version",
          "command": "sudo -V",
          "exit_code": 0,
          "output": "Sudo version 1.9.5p2"
        },
        {
          "name": "firewall_state",
          "command": "firewall-cmd --state",
          "exit_code": 0,
          "output": "running"
        },
        {
          "name": "selinux",
          "command": "getenforce",
          "exit_code": 0,
          "output": "Enforcing"
        }
      ],
      "warnings": [],
      "errors": []
    },
    "container": {
      "status": "warning",
      "commands": [
        {
          "name": "containerd_version",
          "command": "ctr version",
          "exit_code": 0,
          "output": "Client:\n  Version:  1.7.20\nServer:\n  Version:  1.7.20"
        }
      ],
      "warnings": [
        {
          "name": "docker",
          "message": "Command not available: docker"
        },
        {
          "name": "kubectl",
          "message": "Command not available: kubectl"
        }
      ],
      "errors": []
    },
    "log": {
      "status": "ok",
      "commands": [
        {
          "name": "journal_errors",
          "command": "journalctl -p 3 -n 50 --no-pager",
          "exit_code": 0,
          "output": "-- No entries --"
        },
        {
          "name": "journal_disk_usage",
          "command": "journalctl --disk-usage",
          "exit_code": 0,
          "output": "Archived and active journals take up 96.0M in the file system."
        },
        {
          "name": "kernel_warnings",
          "command": "dmesg -T --level=err,warn",
          "exit_code": 0,
          "output": ""
        },
        {
          "name": "var_log_usage",
          "command": "du -sh /var/log 2>/dev/null || true",
          "exit_code": 0,
          "output": "180M\t/var/log"
        }
      ],
      "warnings": [],
      "errors": []
    }
  },
  "summary": {
    "status": "warning",
    "warnings_count": 2,
    "errors_count": 0
  },
  "errors": []
}
