zm event end auto delete

Discussion topics related to mobile applications and ZoneMinder Event Server (including machine learning)
Post Reply
timf
Posts: 132
Joined: Mon Mar 21, 2005 4:07 pm
Location: Lytham St.Annes Lancs.

zm event end auto delete

Post by timf »

HI,

I've been rebuilding my ZM system onto new hardware (i7 8700, 16GB ram and 1060ti GPU for cuda) and it's all working nicely with ZMES, pushover, ML etc.

The only thing which doesn't seem to be working is the zm end event auto delete which resides in /usr/local/bin and is defined in zmeventnotification.ini.

Events are stored to an extra 480GB hard drive.

Not sure how to go about debugging it and would appreciate any help on how to set up logging for it.

In the zmeventnotification.log I see no mention of autodelete when an event is not triggering a push.

I suspect in the script I may have something wrong in the api_options section where xxxxx is my FQDN hosted by duckdns, maybe I could just use localhost ?

api_options = {
'apiurl': 'https://xxxxx/zm/api/',
'portalurl': 'https://xxxxx/zm/',
'user': 'zmes',
'password': 'password',
'logger': None,
'disable_ssl_cert_check': True
}

I'm using the 'latest' version of the script which worked fine on the old machine, so I guessing I've missed something along the way.

Must say ZM has come along realy well over the years and just keeps getting better and better.

Regards Tim
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: zm event end auto delete

Post by Magic919 »

Might be worth referencing the 'script' as it's not a ZM or even ZMES component as far as I know.
-
timf
Posts: 132
Joined: Mon Mar 21, 2005 4:07 pm
Location: Lytham St.Annes Lancs.

Re: zm event end auto delete

Post by timf »

good point

here's a thread about the script in question

viewtopic.php?t=29137

as you can see from the last post I did have it working ok before :-)

Regards Tim
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: zm event end auto delete

Post by Magic919 »

I suppose I could try and guess which of the 3 scripts on that page you have used.

However, have you run it by hand? That’s probably where I’d start.

I can try using it. With the right conditions I should see events with nothing detected. Probably later today when the light drops.
-
timf
Posts: 132
Joined: Mon Mar 21, 2005 4:07 pm
Location: Lytham St.Annes Lancs.

Re: zm event end auto delete

Post by timf »

I'll have a poke round as well - probably something simple I've missed.

I've tried running it locally and it didn't like my FQDN, failed to connect of port

Error: HTTPSConnectionPool(host='XXXX.duckdns.org', port=443): Max retries exceeded with url: /zm/api//host/login.json (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbe5c7efc10>: Failed to establish a new connection: [Errno 113] No route to host'))

So I changed my FQDN to localhost and tried again and got indicating a connection

Traceback (most recent call last):
File "/usr/local/bin/zm_event_end_autodelete.py", line 108, in <module>
e_id = sys.argv[1]
IndexError: list index out of range

I triggered a false alarm and it seemed to work ok, so I think changing FQDN to local host fixed the problem - even though on my old system the FQDN worked ok.

Here's the script I'm trying to run, mentioned just above my last post in the thread above.

Regards Tim

ATTACHMENTS
zm_event_end_autodelete.py.pzm.0.1.28.txt
Please remove the '.pzm.0.1.28.txt' at the end
(5.86 KiB) Downloaded 357 times
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: zm event end auto delete

Post by Magic919 »

If that error is correct, then it does the DNS lookup, gets what I assume is a public IP and then can’t work out how to get there. It’s a bit odd, as I’d just expect it to forward traffic to the default gateway.

Maybe your new box has some network setup oddity.

It looks like you ran it with no arguments. It’s saying there’s no event ID (e_id). It’ll moan about them all in turn until you’ve given all the arguments.

Sounds like you are sorted. Now I now it’s the pyzm version from the page, I can give it a try.
-
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: zm event end auto delete

Post by Magic919 »

That works -

INF [hook_del_events] [Delete event 388016 @ 9-HD_Camera: "Motion: Gate"]
-
timf
Posts: 132
Joined: Mon Mar 21, 2005 4:07 pm
Location: Lytham St.Annes Lancs.

Re: zm event end auto delete

Post by timf »

all sorted and working nicely - as is often the case writing the problem in a forum triggers a new tack and helps solve the issue.

I'd be interested to hear what you find with this script.

Yes - something a bit odd with my network that FQDN didn't work but local host did.

Strangely enough I just tried FQDN on this PC on the same network / subnet and it couldn't find imy ZM box either, but accessing from my mobile phone over 4G the FQDN works perfectly.

Clearly something a little flakey with DNS on myside.

Regards Tim
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: zm event end auto delete

Post by Magic919 »

Script still working well for me. Cleans out a lot of things I (largely) don't need to see.
-
Post Reply