Checking to see if domoticz is still working on Synology NAS
Moderators: leecollings, remb0
-
- Posts: 13
- Joined: Sunday 16 August 2015 20:05
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Checking to see if domoticz is still working on Synology NAS
Hi,
I found this easy solution to monitor if Domoticz is still working, if its not, it will start Domoticz
https://www.domoticz.com/wiki/Monitorin ... ive_script
This probably works on a RPI, but the folders on a Synology are different, also there is no synology.sh file (or I cant find it)
How can I implement this script on a Synology NAS?
kind regards
Ido
I found this easy solution to monitor if Domoticz is still working, if its not, it will start Domoticz
https://www.domoticz.com/wiki/Monitorin ... ive_script
This probably works on a RPI, but the folders on a Synology are different, also there is no synology.sh file (or I cant find it)
How can I implement this script on a Synology NAS?
kind regards
Ido
-
- Posts: 37
- Joined: Friday 30 August 2013 20:24
- Target OS: NAS (Synology & others)
- Domoticz version: DS213+
- Contact:
Re: Checking to see if domoticz is still working on Synology
You can install Monit on Synology. Just add SynoCommunity as package source and install Monit for Synology.
- Stefan
- mvveelen
- Posts: 687
- Joined: Friday 31 October 2014 10:22
- Target OS: NAS (Synology & others)
- Domoticz version: Beta
- Location: Hoorn, The Netherlands
- Contact:
Re: Checking to see if domoticz is still working on Synology
I had this script running:
check_online.sh
and ran it with a cron job every 5 or 10 minutes.
But now I switched to Monit and like that a lot more.
check_online.sh
Code: Select all
#!/bin/sh
# check domoticz
status=`curl -s -o /dev/null -I -w "%{http_code}" http://192.168.0.124:8084/json.htm?type=command¶m=getversion`
if [ $status -eq 200 ]
then
echo "Domoticz is al gestart"
else
synopkg restart domoticz
/bin/sh /volume1/@appstore/domoticz/var/scripts/prowl.sh "Domoticz" 0 "Status" "Domoticz was gestopt."
fi
But now I switched to Monit and like that a lot more.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
-
- Posts: 13
- Joined: Sunday 16 August 2015 20:05
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Checking to see if domoticz is still working on Synology
Thank you for the replies.
Script looks simple, but you prefer monit anyway, good to know.
Can you perhaps share your config file with monitor configurations, the domoticz monit example is also RPI based and not synology based
Script looks simple, but you prefer monit anyway, good to know.
Can you perhaps share your config file with monitor configurations, the domoticz monit example is also RPI based and not synology based
- Ferpando
- Posts: 30
- Joined: Friday 23 October 2015 9:45
- Target OS: NAS (Synology & others)
- Domoticz version:
- Location: Spain
- Contact:
Re: Checking to see if domoticz is still working on Synology
Hi,steef84 wrote:You can install Monit on Synology. Just add SynoCommunity as package source and install Monit for Synology.
Could you post the details on using monit on a synology nas?
I installed the app from the package center but the info on the wiki is not accurate and does not work.
-
- Posts: 37
- Joined: Friday 30 August 2013 20:24
- Target OS: NAS (Synology & others)
- Domoticz version: DS213+
- Contact:
Re: Checking to see if domoticz is still working on Synology
Sure will post the config files later today when home...
EDIT:
ssh / scp into your Synology. Create file /usr/local/monit/var/monit.d/domoticz with following contents
Monit is available on your ip:2812. Default username and password is monit / monit. You can adjust the parameters if you want.
EDIT:
ssh / scp into your Synology. Create file /usr/local/monit/var/monit.d/domoticz with following contents
Code: Select all
#check domoticz is running
check process domoticz with pidfile /usr/local/domoticz/var/domoticz.pid
start program = "/var/packages/domoticz/scripts/start-stop-status start"
stop program = "/var/packages/domoticz/scripts/start-stop-status stop"
if failed host localhost port 8084 then restart
if 3 restarts within 5 cycles then timeout
if memory > 110 MB then restart
#done
- Stefan
- Ferpando
- Posts: 30
- Joined: Friday 23 October 2015 9:45
- Target OS: NAS (Synology & others)
- Domoticz version:
- Location: Spain
- Contact:
Re: Checking to see if domoticz is still working on Synology
Ok, I did figured out the location of the PID file, but didn't know hot to restart it.
I did find the start-stop-status script, but I thought it had something to do with package center.
So i was not too far away
I see you also removed the reboot from the wiki script, which indeed rebooted the whole nas.
Thanks for the pointers.
I did find the start-stop-status script, but I thought it had something to do with package center.
So i was not too far away

I see you also removed the reboot from the wiki script, which indeed rebooted the whole nas.
Thanks for the pointers.
- Ferpando
- Posts: 30
- Joined: Friday 23 October 2015 9:45
- Target OS: NAS (Synology & others)
- Domoticz version:
- Location: Spain
- Contact:
Re: Checking to see if domoticz is still working on Synology
I did change the script but i just can't stop domoticz to test it.
If I stop it in the package center, it shows stopped but the process is still running.
Algo if I shut it down from the menu, says
If I stop it in the package center, it shows stopped but the process is still running.
Algo if I shut it down from the menu, says
So I don't know hot to test it2015-10-24 14:34:40.389 Error: Error executing shutdown command. returned: 32512
-
- Posts: 13
- Joined: Sunday 16 August 2015 20:05
- Target OS: NAS (Synology & others)
- Domoticz version:
- Contact:
Re: Checking to see if domoticz is still working on Synology
Perfect, figured it out, there is a sample script folder in the monit folder, which also contains a script for domotics.
I still have to figure out how to monitor my mysql database, and probably others. If people are willing to share their monit @ synology, then please, saves me a lot of time researching
I still have to figure out how to monitor my mysql database, and probably others. If people are willing to share their monit @ synology, then please, saves me a lot of time researching
-
- Posts: 230
- Joined: Sunday 14 July 2013 20:21
- Target OS: Linux
- Domoticz version: 4.10233
- Location: Alkmaar, The Netherlands
- Contact:
Re: Checking to see if domoticz is still working on Synology
Thanks! was looking for a way to monitor Domoticz on my DS 713+. First couldn't find the monit package. But now it was ther. installed it. Created the domoticz file and restarted monit and up and running!
-
- Posts: 890
- Joined: Tuesday 30 September 2014 8:49
- Target OS: Linux
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Checking to see if domoticz is still working on Synology
Be sure to check it though...... (stopping the Domoticz package by hand & then wait to see if Monit kicks in).
I also use monit on the Ubuntu virtual machine that runs my Domoticz. Monit is very handy. Not only for taking action when Domoticz is down, but also to restart the Domoticz process when it consumes too much CPU (hanging). Maybe not the most ideal setup to find a solution, but for me it is the uptime & reliability that counts.
Having lights that won't respond will get my girlfriend annoyed veeeeeery quickly
I also use monit on the Ubuntu virtual machine that runs my Domoticz. Monit is very handy. Not only for taking action when Domoticz is down, but also to restart the Domoticz process when it consumes too much CPU (hanging). Maybe not the most ideal setup to find a solution, but for me it is the uptime & reliability that counts.
Having lights that won't respond will get my girlfriend annoyed veeeeeery quickly

I am not active on this forum anymore.
-
- Posts: 230
- Joined: Sunday 14 July 2013 20:21
- Target OS: Linux
- Domoticz version: 4.10233
- Location: Alkmaar, The Netherlands
- Contact:
Re: Checking to see if domoticz is still working on Synology
Thanks! I Will test it! Haha the girlfriend stuff sounds familiair! 
*EDIT* Just tested and works flawlessly!

*EDIT* Just tested and works flawlessly!
-
- Posts: 65
- Joined: Tuesday 24 February 2015 15:54
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Checking to see if domoticz is still working on Synology NAS
Just set this up (have had a few times where domoticz stops running but nothing in the log) and seems to work great except that after monit restarts domoticz, synology shows it as not running still.
I stopped domoticz by the package manager in the ui so I suspect we need a way to tell synology that monitor has started it?
Overall this is a great life, I mean, wife saver! A couple of times I've endured the wrath of swmbo when the kitchen lights have failed lol!
I stopped domoticz by the package manager in the ui so I suspect we need a way to tell synology that monitor has started it?
Overall this is a great life, I mean, wife saver! A couple of times I've endured the wrath of swmbo when the kitchen lights have failed lol!
- gizmocuz
- Posts: 2521
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: Checking to see if domoticz is still working on Synology NAS
That is also why you should not let your house depend on any software application, but see it as addon
So your kitchen lights, use zwave, you can always turn them on/off without software, but... can also control them by software
(433mhz kaku/coco will also work of course)
But... it gets addicted, for instance you have one remote button that turns out all lights in the living room (downstairs..), and turns on your bedroom light.
When this remote does not work (battery issue for instance) you have to go to all the lights to turn them off by hand... but at least you can turn them off.
I have not a single switch or power outlet in my house that we can not control without software, that is very pleasant for the WAF
.. But the whole house 'is' controlled, but can be overruled
So your kitchen lights, use zwave, you can always turn them on/off without software, but... can also control them by software
(433mhz kaku/coco will also work of course)
But... it gets addicted, for instance you have one remote button that turns out all lights in the living room (downstairs..), and turns on your bedroom light.
When this remote does not work (battery issue for instance) you have to go to all the lights to turn them off by hand... but at least you can turn them off.
I have not a single switch or power outlet in my house that we can not control without software, that is very pleasant for the WAF
.. But the whole house 'is' controlled, but can be overruled
Quality outlives Quantity!
-
- Posts: 370
- Joined: Monday 05 October 2015 10:16
- Target OS: -
- Domoticz version:
- Contact:
Re: RE: Re: Checking to see if domoticz is still working on Synology NAS
Own a Qnap so dont have the right solution... However on qnap there are commands to stop/start programs in a simular way.cherowley wrote:Just set this up (have had a few times where domoticz stops running but nothing in the log) and seems to work great except that after monit restarts domoticz, synology shows it as not running still.
I stopped domoticz by the package manager in the ui so I suspect we need a way to tell synology that monitor has started it?
Overall this is a great life, I mean, wife saver! A couple of times I've endured the wrath of swmbo when the kitchen lights have failed lol!
I searched a little and found this: https://forum.synology.com/enu/viewtopi ... 0&t=107575
It recommands to create a task to stop/start a package... Perhaps adapting this commandline/script in monit will help...
Grtz,
Stephan
-
- Posts: 30
- Joined: Friday 02 October 2015 19:09
- Target OS: NAS (Synology & others)
- Domoticz version: stable
- Contact:
Re: Checking to see if domoticz is still working on Synology NAS
cherowley wrote:Just set this up (have had a few times where domoticz stops running but nothing in the log) and seems to work great except that after monit restarts domoticz, synology shows it as not running still.
I stopped domoticz by the package manager in the ui so I suspect we need a way to tell synology that monitor has started it?
Overall this is a great life, I mean, wife saver! A couple of times I've endured the wrath of swmbo when the kitchen lights have failed lol!
HI All,
Is there anybody who know's how to tell synology that domoticz is started?
username@DS411:/usr/local/monit/var/monit.d$ sudo synopkg status domoticz
domoticz package is stopped
Status: [0]
username@DS411:/var/packages/domoticz/scripts$ sudo ./start-stop-status status
Domoticz is running
Who is online
Users browsing this forum: Google [Bot] and 1 guest