From f7858f37703cae908f1be57643fa4720740acda8 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sat, 7 Feb 2026 21:13:56 -0500 Subject: [PATCH] feat: add events command to zmonvif-probe.pl Add 'events' command to check if an ONVIF camera supports the events service. Returns "Events: yes" or "Events: no" for easy parsing. Co-Authored-By: Claude Opus 4.5 --- scripts/ZoneMinder/lib/ZoneMinder/ONVIF.pm.in | 16 ++++++++++++++++ scripts/zmonvif-probe.pl.in | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/ONVIF.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/ONVIF.pm.in index 79bdadc99..e7fb737c6 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/ONVIF.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/ONVIF.pm.in @@ -367,6 +367,22 @@ sub metadata { } +sub events { + my ($client) = @_; + + my $events_ep = $client->get_endpoint('events'); + if (!$events_ep) { + print "Events: no\n"; + print "Device does not support ONVIF events.\n" if $verbose; + return 0; + } + + print "Events: yes\n"; + print "Device supports ONVIF events.\n" if $verbose; + + return 1; +} + 1; __END__ diff --git a/scripts/zmonvif-probe.pl.in b/scripts/zmonvif-probe.pl.in index b9d3cd0bf..e121be833 100644 --- a/scripts/zmonvif-probe.pl.in +++ b/scripts/zmonvif-probe.pl.in @@ -49,6 +49,7 @@ sub HELP_MESSAGE { profiles - print the device's supported stream configurations metadata - print some of the device's configuration settings move - move the device (only ptz cameras) + events - check if the device supports ONVIF events Common parameters: -v - increase verbosity Device access parameters (for all commands but 'probe'): @@ -122,6 +123,8 @@ if ( $action eq 'probe' ) { ZoneMinder::ONVIF::move($client, $dir); } elsif ( $action eq 'metadata' ) { ZoneMinder::ONVIF::metadata($client); + } elsif ( $action eq 'events' ) { + ZoneMinder::ONVIF::events($client); } else { my $media = $client->get_endpoint('media'); if ( ! $media ) { @@ -158,6 +161,7 @@ zmonvif-probe.pl - ZoneMinder ONVIF probing tool profiles - print the device's supported stream configurations metadata - print some of the device's configuration settings move - move the device (only ptz cameras) + events - check if the device supports ONVIF events other - Any command supported by the ONVIF Media element. Common parameters: