Healthchecks is a web service used for cron/scheduled job monitoring and notifications. It allows users to monitor their jobs for errors, track job runtime, and view historical data. Healthchecks can be installed on a local server to self-host it. In this tutorial, we will show you how to install Healthchecks on OpenSUSE Latest.
If you do not have PostgreSQL installed on your server, you can install it using the command:
sudo zypper install postgresql-server
Initialize the PostgreSQL server database:
sudo postgresql-setup --initdb
Then start the PostgreSQL server:
sudo systemctl start postgresql
Enable the PostgreSQL server to run on system boot:
sudo systemctl enable postgresql
Verify the installation by running:
sudo systemctl status postgresql
Create a new user account to run the Healthchecks application:
sudo useradd -m -s /bin/bash healthchecks
Switch to the healthchecks user account:
sudo su - healthchecks
Clone the Healthchecks repository:
git clone https://github.com/healthchecks/healthchecks.git
Change directory to the Healthchecks folder:
cd healthchecks
Create a new virtual environment to isolate the Healthchecks dependencies:
python3 -m venv env
Activate the virtual environment:
source env/bin/activate
Install the Healthchecks dependencies:
pip3 install --upgrade pip setuptools wheel
pip3 install -r requirements.txt
Migrate the Healthchecks database:
python3 manage.py migrate
Create a new superuser account:
python3 manage.py createsuperuser
Start the development server:
python3 manage.py runserver
Open your web browser and navigate to the server IP address or domain name followed by the port number:
http://server-ip-or-domain-name:8000
You should see the Healthchecks home page.
Create a new system user account to run the Healthchecks app:
sudo useradd -r healthchecks
Create a new directory to store the Healthchecks configuration files:
sudo mkdir /etc/healthchecks
Copy the example configuration file to the new directory:
sudo cp env.example /etc/healthchecks/.env
Edit the configuration file:
sudo nano /etc/healthchecks/.env
Update the following settings:
DB_NAME=healthchecks
DB_USER=your-postgres-username
DB_PASSWORD=your-postgres-password
Save and close the file.
Create a new systemd service file:
sudo nano /etc/systemd/system/healthchecks.service
Add the following lines to the file:
[Unit]
Description=Healthchecks.io service
[Service]
User=healthchecks
Group=healthchecks
EnvironmentFile=-/etc/healthchecks/.env
WorkingDirectory=/home/healthchecks/healthchecks
ExecStart=/home/healthchecks/healthchecks/env/bin/python3 manage.py runserver 127.0.0.1:8000
TimeoutSec=30
Restart=always
[Install]
WantedBy=multi-user.target
Save and close the file.
Reload the systemd daemon to apply the changes:
sudo systemctl daemon-reload
Start the Healthchecks service:
sudo systemctl start healthchecks
Enable the Healthchecks service to run on system boot:
sudo systemctl enable healthchecks
Verify the installation and the service status:
sudo systemctl status healthchecks
Now you can access the Healthchecks web interface by visiting http://localhost:8000 using your web browser.
You have successfully installed Healthchecks on your OpenSUSE Latest server. Now you can monitor your scheduled jobs and get notifications if anything goes wrong. You can customize the notifications and settings by referring to the Healthchecks documentation.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!