[support] dlandon - Zoneminder 1.36


Recommended Posts

Hi,

 

At each update of the container, I lose the modifications of zmeventnotification.ini.

Can you copy the new zmeventnotification.ini to /config/zmeventnotification.ini.template ?

And if /config/zmeventnotification.ini does not exist (new install), create it with /config/zmeventnotification.ini.template.

 

This is just an example.

 

Tkanks.

Link to comment
19 minutes ago, Shyrka973 said:

Hi,

 

At each update of the container, I lose the modifications of zmeventnotification.ini.

Can you copy the new zmeventnotification.ini to /config/zmeventnotification.ini.template ?

And if /config/zmeventnotification.ini does not exist (new install), create it with /config/zmeventnotification.ini.template.

 

This is just an example.

 

Tkanks.

The reason I do that is because it seems to change on each update.  I kind of figured this would come up.  I’ll work on a solution.  What modifications are you doing in the .ini file?

Link to comment
2 minutes ago, dlandon said:

What modifications are you doing in the .ini file?

II disable ssl and I configure mqtt. This container is the only one I do not update automatically. No problem. I'm waiting for your solution.

 

Thank you very much.

 

Do you already test or do you think to integrate as an option (a cocker variable ?) this: detect_wrapper.sh ?

Just add the necessary: detect_wrapper.sh, openCV, yolov3-tiny.weights, yolov3.weights, yolov3-tiny.cfg, yolov3.cfg, coco.names, ...

 

 

Link to comment
10 minutes ago, Shyrka973 said:

II disable ssl and I configure mqtt. This container is the only one I do not update automatically. No problem. I'm waiting for your solution.

I'm working on a solution.  What client do you use with MQTT?

10 minutes ago, Shyrka973 said:

Do you already test or do you think to integrate as an option (a cocker variable ?) this: detect_wrapper.sh ?

Just add the necessary: detect_wrapper.sh, openCV, yolov3-tiny.weights, yolov3.weights, yolov3-tiny.cfg, yolov3.cfg, coco.names, ...

 

What is detect_wrapper.sh?  Ok, I see it.  That is the zmeventnotification hook script.  I'll need to see what is needed to implement that feature.

Edited by dlandon
Link to comment
19 minutes ago, dlandon said:

What client do you use with MQTT?

Il use mosquitto with MQTT. 

 

20 minutes ago, dlandon said:

What is detect_wrapper.sh?

Extract from here (read the original):

zmeventnotification.ini now contains a hook attribute. If you specify a script file there, every time the notification server detects an alarm (it interacts with ZM using shared memory and checks the shared_data structure for events), it passes the event id, monitor id and monitor name to this script. The script can do what it chooses and if it returns 0 then the event server will process the notification and send it out to listeners. If it returns 1 it will not. So the script is where all the action is. I then used this framework to do object detection and based on the results, either notify or not.

 

The goal: be notified of vehicles and people.

Link to comment
7 hours ago, Shyrka973 said:

Il use mosquitto with MQTT. 

 

Extract from here (read the original):

zmeventnotification.ini now contains a hook attribute. If you specify a script file there, every time the notification server detects an alarm (it interacts with ZM using shared memory and checks the shared_data structure for events), it passes the event id, monitor id and monitor name to this script. The script can do what it chooses and if it returns 0 then the event server will process the notification and send it out to listeners. If it returns 1 it will not. So the script is where all the action is. I then used this framework to do object detection and based on the results, either notify or not.

 

The goal: be notified of vehicles and people.

I've applied a fix to the docker to not overwrite the zmeventnotification.ini file.  I've also implemented the zmevent hook feature.  A /config/hook/ folder is created and you place the scripts and executable files you need for your implementation of the hook feature.  Be sure to set the file permissions.  The docker will copy the files in the /config/hook/ folder to /usr/bin/ when the docker is started.

Link to comment

Hi dlandon,

 

Thank you very very much.

 

Look this:

 

2018-10-28 12:03:59 zmeventnotification 1051 INF hook script returned with text:detected:person:100% diningtable:77% chair:64% cell phone:52% exit:0

 

Now, I do not have any more false alarm because it must detect someone to warn me. To test in the long term.

 

Can you remove "chmod -R 666 /config/hook" ?

I put executable scripts in /config/hook/ folder that are copied to /usr/bin folder in the docker but after restarting the docker, the scripts are no longer executable.

 

If it interests the world, I can write a howto.

If it interests a lot of people, maybe dlandon can integrate it into the docker or create a specific docker.

Link to comment
10 minutes ago, Shyrka973 said:

Can you remove "chmod -R 666 /config/hook" ?

I put executable scripts in /config/hook/ folder that are copied to /usr/bin folder in the docker but after restarting the docker, the scripts are no longer executable.

Yes.  Removed in the latest release.

 

10 minutes ago, Shyrka973 said:

If it interests a lot of people, maybe dlandon can integrate it into the docker or create a specific docker.

There are too many variations to include in the docker.  It depends on which method you use.  Adding the scripts for your particular situation is the cleanest way to handle this feature.  I don't want to load up the docker with a lot of unused stuff.

 

The support for another docker is more than I care to take on.

Link to comment
18 hours ago, dlandon said:

There are too many variations to include in the docker.  It depends on which method you use.  Adding the scripts for your particular situation is the cleanest way to handle this feature.  I don't want to load up the docker with a lot of unused stuff.

Yes. I understand.

 

I need to execute these commands in this docker after its update:

apt-get install python-pip
pip install opencv-python
apt install libsm6 libxext6 libxrender1

 

Can you add the execution of a script (example: update.sh ) if it is present in /config each time the docker is launched ?

 

Thanks.

Link to comment
5 hours ago, Shyrka973 said:

Yes. I understand.

 

I need to execute these commands in this docker after its update:


apt-get install python-pip
pip install opencv-python
apt install libsm6 libxext6 libxrender1

 

Can you add the execution of a script (example: update.sh ) if it is present in /config each time the docker is launched ?

 

Thanks.

A new docker is building to handle the user script.

 

You will need to edit the docker template xml and add a variable:

ADVANCED_SCRIPT with a value of 1.

 

This will enable your script.

 

Put your script in /config/userscript.sh.

Your script needs some changes:

apt-get -y install python-pip
pip install opencv-python
apt-get -y install libsm6 libxext6 libxrender1

 

Link to comment

I just tried to install this Docker and everything downloaded fine but would not install.  The error is:

 

 

Error: failed to register layer: ApplyLayer exit status 1 stdout: stderr: write /usr/share/file/magic.mgc: no space left on device

 

Couldn't find any reference to it so would appreciate some guidance.  Both my flash and cache drives are over 98% free.

Link to comment
9 minutes ago, arcane said:

I just tried to install this Docker and everything downloaded fine but would not install.  The error is:

 

 

Error: failed to register layer: ApplyLayer exit status 1 stdout: stderr: write /usr/share/file/magic.mgc: no space left on device

 

Couldn't find any reference to it so would appreciate some guidance.  Both my flash and cache drives are over 98% free.

Check your docker space used.  You can see it on the "Dashboard" page.

Link to comment

Ever since upgrading my docker to zm 1.32, my monitors in the Montage view will occasionally freeze. Has anyone else experienced this? It didn't happen with previous versions and the log only states a generic error, "terminating". Seems like it may be related to a motion event but not 100% sure.

Link to comment
10 hours ago, PTRFRLL said:

Ever since upgrading my docker to zm 1.32, my monitors in the Montage view will occasionally freeze. Has anyone else experienced this? It didn't happen with previous versions and the log only states a generic error, "terminating". Seems like it may be related to a motion event but not 100% sure.

Check your shared memory.  "/dev/shm" on the Zoneminder GUI.  Try to keep it 50-70%.  If it's too small, you are using too much main memory and starving Unraid.  If it's too large you risk running out of memory for Zoneminder.

 

You might want to check your camera settings, especially the buffers.

Link to comment
On 11/5/2018 at 4:59 AM, dlandon said:

Check your shared memory.  "/dev/shm" on the Zoneminder GUI.  Try to keep it 50-70%.  If it's too small, you are using too much main memory and starving Unraid.  If it's too large you risk running out of memory for Zoneminder.

 

You might want to check your camera settings, especially the buffers.

/dev/shm is sitting around 4%. Would anything regarding that have changed with the docker update? 

Link to comment
7 hours ago, PTRFRLL said:

/dev/shm is sitting around 4%. Would anything regarding that have changed with the docker update? 

Zoneminder was changed a lot in the latest version.  It's possible they made changes that changed the shared memory usage.  The docker itself has nothing to do with the shared memory, except for specifying the amount of main memory to use for shared memory.

 

In your case you are using a lot more memory from Unraid than is necessary, possibly causing Unraid to run out of memory at times.

Link to comment

Thanks for the help. Another issue I noticed is in the Montage view, there seem to be some failed AJAX calls when trying to get the camera state (FPS, Enabled, etc). Digging a little deeper it looks like the request is leaving off the port ZM is running on. So right now the request fires off to: 

 

http://<IP ADDRESS>/zm/index.php??view=request&request=stream&connkey=779378&command=99

(this fails) 

 

instead of:

 

http://<IP ADDRESS>:<PORT NUM>/zm/index.php??view=request&request=stream&connkey=779378&command=99

 

if I copy the link and add the correct port, the response is good:

 

{
    "result": "Ok",
    "status": {
        "type": 2,
        "monitor": 2,
        "state": 0,
        "fps": 30.31,
        "level": 0,
        "rate": 1,
        "delay": 0.04,
        "zoom": 1,
        "delayed": 0,
        "paused": 0,
        "enabled": 1,
        "forced": 0
    }
}

 

Not sure if this is a docker issue or ZM thing

Link to comment
1 hour ago, PTRFRLL said:

Thanks for the help. Another issue I noticed is in the Montage view, there seem to be some failed AJAX calls when trying to get the camera state (FPS, Enabled, etc). Digging a little deeper it looks like the request is leaving off the port ZM is running on. So right now the request fires off to: 

 


http://<IP ADDRESS>/zm/index.php??view=request&request=stream&connkey=779378&command=99

(this fails) 

 

instead of:

 


http://<IP ADDRESS>:<PORT NUM>/zm/index.php??view=request&request=stream&connkey=779378&command=99

 

if I copy the link and add the correct port, the response is good:

 


{
    "result": "Ok",
    "status": {
        "type": 2,
        "monitor": 2,
        "state": 0,
        "fps": 30.31,
        "level": 0,
        "rate": 1,
        "delay": 0.04,
        "zoom": 1,
        "delayed": 0,
        "paused": 0,
        "enabled": 1,
        "forced": 0
    }
}

 

Not sure if this is a docker issue or ZM thing

I believe this is addressed in the next release of Zoneminder.  I saw on GitHub where this was addressed.  Seems to be related to running in a Docker

Link to comment

 

Thanks for all the support you've been providing to all of us.  ZM isn't the easiest thing to get running and you've done a great job with the Docker.

 

I have it running and am now trying to get zmNinja and notifications working with it.  I just want to make sure I'm allowing access the correct way and not opening up too many security holes.

 

I have a static IP assigned to the docker as recommended previously.  It turns out that dockers can not access other docker IPs so I am unable to get OpenVPN to allow me to access ZM through VPN.  It appears I have to open ports in my router and forward them to the ZM IP.  I have 80, 8080, 8443 and 9000 going to the ZM IP.  Is this safe and is this the preferred way to allow zmNinja to access the server from outside my lan?

 

I can use most of zmNinja but have not gotten notifications to work yet.  I want to make sure I have the connections correct before trying to troubleshoot further.

 

 

 

 

On 10/28/2018 at 11:23 AM, Shyrka973 said:

 

 

If it interests the world, I can write a howto.

 

I'd love a howto on getting this type of detection going once everything is worked out.  I read a little about this on https://medium.com/zmninja/inside-the-hood-machine-learning-enhanced-real-time-alarms-with-zoneminder-e26c34fe354c but it wasn't really a how-to.  I hope it gets integrated into ZM eventually.

 

I'm still working on getting the basics but this looks like a great feature.

Link to comment
1 hour ago, Waltm said:

I have 80, 8080, 8443 and 9000 going to the ZM IP.  Is this safe and is this the preferred way to allow zmNinja to access the server from outside my lan?

The only ports I would open are 8443 (8443 external mapped to internal 443 when you have a static IP) and 9000.  Access ZM using https:// through port 8443 external, and the 9000 port is for the events notification.

 

Be sure to enable the event notifications (OPT_USE_EVENTNOTIFICATION) in the options.

Link to comment
4 hours ago, dlandon said:

The only ports I would open are 8443 (8443 external mapped to internal 443 when you have a static IP) and 9000.  Access ZM using https:// through port 8443 external, and the 9000 port is for the events notification.

 

Be sure to enable the event notifications (OPT_USE_EVENTNOTIFICATION) in the options.

 

As soon as I close 80 and 8080, zmNinja can not connect and gives a "Zoneminder Authentication error".  It also can not be reached in a browser at https://hostname:8443   This may have something to do with SSL cert since I have not set anything up for that.  The first post says the cert is automatically generated but I do not know how to test it.  

 

 

hostname in settings is a resolvable dns hostname that works with port 80 open if I user http://hostname/zm , just changed it for posting.  Is this not the correct way to set this up for ssl?

 

 

Screenshot_20181115-161052_zmNinja.thumb.jpg.0dd7a68d90859ce749660f3408ad0dc4.jpg

 

 

 

Link to comment
1 hour ago, Waltm said:

 

As soon as I close 80 and 8080, zmNinja can not connect and gives a "Zoneminder Authentication error".  It also can not be reached in a browser at https://hostname:8443   This may have something to do with SSL cert since I have not set anything up for that.  The first post says the cert is automatically generated but I do not know how to test it.  

 

 

hostname in settings is a resolvable dns hostname that works with port 80 open if I user http://hostname/zm , just changed it for posting.  Is this not the correct way to set this up for ssl?

 

 

Screenshot_20181115-161052_zmNinja.thumb.jpg.0dd7a68d90859ce749660f3408ad0dc4.jpg

 

 

 

That is correct.  Check your port forwarding.

Link to comment
  • dlandon changed the title to [support] dlandon - Zoneminder 1.36

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.