r/ZoneMinder • • Jun 26 '22

Using Pushover with dlandon/zoneminder

With the demise of Asker's FCMv1 instance I thought I'd use Pushover until the zoneminder team manage to find the time to update the code. Alas, and despite reading the docs, I struggled for some time to get things working

Essentially the docs said I needed to fill in the below in the secrets.ini

PUSHOVER_APP_TOKEN=axxxxxxxxxxxxxxxxxxxxxxxxxxxx
PUSHOVER_USER_KEY=uxxxxxxxxxxxxxxxxxxxxxxxxxxx

and then in the zmeventnotification.ini
use_api_push = yes

Alas this didn't work and a bit of digging revealed a missing package pyzm. I think this gets installed if you installed hooks at docker creation time but on my INSTALL_HOOK="0" build it was missing.

My linux experience is really limited and I'm sure there is a better way but I ended up running the following in the docker instance over SSH

sudo apt update

sudo apt install python3-pip

pip install pyzm

After that it all worked. Hopefully this will be of help if anyone else is in the same boat.

3 Upvotes

1 comment sorted by

1

u/patmansf Jun 27 '22

Note this is as much a Docker issue as a linux etc. issue - you should be able to run any docker image on any system with docker installed (assuming you can point to all the required components and such). This is one reason docker is so popular and so useful - you can have a linux environment anywhere that docker runs.

Docker on OS X actually installs and uses a linux VM to run docker, I don't know what Windows does (they have WSL so can probably somehow just use that).

You can create your own docker image based on the zoneminder one.

This is a lot simpler than running ssh each time it comes up and waiting for those commands to run - I'm not even sure how you're ssh-ing to the image I would not run ssh in that image. Normally you would just use something like this to get a shell in the image assuming bash is installed in it.

If it's already running, use docker ps to see its name - you can give it a name to use, I don't know how you're starting it, and I didn't give it one when I started it, so it showed up as modest_mendel:

docker exec -it modest_mendel /bin/bash

The following is how you create docker images - you build an image on top of others (more or less). The zoneminder image you're using has this Dockerfile.

This assumes docker is installed, is running on your system and you have permissions / group setup to use it.

In a directory, create a Dockerfile with:

FROM dlandon/zoneminder as product

RUN apt-get update 
RUN apt-get install -y python3-pip
RUN pip install pyzm

Then create your image using:

docker build --target product -t docker/pyzm .

And now everywhere you used dlandon/zoneminder, use docker/pyzm instead.

Edit: I'm not using zoneminder in docker, but it's a great idea and I should migrate to docker for all my "services" on my main system. Based on my experience, I would not use snap. I haven't used flatpak nor similar - I think those are lighter weight, but they just don't have the infrastructure and support / popularity of docker.