# Welcome

This is official Docs website for Pinglik Uptimer. Pinglik Uptimer is a simple website monitoring app. Monitor your sites through Pinglik Uptimer to keep them online!

## Important informations

{% hint style="success" %}
**Website:** [**https://uptimer.pinglik.eu**](https://uptimer.pinglik.eu)

Support server: <https://pinglik.eu/support>
{% endhint %}

🙏*If you want to help us, please **share this tool with your friends** to help to us grow or you can support us by donating.*

[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/W7W3315UN)&#x20;


# Creating webserver

Here you can find example codes of webservers to make your projects without webserver (like Discord bots) pingable by Pinglik Uptimer.

> If you want to host your bot on replit or similiar service you need to create webserver for your project to make your project pingable. It means that you need to have there very simple website which will be pinged by Pinglik Uptimer so your project will stay online for 24/7. Here you can find example codes of webservers.

## *`NodeJS Express webserver`*

```javascript
// express Pinglik webserver example code
const express = require("express");
const app = express();
const port = process.env.PORT || 3000;

app.get("/", (req, res) => {
  res.send(
    "<code>Hello, this project is using <a href='https://uptimer.pinglik.eu' target='_blank'>Pinglik Uptimer</a>!<br>Our website: <a href='https://pinglik.eu' target='_blank'>pinglik.eu</a></code>"
  );
});

app.listen(port, () => {
  console.log(`📡 Pinglik webserver has started!`);
});
```

## *`Python Flask webserver`*

```python
# flask Pinglik webserver example code

from flask import Flask
from threading import Thread

app = Flask(__name__)

@app.route('/')
def main():
    return "<code>Hello, this project is using <a href='https://uptimer.pinglik.eu' target='_blank'>Pinglik Uptimer</a>!<br>Our website: <a href='https://pinglik.eu' target='_blank'>pinglik.eu</a></code>"

def run():
    app.run(host="0.0.0.0", port=3000)

def keep_alive():
    server = Thread(target=run)
    server.start()
    print("📡 Pinglik webserver has started!")

keep_alive()
```


# Discord notifications

Notifications when your monitor is online, offline or down will be sent to Discord webhook.

#### How to enable it

Just go to our dashboard, click on edit monitor button, and then click on enable Discord notifications button and you will be redirect to Discord oauth to choose server and channel where you want to receive your notifications.

![Button](/files/-Mf22hrP7ChPkYAWMiRX)

#### Notes

If request to Discord webhook URL has failed, our system may automatically disable notifications for you and you will need to enable it again on dashboard.

If you disable Discord notifications, webhook will be automatically deleted from Discord channel.


# Instatus integration

Thanks to this you can automatically create and resolve incidents on your Instatus statuspage.

#### How to enable it

Go to our dashboard, click on edit monitor button, and then click on enable Instatus integration button and enter Instatus webhook URL for your component.

![Button](/files/-Mf23HkFB_B_-WDnvEac)

#### How to get your instatus webhook URL?

1. Go to Instatus dashboard, click on your status page, under Monitoring, select Custom service (webhook)
2. Copy your component's webhook URL
3. Enable it on Pinglik Uptimer by clicking on button and entering this webhook URL

![Instatus webhook](/files/-Mf23qcQYhwjqTBLil2e)

#### Notes

Once you have enabled this notification provider, don't regenerate webhook url on instatus dashboard or if you regenerate it, you need to Disable Instatus integration and enable it again with new webhook URL.

If you have deleted or renamed compoment on Instatus, you should disable Instatus integration or change webhook URL to prevent our system from making useless requests.

If request to your Instatus webhook URL has failed, our system may automatically disable notifications for you and you will need to enable it again on dashboard.


# Custom Webhook notifications

You can set your own webhook URL where you will receive POST request when your monitor status has been updated.

#### How to enable it

Go to our dashboard, click on edit monitor button, and then click on enable Webhook notifications button and enter your webhook URL. Your webhook URL must return 200 status code.

![Button](/files/-Mf78-8bfbE7wdnIkVas)

#### How to make your own webhook

You can use pipedream to make your webhook and to receive notifications on any service\
You can find Discord embed notifications example pipedream webhook which you can copy and modify [here](https://pipedream.com/@pinglik/pinglik-uptimer-webhook-example-p_xMCGmO6/edit?tab=workflows).

#### POST request format

We are sending POST request with the following body content in JSON (header `Content-Type: application/json`):

```javascript
{
"monitor_name":"example monitor", // monitor name
"monitor_link":"https://example-monitor.pinglik.eu/", // monitor link
"monitor_owner_id":"Discord ID of owner", // your Discord ID
"monitor_owner_tag":"Discord tag of owner", // your Discord tag
"type":"online", // notification type - online, offline or down (when request has failed)
"status_code":200, // response status code
"status_text":"OK", // response status text
"timestamp": "YYYY-MM-DDTHH:mm:ss.sssZ" // actual timestamp in ISO 8601 format
"emoji":"🟢", // Emoji, it depends on the type - 🟢 (online), 🟠 (offline), 🔴 (offline)
"message":"🟢 Your monitor **example monitor** (https://example-monitor.pinglik.eu/) is **online**.\n> Status: **200** (**OK**)", // example message, you can use this when making custom notifications or you can make your own message using other values
"error":"Error message" // only when type is down (request has failed) - here will be fetch error message why it has failed
}
```

#### Notes

If your webhook does not work, you should disable webhook notifications to prevent our system from making useless requests.

If you are using your own webhook using webserver like express, make sure that the route name is some secure random generated string, or someone else can guess the webhook URL and send you fake notifications.

If request to your custom webhook URL has failed, our system may automatically disable notifications for you and you will need to enable it again on dashboard.


# Email notifications

Notifications when your monitor is online, offline or down will be sent to your custom email address

#### How to enable it

Just go to our dashboard, click on edit monitor button, and then click on enable Email notifications button and enter your custom email address where you want to receive notifications.

![Button](/files/-Mg5GiRptP4KVySNZUhF)

#### Notes

If sending email has failed, our system may automatically disable notifications for you and you will need to enable it again on dashboard.

Make sure to provide valid email address that is working.

If emails from us are in spam folder, mark it as *This is not spam* to avoid receiving new notifications in spam folder again.

If you don't receive the notifications, you can open new modmail support thread on our support server so we can help you.


