V1.30.4 Remastered

Support and queries relating to third party Live CDs and DVD, VM images and other packaged distributions
Mopar93
Posts: 35
Joined: Thu Feb 12, 2009 9:36 pm

Re: V1.30.4 Remastered

Post by Mopar93 »

In the timeline window, you can also zoom in and out to view less time or more time. Instructions are listed right in the timeline window itself.

-Maurice
Brushpopper
Posts: 12
Joined: Wed Oct 07, 2015 12:25 am

Re: V1.30.4 Remastered

Post by Brushpopper »

lol.. well, I did not see those instructions because I usually move my mouse of the alarmed areas and then those instructions disappear. just tried it and sure enuff... thanks for pointing that out to me....

Now another question... I have a couple of cameras that are right at the limit of my wifi range and occasionally go to a blue screen for a while and when this happens I get a huge rise in events in a short period of time which sometimes causes ZM to STOP. When this happens it is random so it could be middle of the night or day and the camera video does eventually come back and stops the increase in events, so what is the best way to Autorestart ZM when this happens?
Mopar93
Posts: 35
Joined: Thu Feb 12, 2009 9:36 pm

Re: V1.30.4 Remastered

Post by Mopar93 »

It's usually not ZM that needs to be restarted. Restarting ZM will restart everything. Sometimes, if only one camera is affected, you can restart FFMPEG for that one camera. You can do this by clicking on its entry under the SOURCE column and then click SAVE. If you prefer to restart ZM, then click on "Running" at the top of the screen, then select Restart and APPLY.

Sometimes, it helps to reposition the router that you use or move its antennae around if it has one on the outside in order to get a better signal from the camera that is giving you trouble. The best cure is to run an ethernet cable to the camera. Most WiFi cameras have real weak radios.

-Maurice
Brushpopper
Posts: 12
Joined: Wed Oct 07, 2015 12:25 am

Re: V1.30.4 Remastered

Post by Brushpopper »

Thanks for the input, but these are all the things I currently do when a camera goes out. As far as running an ethernet cable, the cameras that are doing this do not have ethernet connections..


I am just looking for a way to autorestart ZM when it shuts down because it is generating too many events when the camera goes blue because I am usually not sitting in front of my computer at 1am or 3am when it happens.

I know I can create a cron job or there is a way to edit the zoneminder.service file to do this.. I was just wondering if you had any more insight to one of these methods or a better method.
Mopar93
Posts: 35
Joined: Thu Feb 12, 2009 9:36 pm

Re: V1.30.4 Remastered

Post by Mopar93 »

I completely blew past the word Autostart in your post. Or maybe it should be autoREstart. I'll have to think about a good solution as I've never had to do this. Anytime I've had a camera lose its connection, I usually just login to that particular camera and restart the camera and it gets a connection going again. I rarely have to restart ZM or the individual FFMPEG. I also use a filter to load up all events that have less than 5 frames and delete those events since they are meaningless to keep on the system.

-Maurice
Brushpopper
Posts: 12
Joined: Wed Oct 07, 2015 12:25 am

Re: V1.30.4 Remastered

Post by Brushpopper »

I keep finding that there is a way to set it to restart in systemd below is the statement I keep reading

"systemd has the capability to auto restart any service which has failed. Just put "restart=always" in your zoneminder service file."

But I cannot find the zoneminder.service file.. I found that earlier distros had you create this file, ie.,

"Create a file called zoneminder.service

nano /lib/systemd/system/zoneminder.service
Paste or enter the following:

# ZoneMinder systemd unit file
# This file is intended to work with all Linux distributions
[Unit]
Description=ZoneMinder CCTV recording and security system
After=network.target mysql.service apache2.service
Requires=mysql.service apache2.service
[Service]
User=www-data
Type=forking
ExecStart=/usr/bin/zmpkg.pl start
ExecReload=/usr/bin/zmpkg.pl restart
ExecStop=/usr/bin/zmpkg.pl stop
PIDFile="/run/zm/zm.pid"
[Install]
WantedBy=multi-user.target"


I do not want to create it for ZM 130 unless I know it is pointing at the right direstories and wont overwrite anything else.

Suggestions????

Thanks in advance
Mopar93
Posts: 35
Joined: Thu Feb 12, 2009 9:36 pm

Re: V1.30.4 Remastered

Post by Mopar93 »

On your Ubuntu 22.04 system, the ZM130 installation would have already created this file for you. It is called "zoneminder130.service" and can be found at:

/usr/lib/systemd/system/zoneminder130.service

However, I don't think this will do what you want it to do. Systemd won't restart it because in your case, zoneminder130 hasn't stopped. Only the connection between ffmpeg and your camera has been lost due to the weak wifi signal.

By the way, if you should happen to have an issue with zm stopping, it might already be configured to restart. Within the zoneminder130.service file, you'll find this line:

Restart=on-abnormal

-Maurice
Brushpopper
Posts: 12
Joined: Wed Oct 07, 2015 12:25 am

Re: V1.30.4 Remastered

Post by Brushpopper »

it may do what I want because when the camera does fail it stars creating so many events that ZM does go into a "STOP" state, and when I can catch it.. I usually set that camera to Monitor instead of MoCord until the signal comes back.

Not sure Why I didnt think to look for a zoneminder130.service file... lol

and I know that it was stopped for several hours the other day, when I first started exploring this, cuz when I checked the event log, the last event had been at 1:35am and I noticed it in a STOP state about 5:30am. Since it is about the Motel property, I would rather have it go back into a RUNNING state so that if (God forbid) something happens, at least one of the other cameras will catch it until I can get a wifi extender to the right location to prevent this in the future.
Mopar93
Posts: 35
Joined: Thu Feb 12, 2009 9:36 pm

Re: V1.30.4 Remastered

Post by Mopar93 »

If you can write a bash script, here are some command lines that you can include to maybe do what you need:

In Ubuntu, you might have to add "sudo" to the start of each command. On other Linux systems, running the script as root will work.

This command will check the current status of zoneminder130:

/usr/bin/zmdc.pl check

You can do this right from a command line or within a bash script. Test it from a command line first to see that it works as intended.

It will return the current status of zoneminder130. If could be "running" or "stopped", for instance. You really only need to check for "running". If it returns anything else, use this command to restart zoneminder130:

/usr/bin/zmdc.pl restart

You could edit crontab to call your script every minute or every 5 minutes or whatever you are comfortable with. If you need any more help with this, just ask.

-Maurice
Brushpopper
Posts: 12
Joined: Wed Oct 07, 2015 12:25 am

Re: V1.30.4 Remastered

Post by Brushpopper »

OK, I found this bash script and just wondering if I really need it to echo if successful or not since I am accessing the server remotely using Putty and monitoring it via ZM console on another pc.

If this looks good I can set up a cron job to run every 15 min or so.

______________________________________________________________
#!/bin/bash

# Define the process name
PROCESS_NAME="zmdc.pl"

# Check if the process is running
if pgrep -x "$PROCESS_NAME" > /dev/null; then
echo "$PROCESS_NAME is running."
else
echo "$PROCESS_NAME is not running. Restarting..."
# Restart the process (adjust the path to zmdc.pl as needed)
nohup /usr/bin/zmdc.pl > /dev/null 2>&1 &
if [ $? -eq 0 ]; then
echo "$PROCESS_NAME restarted successfully."
else
echo "Failed to restart $PROCESS_NAME."
fi
fi
--------------------------------------------------------------------

I did do Computer support a long time ago and I tell you, asking google for help is so much easier than learning all that code like I did 40-50 years ago... lmao.

Again thanks in advance for all your help
Mopar93
Posts: 35
Joined: Thu Feb 12, 2009 9:36 pm

Re: V1.30.4 Remastered

Post by Mopar93 »

That script is checking to see if the zmdc.pl daemon is running. And part of it is checking to see if a good response comes back from the daemon. I don't think that is as accurate as running a second zmdc.pl command as I described in my previous message. In my examples, a second instance of zmdc.pl runs and then exits even while the zmdc.pl daemon is running. Although I've never tested it nor had a need to, I'm pretty sure that the daemon could be intact and respond OK even while zoneminder is in a state of not running. But, go ahead and try that script and see if it does what you need. It might just work for you.

-Maurice
User avatar
iconnor
Posts: 3362
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: V1.30.4 Remastered

Post by iconnor »

zmdc.pl can be running and responding OK while nothing else is running. It is true. Wierd but true.

zmpkg.pl tells zmdc.pl to start all relevant processes but something else could tell zmdc.pl to stop everything. THe UI would still think ZM is running even though nothing useful is.

It is a pretty wierd situation. but it could happen.
Post Reply