System Online State

Ensuring System Availability: How to use LogHive Insights to check your SaaS system online state

As a SaaS provider, it’s important to ensure that your system is always online and available to your users. One way to do this is by periodically sending a “keep alive” signal to your server to check its online status. With LogHive Insights, you can easily set up this check and view the state of your system on the LogHive dashboard.

Set up the keep alive signal

First, you’ll need to set up a keep alive signal that sends a request to your server at regular intervals. This signal can be as simple as a small HTTP request that pings the server and checks if it’s up and running.

Here’s an example of how you could implement this in Python:

Simply send an Insight with the value 0 or 1 to LogHive.

import requests
import json

url = "https://api.loghive.app/v1/insight/add"
headers = {'Content-Type': 'application/json', 'ApiKey': 'YourPersonalApiKey'}

# set online
data = { "project": "yourprojectname","insight": "system1","value": 1 }
response = requests.post(url, headers=headers, data=json.dumps(data))

# set offline
data = { "project": "yourprojectname","insight": "system1","value": 0 }
response = requests.post(url, headers=headers, data=json.dumps(data))

print(response.status_code)
if response.status_code != 200:
    print(response.json())

Check out code examples in other programming languages.: https://docs.loghive.app/code-examples/python

Set up the LogHive Insights dashboard

Once you have the keep alive signal set up, you’ll need to create a dashboard in LogHive Insights to view the state of your system. To do this, log in to the LogHive web application.

Next, you’ll need to add a widget to the dashboard that displays the online state of your system.

LogHive has its own element type for this purpose where you can directly parameterize the Keep Alive signal

Now that you have the keep alive signal and dashboard set up, you can monitor the state of your system . If the server fails to respond to the keep alive signal, you’ll be notified in the LogHive dashboard, allowing you to quickly address any issues that may arise.

System Online State per Insight Event

In conclusion, monitoring the online state of your SaaS system is an important task that can be easily accomplished using LogHive Insights. By setting up a keep alive signal and monitoring it on the LogHive dashboard, you can ensure that your system is always online and available to your users.

Latest Posts