Add initial Linux operations Bash toolkit with network diagnostics

This commit is contained in:
Mateusz Suski
2026-05-05 21:26:02 +00:00
parent 0a242e82b7
commit 9fb291f834
6 changed files with 437 additions and 0 deletions
+51
View File
@@ -0,0 +1,51 @@
# 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
- `healthcheck.sh` - general host health overview.
- `disk_check.sh` - filesystem usage threshold check.
- `service_check.sh` - critical service status check.
- `system_report.sh` - writes a timestamped system report to `/tmp`.
- `network_troubleshoot.sh` - local and optional remote network diagnostics.
## Usage
```bash
./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.