Page 1 of 1
Checking to see if domoticz is still working on Synology NAS
Posted: Sunday 11 October 2015 11:22
by idonl
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
Re: Checking to see if domoticz is still working on Synology
Posted: Sunday 11 October 2015 15:47
by steef84
You can install Monit on Synology. Just add SynoCommunity as package source and install Monit for Synology.
Re: Checking to see if domoticz is still working on Synology
Posted: Sunday 11 October 2015 16:43
by mvveelen
I had this script running:
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
and ran it with a cron job every 5 or 10 minutes.
But now I switched to Monit and like that a lot more.
Re: Checking to see if domoticz is still working on Synology
Posted: Sunday 11 October 2015 19:26
by idonl
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
Re: Checking to see if domoticz is still working on Synology
Posted: Friday 23 October 2015 14:16
by Ferpando
steef84 wrote:You can install Monit on Synology. Just add SynoCommunity as package source and install Monit for Synology.
Hi,
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.
Re: Checking to see if domoticz is still working on Synology
Posted: Friday 23 October 2015 14:21
by steef84
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
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
Monit is available on your ip:2812. Default username and password is monit / monit. You can adjust the parameters if you want.
Re: Checking to see if domoticz is still working on Synology
Posted: Saturday 24 October 2015 14:32
by Ferpando
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.
Re: Checking to see if domoticz is still working on Synology
Posted: Saturday 24 October 2015 14:38
by Ferpando
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
2015-10-24 14:34:40.389 Error: Error executing shutdown command. returned: 32512
So I don't know hot to test it
Re: Checking to see if domoticz is still working on Synology
Posted: Saturday 24 October 2015 19:52
by idonl
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
Re: Checking to see if domoticz is still working on Synology
Posted: Tuesday 03 November 2015 10:25
by Skippiemanz
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!
Re: Checking to see if domoticz is still working on Synology
Posted: Tuesday 03 November 2015 16:33
by ThinkPad
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

Re: Checking to see if domoticz is still working on Synology
Posted: Tuesday 03 November 2015 18:04
by Skippiemanz
Thanks! I Will test it! Haha the girlfriend stuff sounds familiair!
*EDIT* Just tested and works flawlessly!
Re: Checking to see if domoticz is still working on Synology NAS
Posted: Wednesday 10 February 2016 17:15
by cherowley
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!
Re: Checking to see if domoticz is still working on Synology NAS
Posted: Wednesday 10 February 2016 18:46
by gizmocuz
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
Re: RE: Re: Checking to see if domoticz is still working on Synology NAS
Posted: Wednesday 10 February 2016 19:22
by stlaha2007
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!
Own a Qnap so dont have the right solution... However on qnap there are commands to stop/start programs in a simular way.
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
Re: Checking to see if domoticz is still working on Synology NAS
Posted: Saturday 21 January 2017 22:09
by jurgen
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