Files
portfolio/infra-run/scripts/bash/README.md
T
2026-05-05 21:50:20 +00:00

1.7 KiB

Linux Operations Bash Toolkit

Small, practical Bash scripts for Linux operations checks and incident triage. The scripts are sanitized examples inspired by production Linux operations work and avoid destructive actions or root-only assumptions.

Scripts

  • os-healthcheck/healthcheck.sh - general host health overview.
  • os-healthcheck/disk_check.sh - filesystem usage threshold check.
  • os-healthcheck/service_check.sh - critical service status check.
  • os-healthcheck/system_report.sh - writes a timestamped system report to /tmp.
  • os-healthcheck/network_troubleshoot.sh - local and optional remote network diagnostics.

Usage

cd infra-run/scripts/bash/os-healthcheck

./healthcheck.sh
./disk_check.sh
./disk_check.sh 90
./service_check.sh
./service_check.sh sshd nginx zabbix-agent
./system_report.sh
./network_troubleshoot.sh
./network_troubleshoot.sh google.com

Exit Codes

disk_check.sh:

  • 0 - all filesystems are below the threshold.
  • 1 - one or more filesystems are at or above the threshold.
  • 2 - invalid threshold input.

service_check.sh:

  • 0 - all checked services are active.
  • 1 - at least one service is inactive, failed, missing, or cannot be checked.

network_troubleshoot.sh:

  • 0 - no obvious local, DNS, or connectivity issue detected.
  • 1 - DNS, interface, gateway, or target connectivity problems detected.

healthcheck.sh and system_report.sh are informational. They print warnings for missing tools where possible.

Notes

  • Requires Bash.
  • Designed for RHEL, Oracle Linux, and Ubuntu style systems.
  • Handles missing tools such as ss, traceroute, nc, and journalctl gracefully.
  • Does not require root and does not make system changes.