Just wanted to share my setup if someone would find it useful.
I have three ZM servers setup so that one hosts the database, one the cameras and one acts as the event server:
All filters, audits and such run on ES so that CAMS is dedicated to capturing and motion detection.
Servers are "Linux zoneminder 5.10.0-15-amd64 #1 SMP Debian 5.10.120-1 (2022-06-09) x86_64 GNU/Linux" and run as virtual machines on oVirt cluster.
Some tweaks I had to make to make things work:
1. Made a trigger filter for ES:
The command is:
Code: Select all
/var/lib/zmeventnotification/bin/zm_event_start_wrapper.sh %EI% "" %MN% %EC%
Code: Select all
inserted @ row 476
if args.get('notes'):
url = '{}/events/{}.json'.format(g.config['api_portal'], args['eventid'])
try:
ev = zmapi._make_request(url=url, type='get')
except Exception as e:
g.logger.Error ('Error during event notes retrieval: {}'.format(str(e)))
g.logger.Debug(2,traceback.format_exc())
exit(0) # Let's continue with zmdetect
new_notes = 'ML:'
if ev.get('event',{}).get('Event',{}).get('Notes'):
old_notes = ev['event']['Event']['Notes']
new_notes = new_notes + old_notes
g.logger.Debug (1,'Replacing old note:{} with new note:{}'.format(old_notes, new_notes))
payload = {}
payload['Event[Notes]'] = new_notes
try:
ev = zmapi._make_request(url=url, payload=payload, type='put')
except Exception as e:
g.logger.Error ('Error during notes update: {}'.format(str(e)))
g.logger.Debug(2,traceback.format_exc())
Code: Select all
modified @ row 534
if args.get('notes'):
url = '{}/events/{}.json'.format(g.config['api_portal'], args['eventid'])
try:
ev = zmapi._make_request(url=url, type='get')
except Exception as e:
g.logger.Error ('Error during event notes retrieval: {}'.format(str(e)))
g.logger.Debug(2,traceback.format_exc())
exit(0) # Let's continue with zmdetect
new_notes = pred
if ev.get('event',{}).get('Event',{}).get('Notes'):
old_notes = ev['event']['Event']['Notes']
old_notes_split = old_notes.split('ML:')
old_d = old_notes_split[0] # old detection
try:
old_m = old_notes_split[1]
except IndexError:
old_m = ''
new_notes = 'ML:' + pred + old_m
g.logger.Debug (1,'Replacing old note:{} with new note:{}'.format(old_notes, new_notes))
payload = {}
payload['Event[Notes]'] = new_notes
try:
ev = zmapi._make_request(url=url, payload=payload, type='put')
except Exception as e:
g.logger.Error ('Error during notes update: {}'.format(str(e)))
g.logger.Debug(2,traceback.format_exc())
Code: Select all
Motion
ML:[s] detected:person:86% Motion: Walkway, Deck, Yard