# Node-RED Health Monitoring

**URL:** <https://discourse.nodered.org/t/node-red-health-monitoring/11413>\
**Category:** General\
**Created:** [22 May 2019 10:58 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413 "2019-05-22T10:58:35Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![debinaik](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/debinaik/32/11714_2.png) [@debinaik](https://discourse.nodered.org/u/debinaik)\
**Post date:** [22 May 2019 10:58 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413/1 "2019-05-22T10:58:35Z")

</div>

Hi,  
I would like to monitor health of Node-red on 24\*7 basis using a script. Is there any flag/tags/api available in Node-red , which I can access or consume in program and keep on polling Node-red's health.

Thanks

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [22 May 2019 16:32 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413/2 "2019-05-22T16:32:15Z")

</div>

If node-red is down you cannot use node-red to check its health.

You can use `netstat -an | grep -c 1880`.  
`if > 0`, node-red is up.

---

<div class="post-metadata">

**Author:** ![Robbo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/robbo/32/4491_2.png) [@Robbo](https://discourse.nodered.org/u/Robbo)\
**Post date:** [22 May 2019 17:08 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413/3 "2019-05-22T17:08:50Z")

</div>

Another method would be to use a heart beat method, use a flow to create either a file, MQTT message, etc. on a regular base, if the file date is older than your heat beat interval then you know something amiss.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [22 May 2019 18:11 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413/4 "2019-05-22T18:11:34Z")

</div>

Search this forum for the word watchdog. There has been lots of discussion on heath of node-red/pi. Might give you some ideas or save you some time.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 May 2019 20:18 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413/5 "2019-05-22T20:18:12Z")

</div>

> [@Robbo](#):
>
> Another method would be to use a heart beat method, use a flow to create either a file, MQTT message, etc. on a regular base, if the file date is older than your heat beat interval then you know something amiss.

This is what I do. Much simpler and more robust than the watchdog method.

As I have 2 Pi's, both run Node-RED, MQTT, Grafana and InfluxDB. Both Node-RED's post MQTT heartbeats to both MQTT brokers, the MQTT LWT is used so that if Node-RED stops working, the broker changes the message to "Offline". Node-RED posts an "Online" value every minute.

---

<div class="post-metadata">

**Author:** ![debinaik](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/debinaik/32/11714_2.png) [@debinaik](https://discourse.nodered.org/u/debinaik)\
**Post date:** [23 May 2019 11:09 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413/6 "2019-05-23T11:09:46Z")

</div>

Thanks all for your valuable response. If I drill down to health of specific flow in node-red,then what would be the best option ?

Solution: Thought up to hit node-red rest admin api i.e [http://node-red-ip:1880/flow/flow-id](http://node-red-ip:1880/flow/flow-id), if it returns 200 ok response, then flow is healthy, else flow stopped working.

please validate above solution or propose best solution. 🙂

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [23 May 2019 11:16 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413/7 "2019-05-23T11:16:36Z")

</div>

Maybe use the `status` node...

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 May 2019 18:44 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413/8 "2019-05-23T18:44:54Z")

</div>

The flow I mentioned does the trick and results in a report even when NR dies or indeed if the Pi dies (since I have the 2nd Pi also reporting). It also requires nothing more than Node-RED and MQTT - and a 2nd Pi of course, that could easily be a Pi Zero though.

Hitting up the url would need to be done from yet another piece of software - which could be a 2nd Node-RED.

---

<div class="post-metadata">

**Author:** ![HaroldPetersInskipp](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/haroldpetersinskipp/32/42319_2.png) [@HaroldPetersInskipp](https://discourse.nodered.org/u/HaroldPetersInskipp)\
**Post date:** [12 September 2024 20:31 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413/9 "2024-09-12T20:31:09Z")

</div>

Sorry for reviving this years old topic, but do you still have a version of this flow/s you could share? I was about to create the same thing but figured I may as well search for existing solutions here first.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 September 2024 01:06 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413/10 "2024-09-13T01:06:21Z")

</div>

'Fraid not Harold. My Pi's are long retired as I switched to a single old laptop instead.

Shouldn't be too hard to do though.

---

<div class="post-metadata">

**Author:** ![M-a-r-t-i-n](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/m-a-r-t-i-n/32/52391_2.png) [@M-a-r-t-i-n](https://discourse.nodered.org/u/M-a-r-t-i-n)\
**Post date:** [13 September 2024 02:11 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413/11 "2024-09-13T02:11:19Z")

</div>

Just to throw another idea in, I use the free version of this website [https://healthchecks.io](https://healthchecks.io)

I use this to check that a PI at 3 different locations is still alive.

Every 10 minutes one of my flows sends a http request to their site. If these requests are not seen for a time period (configurable) then the alarm is raised. I use email and telegram to do this, but many other methods are available.

No connection to the site, but I have used it for about 4 years now, and it’s proved very reliable.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [13 September 2024 08:30 UTC](https://discourse.nodered.org/t/node-red-health-monitoring/11413/12 "2024-09-13T08:30:18Z")

</div>

Honestly, I use Telegraf to monitor my home server. It logs to InfluxDB but is set up to also output to MQTT. I can set up alarms in both Node-RED (looking at MQTT) AND in Grafana (looking at the InfluxDB data).

I generally don't bother with Grafana alarms though. Because my live Node-RED instance is generally very reliable, I use it to keep an eye on things. Important failures are forwarded to Telegram so I see it on my phone. I also have a visual dashboard (using UIBUILDER of course 🙂 )

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/06005ad0f2c3cd371f85b20ae575aeb84bde4d73.png)

Hovering over the coloured status bar tells me when it was last updated. The main card is clickable if the device/service has its own web interface so I can go straight to it.
