All Projects → tronyx → HealthChecks-Linux

tronyx / HealthChecks-Linux

Licence: MIT License
Script to test various application reverse proxies, as well as their internal pages, and report to their respective Healthchecks.io checks

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to HealthChecks-Linux

lazyaircrack
Automated tool for WiFi hacking.
Stars: ✭ 301 (+1484.21%)
Mutual labels:  bash-script
kindle-dict
English-Vietnamese Dictionary for Kindle
Stars: ✭ 19 (+0%)
Mutual labels:  bash-script
autohosts
Automate hosts file updates on Linux and MacOS. Block Firefox telemetry, Google snooping and web trackers at the root.
Stars: ✭ 69 (+263.16%)
Mutual labels:  bash-script
OSCP-Prep
Contained is all my reference material for my OSCP preparation. Designed to be a one stop shop for code, guides, command syntax, and high level strategy. One simple clone and you have access to some of the most popular tools used for pentesting.
Stars: ✭ 33 (+73.68%)
Mutual labels:  bash-script
git-commands-workflows
🚀 All the git commands and workflows you need to know
Stars: ✭ 50 (+163.16%)
Mutual labels:  bash-script
defaults.sh
 User Defaults Plist → Shell Script converter with Regex filtering
Stars: ✭ 20 (+5.26%)
Mutual labels:  bash-script
github-to-wordpress-deploy-script
Bash script to handle tagging on GitHub and deployment to WordPress SVN
Stars: ✭ 21 (+10.53%)
Mutual labels:  bash-script
BashConfig
BASH configuration files.
Stars: ✭ 46 (+142.11%)
Mutual labels:  bash-script
coinbash
💰 A bash script (CLI) for displaying crypto currencies market data in a terminal 🖥
Stars: ✭ 110 (+478.95%)
Mutual labels:  bash-script
Automated-Login
This is a bash script for automated login to a portal built using 'lynx'. The main motive behind this script is, an automated form entry and submission for any portal without actually visting the website.
Stars: ✭ 13 (-31.58%)
Mutual labels:  bash-script
tuterm
A better way to learn CLI programs.
Stars: ✭ 22 (+15.79%)
Mutual labels:  bash-script
PXESetupWizard
PXE Setup Wizard. Netboot Debian, Ubuntu, System Rescue CD, FreeDOS and more.
Stars: ✭ 96 (+405.26%)
Mutual labels:  bash-script
pdf-scripts
📑 Scripts to repair, verify, OCR, compress, wrangle, crop (etc.) PDFs
Stars: ✭ 33 (+73.68%)
Mutual labels:  bash-script
l2cu
L²CU: LDraw Linux Command line Utility
Stars: ✭ 14 (-26.32%)
Mutual labels:  bash-script
changemac
change mac address of linux ,ubuntu
Stars: ✭ 17 (-10.53%)
Mutual labels:  bash-script
crontask
Use to call scripts or URLs from a crontab file, with optional logging and webhook upon success/failure
Stars: ✭ 19 (+0%)
Mutual labels:  healthchecks
healthchecksio
Update and display the status of your healthchecks.io checks.
Stars: ✭ 30 (+57.89%)
Mutual labels:  healthchecksio
bash-cat-with-cat
The classic cat command but with a cat
Stars: ✭ 154 (+710.53%)
Mutual labels:  bash-script
nautilus-right-click-new-file
Add a right click context menu in Nautilus to add new documents for Linux desktop.
Stars: ✭ 23 (+21.05%)
Mutual labels:  bash-script
SuperShaper-SOHO
Packet filtering / QoS setup for typical home/small office
Stars: ✭ 14 (-26.32%)
Mutual labels:  bash-script

HealthChecks Linux

CodeFactor made-with-bash GitHub Average time to resolve an issue Percentage of issues still open

Script to test various application reverse proxies, as well as their internal pages, and report to their respective Healthchecks.io checks. This is meant to work with Organizr Authentication, leveraging the Organizr API key to check the reverse proxies.

If you are not using Organizr, which you totally should be if you're not, you can remove the following from the external URL for any checks you want to use:

 -H "token: ${orgAPIKey}"

Mind the space that is at the beginning of the line too.

Setting it up

There are variables at the top that are used throughout the script to do the tests. You'll want to fill in your domain, Organizr API key, and server IP(s). If you are self-hosting Healthchecks, you can change the hcPingDomain variable. You'll also need to go to each of the check_application functions and edit the UUID for the Healthcheck and the ports and/or subdomains or subdirectories on those. Lastly, uncomment (remove the # from the beginning of the line) the checks that you wish to run in the main function at the bottom of the script.

Once you have all of the checks configured as you need, you can run the script with bash -x application_healthchecks_generic.sh to make sure that all the responses are returning what's expected, an HTTP response code of 200.

If you do not have reverse proxies (external access) setup for your applications, you can simply set the external response variable to 200 so that will always pass:

extResponse='200'

⚠️ NOTE: You may need to tweak some of the URLs that are being used to check the applications depending on your setup and you might be using a subfolder configuration where I'm using a subdomain or vice versa. Point is, this won't work 100% for everyone, so you might need to do some trial and error to get everything working.

Scheduling

Now that you have it configured so that everything is working properly, you can use a cronjob to schedule the script to run automatically and perform the checks.

Here's an example of running the script every two minutes:

## Run application healthchecks script for Healthchecks.io
*/2 * * * * /home/tronyx/scripts/application_healthchecks.sh

My HC.io checks are setup with a two minute period and a three minute grace. You can adjust all of that according to your needs.

Tronitor

This script partners up with my Tronitor script that allows you to pause and unpause your monitors manually or via a cronjob for scheduled maintenance, etc. If you wish to use this script with Tronitor you will need to uncomment the Tronitor temp directory line and then comment out or remove the original one.

Thanks

Big thanks to HalianElf for creating the Powershell version of the script for Windows users.

Questions

If you have any questions, you can find me on the Organizr Discord.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].