# Use Node-Red and Telegram to Monitor Discourse Status

**URL:** <https://meta.discourse.org/t/use-node-red-and-telegram-to-monitor-discourse-status/157229>\
**Category:** Developers\
**Tags:** how-to\
**Created:** [July 9, 2020, 7:17am UTC](https://meta.discourse.org/t/use-node-red-and-telegram-to-monitor-discourse-status/157229 "2020-07-09T07:17:02Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![neounix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neounix/32/215617_2.png) [@neounix](https://meta.discourse.org/u/neounix)\
**Post date:** [July 9, 2020, 7:17am UTC](https://meta.discourse.org/t/use-node-red-and-telegram-to-monitor-discourse-status/157229/1 "2020-07-09T07:17:02Z")

</div>

> _Please note that this is a different application than sending Discourse application notifications using the Discourse Telegram Notifications plugin. This NR application is for monitoring the server, Docker and the Discourse application, in general._

Like most of you busy sys admins, when we are on the go we find it helpful to monitor production applications from our mobile phones.

We use Telegram and Node-Red (NR) for this task. For example, some of our current Discourse NR tasks:

1. Node-Red does a HTTPS GET request (every minute) on a category (created for this purpose) and sends an alert to our Telegram bot when it detects Discourse is DOWN (and back UP again, without flapping).

2. Our basic Telegram bot, `UNIXForumBot` has a number of checks we can do, including:

- Manually check to see if Discourse is running.
- Quickly show which Discourse container is being used by our reverse proxy.
- Check server uptime.
- Check disk utilization.
- Ping other LAMP applications on the same server.

> Example Telegram Screenshots:

 ![IMG_9631](https://global.discourse-cdn.com/meta/original/3X/3/b/3b0c191e3b5b32d85ef6003e733f00eda047ebb9.png) ![IMG_9630](https://global.discourse-cdn.com/meta/original/3X/5/4/545ae38d2bb3c25d7a2731d4fcab34c3d5239765.png) ![IMG_9629](https://global.discourse-cdn.com/meta/original/3X/b/4/b4d0e9211383d2001fa81d4bb95a405999145a28.png) ![IMG_9628](https://global.discourse-cdn.com/meta/original/3X/f/8/f8e6a52170c498eefc94e44959fab776676b37b0.png)

> **Our Setup and Background Information**
>
> > Background Information
> 
> The reason we check which Discourse container is running is because if there is an issue, or I simply want to upgrade or make changes, we always want to know quickly which container is running Discourse before logging into the server.
> 
> We always run Discourse behind a reverse proxy. Because we have many other web apps running on the same server (LAMP apps running with Discourse Docker apps) we run Discourse as follows:
> 
> - Separate Discourse data and applications containers.
> - Discourse application containers only expose a unix domain docket to the host (the reverse proxy).
> 
> This means, for those not familiar with this setup, that we can build Discourse when a new upgrade comes out and cut over to that new version of Discourse with zero downtime by specifying a different unix docket in the reverse proxy configuration.
> 
> If there was an issue with the latest beta, no problem we can quickly and easily revert back to the other container which was running an earlier Discourse version. Works flawlessly.

> Node-Red Diagram for the Telegram Bot We Use To Monitor Discourse

 ![Screen Shot 2020-07-09 at 1.22.34 PM](https://global.discourse-cdn.com/meta/original/3X/0/0/007763e6cafad95b0d62e6a819930f988ec17dc2.jpeg)

For anyone interested to monitor their Discourse applications using Telegram and NR, I have made the Node-Red nodes for this application available. You can customize as. you like:

> **[UnixForumBot Node-Red Diagram and Nodes](https://community.unix.com/t/unixforumbot-node-red-diagram-and-nodes/379154)**
>
> UnixForumBot Version 0.5 Diagram Node-Red Nodes \[ { "id": "5dddf6dd.c8bf48", "type": "tab", "label": "ForumBot", "disabled": false, "info": "" }, { "id": "286f517c.4abebe", "type": "telegram receiver", ...

In the future, we plan to expand the Docker and Discourse monitoring functions in the Telegram app.

See also:

> **[Checking Our Discourse Community Status with Telegram Bot via Node-Red](https://community.unix.com/t/checking-our-discourse-community-status-with-telegram-bot-via-node-red/379153)**
>
> Dear Everyone, I have updated our Telegram bot to check the status of this Discourse community. You can subscribe to this Telegram bot: UnixForumBot So far, I have added two Discourse related functions: /comm #checks the status of our...

Hope other sys admins who are interested in monitoring their production server and Discourse application find this short topic useful.

---

_[View the full topic](https://meta.discourse.org/t/use-node-red-and-telegram-to-monitor-discourse-status/157229)._
