Skip to content

bjoernramos/Host-Environment-Exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Host-Environment-Exporter

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.

Requirements

  • 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.

Run (cloned locally)

Interactive menu:

chmod +x main.sh
sudo ./main.sh

Non-interactive (simulate menu choice):

  • AI-Optimized Dump (option 2):
echo 2 | sudo ./main.sh
  • Full System Dump (option 1):
echo 1 | sudo ./main.sh

Why 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.


Run directly from GitHub without saving to disk

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.


Permissions and portability

  • 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.

Security

  • 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")

License

See LICENSE.

About

A lightweight Linux environment inspector that collects detailed system information for AI agents. It exports hardware specs, OS data, network details, firewall tables, Docker containers, running services, and Nginx configuration as a clean, machine-readable JSON snapshot for automation and debugging.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages