{"id":15042391,"url":"https://github.com/cyclenerd/static_status","last_synced_at":"2025-04-04T11:12:15.586Z","repository":{"id":39861919,"uuid":"77903589","full_name":"Cyclenerd/static_status","owner":"Cyclenerd","description":"🚦Bash script to generate a static status page.","archived":false,"fork":false,"pushed_at":"2024-03-15T07:00:13.000Z","size":465,"stargazers_count":510,"open_issues_count":8,"forks_count":66,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-04-08T13:32:27.277Z","etag":null,"topics":["bash","bash-hacks","bash-script","github-actions","incidents","monitoring","monitoring-tool","outage","simple","status","statuspage","ubuntu"],"latest_commit_sha":null,"homepage":"https://cyclenerd.github.io/static_status/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cyclenerd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"Cyclenerd"}},"created_at":"2017-01-03T09:42:19.000Z","updated_at":"2024-04-15T07:42:21.638Z","dependencies_parsed_at":"2023-02-09T21:30:57.459Z","dependency_job_id":"c0a1ba3d-8b5c-4d79-94f1-8031866c2fcd","html_url":"https://github.com/Cyclenerd/static_status","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyclenerd%2Fstatic_status","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyclenerd%2Fstatic_status/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyclenerd%2Fstatic_status/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cyclenerd%2Fstatic_status/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cyclenerd","download_url":"https://codeload.github.com/Cyclenerd/static_status/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166168,"owners_count":20894654,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","bash-hacks","bash-script","github-actions","incidents","monitoring","monitoring-tool","outage","simple","status","statuspage","ubuntu"],"created_at":"2024-09-24T20:47:13.426Z","updated_at":"2025-04-04T11:12:15.555Z","avatar_url":"https://github.com/Cyclenerd.png","language":"Shell","readme":"#  status.sh 🚀\n\n[![Badge: GNU Bash](https://img.shields.io/badge/GNU%20Bash-4EAA25.svg?logo=gnubash\u0026logoColor=white)](#readme)\n[![Badge: ShellCheck](https://github.com/Cyclenerd/static_status/actions/workflows/shellcheck.yml/badge.svg?branch=master)](https://github.com/Cyclenerd/static_status/actions/workflows/shellcheck.yml)\n[![Badge: Ubuntu 22.04 LTS](https://github.com/Cyclenerd/static_status/actions/workflows/ubuntu_2204.yml/badge.svg?branch=master)](https://github.com/Cyclenerd/static_status/actions/workflows/ubuntu_2204.yml)\n[![Badge: Ubuntu 24.04 LTS](https://github.com/Cyclenerd/static_status/actions/workflows/ubuntu_2404.yml/badge.svg?branch=master)](https://github.com/Cyclenerd/static_status/actions/workflows/ubuntu_2404.yml)\n[![Badge: GitHub](https://img.shields.io/github/license/cyclenerd/static_status)](https://github.com/Cyclenerd/static_status/blob/master/LICENSE)\n\n##  Description 📝\n\nSimple Bash script to generate a static status page. Displays the status of websites, services (HTTP, SAP, MySQL...), and ping. Everything is easy to customize. 🤓\n\nYou can also easily check more complicated things with this script.\nFor example, if a text is present on a web page or if a host appears in the route path (traceroute).\nChecking the route path is useful, for instance, if you have a backup mobile internet connection in addition to your cable connection.\n\n![Screenshot](images/Status-Page-Screenshot.jpg)\n\nIn addition to the status web page, there is also a JSON version and an SVG icon.\nWith the script `alert.sh`, you can be alerted by email, SMS or Pushover in case of a downtime.\n\n##  Installation 📦\n\nBy default, it's a good practice to create a `status` directory within your home directory and place everything in it :\n```shell\nmkdir ~/status\ncd ~/status\n```\n\n### 1️⃣ Download Script\n\nDownload Bash script `status.sh`:\n```shell\ncurl -O \"https://raw.githubusercontent.com/Cyclenerd/static_status/master/status.sh\"\n```\n\n\u003e 💡 Tip: Update works exactly the same way as the installation. Simply download the latest version of `status.sh`.\n\n### 2️⃣ Download Configuration\n\nDownload configuration file `status_hostname_list.txt`:\n```shell\ncurl -O \"https://raw.githubusercontent.com/Cyclenerd/static_status/master/status_hostname_list.txt\"\n```\n\n### 3️⃣ Customize\n\nCustomize the `status_hostname_list.txt` configuration file and define what you want to monitor:\n```shell\nvi status_hostname_list.txt\n```\n\n### Optional\n\nEdit the script `status.sh`, or better add more configuration to the configuration file `config`.\n\nDownload the example configuration file:\n```shell\ncurl \\\n  -f \"https://raw.githubusercontent.com/Cyclenerd/static_status/master/config-example\" \\\n  -o \"config\"\n```\n\nCustomize the configuration file:\n```shell\nvi config\n```\n\n### Run\n\n```shell\nbash status.sh\n```\n\n## Usage 📋\n\n```text\nUsage: status.sh [OPTION]:\n\tOPTION is one of the following:\n\t\t silent  no output from faulty connections to stout (default: no)\n\t\t loud    output from successful and faulty connections to stout (default: no)\n\t\t debug   displays all variables\n\t\t help    displays help (this message)\n```\n\nExample:\n\n```shell\nbash status.sh loud\n```\n\nExecute a cron job every minute:\n\n```shell\ncrontab -e\n```\n\nAdd:\n\n```text\n*/1 * * * * bash \"/path/to/status.sh\" silent \u003e\u003e /dev/null\n```\n\n## Requirements ⚙️\n\nOnly\n`bash`,\n`coreutils`\n`curl`,\n`grep`,\n`nc`,\n`ping`,\n`sed` and `traceroute`.\nIn many *NIX distributions (Ubuntu, macOS) the commands are already included.\nIf not, the missing packages can be installed quickly.\n\nOn a debian-based system (Ubuntu), just run:\n\n```shell\nsudo apt install \\\n  coreutils \\\n  curl \\\n  grep \\\n  iputils-ping \\\n  netcat-openbsd \\\n  sed \\\n  traceroute\n```\n\n\u003e 💡 Tip: You can disable the `traceroute` dependency. Add `MY_TRACEROUTE_HOST=''` to your config.\n\n\n## Demo 🌐\n\nThis [demo page](https://cyclenerd.github.io/static_status/) is generated with [GitHub Action](https://github.com/Cyclenerd/static_status/blob/master/.github/workflows/demo_page.yml):\n\u003chttps://cyclenerd.github.io/static_status/\u003e\n\n### Screenshots 📷\n\n![Screenshot](images/Status-Page-Maintenance.jpg)\n![Screenshot](images/Status-Page-OK.jpg)\n![Screenshot](images/Status-Page-Outage.jpg)\n![Screenshot](images/Status-Page-Major_Outage.jpg)\n![Screenshot](images/Status-Page-Past-Incidents.jpg)\n\n## Custom Text 📄\n\nYou can display a custom text instead of the HOSTNAME/IP/URL (see example below).\n\n![Screenshot](images/Status-Page-Custom-Text.png)\n\nstatus_hostname_list.txt:\n\n```text\nping;8.8.8.8|Google DNS\nnc;8.8.8.8|DNS @ Google;53\ncurl;http://www.heise.de/ping|www.heise.de\ntraceroute;192.168.211.1|DSL Internet;3\nscript;/bin/true|always up\n```\n\n## JSON 📊\n\nYou can also create a JSON status page.\nConfigure the variable `MY_STATUS_JSON` with the location where the JSON file should be stored.\n\nExample JSON:\n```json\n[\n  {\n    \"site\": \"https://www.nkn-it.de/gibtesnicht\",\n    \"command\": \"curl\",\n    \"status\": \"Fail\",\n    \"time_sec\": \"282\",\n    \"updated\": \"2023-04-19 14:01:23 UTC\"\n  },\n  {\n    \"site\": \"https://www.heise.de/ping\",\n    \"command\": \"curl\",\n    \"status\": \"OK\",\n    \"time_sec\": \"0\",\n    \"updated\": \"2023-04-19 14:01:23 UTC\"\n  }\n]\n```\n\n## SVG Icon 🖼️\n\nIf you want to signal directly if everything is fine or if something is wrong in the infrastructure, you can insert the SVG icon into your website.\n\nPlease remember to include the image with a cache breaker URL (eg. an appended timestamp:\n```html\n\u003ca href=\"status.html\"\u003eStatus \u003cimg src=\"status.svg?{{ timestamp }}\"\u003e\u003c/a\u003e\n```\n\nStatic websites need to fallback to render the icon with javascript, eg with:\n```html\ndocument.write('\u003cimg src=\"status.svg?' + Date.now() + '\"\u003e')\n```\n\n## Custom Script Checks 🛠️ \n\nYou can extend the checks of `status.sh` with your own custom shell scripts.\n\nIf the shell script outputs a return code `0` it is evaluated as available.\nWith the special return code `80`, it is not classified as down but as degraded.\nWith all other return codes, it is a failure (outage, down).\n\nAdd your script to the `status_hostname_list.txt` configuration file. Example:\n\n```text\nscript;script.sh\nscript;/path/to/your/script.sh|Custom Text\nscript;/path/to/your/script.sh parameterA parameterB|Custom Text\n```\n\nThe script [`check-websites.sh`](./scripts/check-websites.sh) is an example.\n\n## TODO ✅\n\n1. **Bug Fixes and Enhancements**: Address any reported issues and consider adding new features to improve the script's functionality.\n\n2. **Comprehensive Documentation**: Create detailed documentation covering script configuration, customization, and advanced usage.\n\n3. **Code Cleanup**: Enhance code readability and performance for better maintainability.\n\n4. **Security**: Review and enhance security measures to protect against vulnerabilities.\n\n\n## License 📜\n\nGNU Public License version 3.\nPlease feel free to fork and modify this on GitHub (\u003chttps://github.com/Cyclenerd/static_status\u003e).\n","funding_links":["https://github.com/sponsors/Cyclenerd"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyclenerd%2Fstatic_status","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyclenerd%2Fstatic_status","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyclenerd%2Fstatic_status/lists"}