Simple Bash script to generate a static status page. Displays status of websites, services (HTTP, SAP, MySQL...) and ping. Everything easy to customize.
You can also easily check more complicated things with this script. For example if a text is present in a web page or if a host appears in the route path (traceroute). Checking the route path is useful, for instance, if you have a backup mobile internet connection in addition to your cable connection.
status.sh and configuration file:
$ curl -f https://raw.githubusercontent.com/Cyclenerd/static_status/master/status.sh -o status.sh $ curl -f https://raw.githubusercontent.com/Cyclenerd/static_status/master/status_hostname_list.txt -o status_hostname_list.txt
status.sh script and the services to be monitored:
$ vi status.sh $ vi status_hostname_list.txt
$ bash status.sh
Usage: status.sh [OPTION]: OPTION is one of the following: silent no output from faulty connections to stout (default: no) loud output from successful and faulty connections to stout (default: no) help displays help (this message)
$ bash status.sh loud
Execute a cron job every minute:
$ crontab -e
*/1 * * * * bash /path/to/status.sh silent >> /dev/null
nc. In many *NIX distributions (Ubuntu, macOS) the commands are already included. If not, the missing packages can be installed quickly. On a debian-based system (Ubuntu), just run
sudo apt-get install curl iputils-ping traceroute netcat-openbsd.
- More and better documentation
Help is welcome
GNU Public License version 3. Please feel free to fork and modify this on GitHub (https://github.com/Cyclenerd/static_shell).