It has been asked for many times, well I finally implemented it.
You can now specify a program to run both when an event starts, and when it ends.
This means you don't have to constantly monitor shm for new events.
Find it on the first table of monitor editing called Event Start Command and Event End Command. Put the full path to the program. The first argument will be the event Id. You will have to query the db for any other info you need.
1.37.5 run process on new event
Re: 1.37.5 run process on new event
Is there a possibility that this feature could be enhanced to run on alarm instead of just on a new event? It seems running on a new event is really only useful for monitors in Modect; I think on alarm would give greater flexibility.
Thanks,
Alec
Thanks,
Alec
DFU
Re: 1.37.5 run process on new event
If someone creates a PR for it I will consider merging it.
Otherwise someone will have to pay to have it done.
I'd rather work on adding MQTT support.
Otherwise someone will have to pay to have it done.
I'd rather work on adding MQTT support.
Re: 1.37.5 run process on new event
I'm having a little trouble with this. I'm sure I'm missing something simple, but I can't get the script to execute. I saw one ERR in syslog when I first created the script and it was owned by root. I changed ownership to the local user as an attempt to resolve the problem, but that hasn't helped and I don't see any evidence that zm is trying to execute it. I have tried forcing an alarm, even though I've had many recorded events while debugging this and nothing has worked.
Is there a specific location for the script? I have it in the /home/zmadmin user directory on my host.
Is there a specific owner/group that works? Permissions are 777 so that should not be an issue..
Any advice would be great.
Is there a specific location for the script? I have it in the /home/zmadmin user directory on my host.
Is there a specific owner/group that works? Permissions are 777 so that should not be an issue..
Any advice would be great.
MRD
Re: 1.37.5 run process on new event
give the full path in the setting... make sure it is executable by www-data (or whatever user zm is running as).
On ubuntu, something like
sudo su -s/bin/bash -c"/home/zmadmin/script" www-data
Other than that.. if there was a failure it should be logged..
On ubuntu, something like
sudo su -s/bin/bash -c"/home/zmadmin/script" www-data
Other than that.. if there was a failure it should be logged..
Re: 1.37.5 run process on new event
Thanks!
Fixed with chown/chgrp to www-data, but I think the real problem was the log it was writing to was created the first time it ran as root.
Thanks for the help!
Fixed with chown/chgrp to www-data, but I think the real problem was the log it was writing to was created the first time it ran as root.
Thanks for the help!
MRD