So, I am currently running a 4 camera setup, all using ffmpeg, and I have a very annoying issue.
Occasionally, one or more of my cameras will loose connection to wifi for a moment, and when it reconnects, zoneminder does not restart it properly. The only way I can get it to start working again is to disable/enable the camera, or click 'status' and 'restart'.
I've googled around for weeks now and tried everything I could find, but nothing has worked, so at this point, I would like to use a cronjob to service zoneminder restart when this happens, but, I need to know how to determine if my cameras are working in that context. I considering parsing logs, but that was no help, they are too chatty and there are no discernible errors (that dont normally appear anyway) indicating a camera has gone dead.
How can I determine if one of the cameras is no longer recording, and restart zm in response?
How to restart ZM service in response to camera dead?
Re: How to restart ZM service in response to camera dead?
If you don't drop a better solution, you can restart ZM each hour via cron. If you drop how to restart only when camera not reconnect properly, please share
For restart 1x by hour :
Edit crontab
For restart 1x by hour :
Edit crontab
Code: Select all
sudo crontab -e
- 30 => each 30th minute of the hour
Code: Select all
# debug zoneminder 30 * * * * /opt/scripts/restartZM.sh
Code: Select all
nano /opt/scripts/restartZM.sh
- tape CTRL+X for save&quit
Code: Select all
#!/bin/bash #sleep +-57 secondes is necessary for don't distrub MoCord and Record (don't creat events of few secondes) sleep 57 sudo service zoneminder restart
Re: How to restart ZM service in response to camera dead?
I would be tempted to use monit to ping the camera and if it goes offline then do a zmdc.pl restart zmc -m whatever.
but really... ZM should restart the camera automatically. It is supposed to. There is a zmwatch.pl program that looks for the last time zmc or zma did anything and if it more than some seconds (like 30 or so, it is configurable) then it restarts the camera.
What type of zm monitor is it?
but really... ZM should restart the camera automatically. It is supposed to. There is a zmwatch.pl program that looks for the last time zmc or zma did anything and if it more than some seconds (like 30 or so, it is configurable) then it restarts the camera.
What type of zm monitor is it?
Re: How to restart ZM service in response to camera dead?
I had a similar issue. Changing the zmwatch timeout (options - config) from the default of 10 seconds to a higher number, say 30 or 60 fixed most of my dropout issues.
If the cameras still drop out after that, you can monitor the zmwatch.pl watchdog script by either putting it in debug log mode or adding additional logging in the perl code itself to see where the hangup is. The perl code is easy to understand so don't be afraid to take a look.
If the cameras still drop out after that, you can monitor the zmwatch.pl watchdog script by either putting it in debug log mode or adding additional logging in the perl code itself to see where the hangup is. The perl code is easy to understand so don't be afraid to take a look.
-
- Posts: 360
- Joined: Sun Jun 05, 2016 2:53 pm
Re: How to restart ZM service in response to camera dead?
I am running version 1.30.0, and there is no zmwatch timeout option that I am able to find. Is this a later version option? Its not on options/config AFAICT, unless its called something totally unrelated. Its also not described in the documentation here http://zoneminder.readthedocs.io/en/sta ... onfig.html
Where is this setting?
Re: How to restart ZM service in response to camera dead?
I didn't give enough information, it's the zmdc setting in options. zmwatch is a watchdog script and if you read it, it will use zmdc.pl to restart any cameras that are not responding. The setting is MAX_RESTART_DELAY. Note that I ended up making this script as I am still receiving dropouts that zmdc can't repair. But with the script, my system is operational and repairs cameras without manual intervention, albeit with slight delay.alabamatoy wrote: ↑Thu Apr 19, 2018 1:47 am I am running version 1.30.0, and there is no zmwatch timeout option that I am able to find.
More of an issue in 1.29 than 1.30. In 1.28 they used to return on their own.