# Disconnects with sql server

**URL:** <https://discourse.nodered.org/t/disconnects-with-sql-server/82373>\
**Category:** General\
**Tags:** mysql\
**Created:** [26 October 2023 16:45 UTC](https://discourse.nodered.org/t/disconnects-with-sql-server/82373 "2023-10-26T16:45:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebolisa](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ebolisa/32/89203_2.png) [@ebolisa](https://discourse.nodered.org/u/ebolisa)\
**Post date:** [26 October 2023 16:45 UTC](https://discourse.nodered.org/t/disconnects-with-sql-server/82373/1 "2023-10-26T16:45:41Z")

</div>

Hi,

My project runs several nodes, some connect to an external mqtt server and others to an internal (home network) sql server on a Diskstation unit.

When I go on extent vacations, I turn off my Diskstation server so, when that happens, I get (obviously) EHOSTUNREACH errors.

How can I prevent said error?

The most obvious answer would be to leave on the Diskstation ;)) but, I prefer not to do that.  
So, I'm thinking in terms of a condition to check if the sql server is responsive or not and if it is, than proceed with the nodes.

TIA

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [26 October 2023 16:55 UTC](https://discourse.nodered.org/t/disconnects-with-sql-server/82373/2 "2023-10-26T16:55:33Z")

</div>

You could use the ping node?

and store its response in global context, and use that in a `switch` node  
seems pretty perfect IMO 😄

setup an interval to keep the response status updated

> **[node-red-node-ping](https://flows.nodered.org/node/node-red-node-ping)**
>
> A Node-RED node to ping a remote server, for use as a keep-alive check.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 December 2023 16:55 UTC](https://discourse.nodered.org/t/disconnects-with-sql-server/82373/3 "2023-12-25T16:55:53Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
