A single, interactive host-environment exporter script (file: main.sh) that produces system information.
It supports two output modes:
- Full System Dump (very detailed, includes many commands and full firewall rules)
- AI-Optimized Dump (compact summary for quick diagnostics)
Note: The file is named main.sh and is executable via its shebang. For best results, run it with sudo.
- Linux target recommended. Non-Linux systems will return partial data only.
- No installation required. The script is self-contained and read-only in its operations.
Interactive menu:
chmod +x main.sh
sudo ./main.shNon-interactive (simulate menu choice):
- AI-Optimized Dump (option 2):
echo 2 | sudo ./main.sh- Full System Dump (option 1):
echo 1 | sudo ./main.shWhy sudo? The exporter collects information from networking, firewall, services, and container tooling. Running without sudo may result in incomplete/empty fields. Running with sudo provides the most complete data set.
Execute the script from your GitHub repository without leaving it on disk. Replace the URL with your repository's RAW URL.
Example RAW URL (adjust):
https://raw.githubusercontent.com/bjoernramos/Host-Environment-Exportermain/main.sh
One-liner using a temporary file (auto-removed):
TMP="$(mktemp)" && \
curl -fsSL https://raw.githubusercontent.com/bjoernramos/Host-Environment-Exporter/main/main.sh -o "$TMP" && \
chmod +x "$TMP" && \
sudo "$TMP" # add: echo 1| or echo 2| to choose mode non-interactively
rm -f "$TMP"Non-interactive examples:
- AI-Optimized Dump (option 2):
TMP="$(mktemp)" && curl -fsSL https://raw.githubusercontent.com/bjoernramos/Host-Environment-Exporter/main/main.sh -o "$TMP" && chmod +x "$TMP" && echo 2 | sudo "$TMP"; rm -f "$TMP"- Full System Dump (option 1):
TMP="$(mktemp)" && curl -fsSL https://raw.githubusercontent.com/bjoernramos/Host-Environment-Exporter/main/main.sh -o "$TMP" && chmod +x "$TMP" && echo 1 | sudo "$TMP"; rm -f "$TMP"These methods ensure the script is not persisted after execution.
- The script invokes many read-only system commands (e.g.,
ss,ip,lsblk,systemctl,docker,nft/ufw/iptables,nginx). - Missing tools or insufficient privileges will result in empty strings/lists/objects. Running with sudo is strongly recommended for complete output.
- On macOS/Windows, some fields are naturally empty.
- The examples above download and execute code from the internet. Only use trusted sources and pin to fixed commits/tags.
- Recommended: reference a specific commit hash instead of
main:
COMMIT="<commit-hash>"
sudo python3 <(curl -fsSL "https://raw.githubusercontent.com/bjoernramos/Host-Environment-Exporter/${COMMIT}/main.sh")See LICENSE.