NetDiag is a Bash-based monitoring toolkit for Linux systems. It provides quick diagnostics for:
- System information
- Battery details
- Network health and connectivity
- Open/listening network ports
The project entrypoint is monitor.sh, which calls module scripts in modules/.
.
├── monitor.sh
├── Readme.md
└── modules
├── system.sh
├── battery.sh
├── networking.sh
└── help.sh
- Kernel version
- Uptime
- Active users
- OS name
- CPU model, architecture, core count
- Memory usage
- Load average
- Number of batteries
- Model, manufacturer, serial number
- Capacity, health, status
- Temperature (converted to Celsius)
- Charge start/end thresholds
- Cycle count
- Interface link readiness
- IPv4 configuration check
- Default route check
- Internet connectivity check (
8.8.8.8) - DNS resolution check (
www.google.com) - Route interface details: IPv4, gateway, DNS, MAC, MTU
- Listening TCP/UDP ports (
ss)
- Displays CLI options, module coverage, and setup guidance.
- Linux OS
- Bash
- Common utilities used by modules:
ipsspinglscpufreeawk,grep,cut,sed,column
Note: Battery module expects battery data in
/sys/class/power_supply/BAT*. On desktops or systems without batteries, some values may be unavailable.
From project directory:
chmod +x monitor.sh modules/*.sh
./monitor.sh -s
./monitor.sh -b
./monitor.sh -n
./monitor.sh -hBy default, users run the script via project path. To avoid that, create a global symbolic link.
sudo chmod +x /home/naman/Devops/System-and-Network-Monitoring-/monitor.sh
sudo ln -sf /home/naman/Devops/System-and-Network-Monitoring-/monitor.sh /usr/local/bin/netdiagThen run from anywhere:
netdiag -s
netdiag -b
netdiag -n
netdiag -hsudo is required because /usr/local/bin is a system-owned path.
monitor.shsupports symlink-safe execution and resolves module paths reliably.- Current CLI supports one option at a time:
-s,-b,-n, or-h.