ZMTRIGGER(1)
π NAME π
zmtrigger.pl β the ZoneMinder External Trigger Script, aka the little goblin that lets the outside world poke your cameras. π
β¨ DESCRIPTION β¨
okay so bestie, here's the tea β β this script triggers and cancels alarms from external connections, and it does it using a text based format that's basically "you make up the rules, I'll follow 'em".
It's a generic solution to external triggering of alarms, fr fr. It can handle external connections via:
- an internet socket
- a unix socket
- or file/device interfaces
You can either use it 'as is' if you can interface with the existing format, or override connections and channels to customise it to your needs. Your script, your rules π
If it's enabled by the OPT_TRIGGERS option, the Zoneminder service starts zmtrigger.pl, which listens for control messages on TCP port 6802. She's always listening πβ¨
π TRIGGER MESSAGE FORMAT π
Here's the format, memorize it, it's giving iconic:
id|action|score|cause|text|showtext
Now let's break down every single one of these fields because I'm not letting you skip homework π
π¦ id
is the id number or name of the ZM monitor. That's it, that's the whole vibe.
π₯ action
Valid actions are 'on', 'off', 'cancel' or 'show', where:
'on'forces an alarm condition on;'off'forces an alarm condition off;'cancel'negates the previous'on'or'off';'show'updates the auxiliary text represented by the%Qplaceholder, which can optionally be added to the affected monitor's timestamp label format.
Ordinarily you would use 'on' and 'cancel', 'off' would tend to be used to suppress motion based events. Additionally 'on' and 'off' can take an additional time offset, e.g. on+20 which automatically cancel's the previous action after that number of seconds. Set it and forget it, bestie β°π
πΈ score
is the score given to the alarm, usually to indicate it's importance. For 'on' triggers it should be non-zero, otherwise it should be zero. No in-between, she's binary like that.
π cause
is a 32 char max string indicating the reason for, or source of, the alarm e.g. 'Relay 1 open'. This is saved in the 'Cause' field of the event. Ignored for 'off' or 'cancel' messages.
π text
is a 256 char max additional info field, which is saved in the 'Description' field of an event. Ignored for 'off' or 'cancel' messages.
β showtext
is up to 32 characters of text that can be displayed in the timestamp that is added to images. The 'show' action is designed to update this text without affecting alarms β but the text is updated, if present, for any of the actions. This is designed to allow external input to appear on the images captured, for instance temperature or personnel identity etc. Your cameras are now a billboard, slay πΈβ¨
Note that multiple messages can be sent at once and should be LF or CRLF delimited. π«Ά
Also, real talk: this script is not necessarily intended to be a solution in itself, but is intended to be used as 'glue' to help ZoneMinder interface with other systems. It will almost certainly require some customisation before you can make any use of it. If all you want to do is generate alarms from external sources then using the ZoneMinder::SharedMem perl module is likely to be easier. No cap, that's the shortcut ππ
π§ EXAMPLES π§
3|on+10|1|motion|text|showtext
Triggers 'alarm' on camera #3 for 10 seconds with score=1, cause='motion'. Look at her go π₯
and that's the whole page, bestie!! this gem was written as part of the User Contributed Perl Documentation, running on perl v5.40.1, and this version is dated 2026-02-01. mwah π go trigger some alarms responsibly π«Άβ¨
π¦ where this page comes from
- ubuntu resolute: zoneminder 1.36.37+dfsg1-1 Β· GPL-2.0-or-later
- ubuntu stonking: zoneminder 1.36.37+dfsg1-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms