Hello, I have cam with dynamic url (i.e. /YYYY/MM/DD/HH_MM.jpg), my bash script know about URL changing, and I can do some tricks with cronjob. I.e.:
# ...
if [ "$OLDURL" != "$NEWURL" ]; then
echo $NEWURL > $LOCKFILE
mysql -e "UPDATE Monitors SET Path = '$NEWURL' WHERE Id = $MONITOR" zm
/etc/init.d/zm restart > /dev/null
# ...
But I think must be better way for refresh configuration than (zm restart).
Regards.
Dynamic remote cam url
This is NOT IP changing-this is PATH changing. All work fine, but I dont know, how to submit new configuration data in ZM. I can change path in ZM MySQL database (mysql -e "UPDATE Monitors SET Path = '$NEWURL' WHERE Id = $MONITOR" zm ) but after that ZM show me OLD url, until I run /etc/init.d/zm restart.
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
> So changing it while it is running will have no effect until a restart.
Ok, but when I change cam url trough web interface, and press button SAVE, ZM do restart like this?
zm:/home/gool# /etc/init.d/zm restart
Stopping ZoneMinder: success
Starting ZoneMinder: success
zm:/home/gool#
This way take some time (about ~5 sec). May be there are shotter way?
Ok, but when I change cam url trough web interface, and press button SAVE, ZM do restart like this?
zm:/home/gool# /etc/init.d/zm restart
Stopping ZoneMinder: success
Starting ZoneMinder: success
zm:/home/gool#
This way take some time (about ~5 sec). May be there are shotter way?
If you read my post again I didn't say it was ip-changing. As I said, first suggestion would be to use a script to pass on the image, mapping paths internally.
Anyway, if you can't do that - you could possibly update the mysql database from outside of Zoneminder then run a zmpkg.pl restart to force it to reload the configuration.
It's *not* quick, there'll still be a delay while ZM closes down and restarts, but it is automated.
I've not tried this but should be possible. Hopefully someone will butt in if it's a stupid idea and changing ZM's mysql values whilst it's running is bad.
Anyway, if you can't do that - you could possibly update the mysql database from outside of Zoneminder then run a zmpkg.pl restart to force it to reload the configuration.
It's *not* quick, there'll still be a delay while ZM closes down and restarts, but it is automated.
I've not tried this but should be possible. Hopefully someone will butt in if it's a stupid idea and changing ZM's mysql values whilst it's running is bad.