triggering of multiple monitors
Posted: Mon Mar 21, 2005 6:02 pm
Can one monitor activate another monitor (s) when being triggered?
Alex
Alex
...which looks good, though I'm not convinced the "on+1" syntax is doing the right thing... (1.20.1)zmtrigger.pl - This is a new (for 1.20.0) optional script that is a more generic solution to external triggering of alarms. It can handle external connections via either internet socket, unix socket or file/device interfaces.
Currently you have to configure these using the 'sources' array in the script itself though ultimately I would expect they would be databased. The format of triggers used by zmtrigger.pl is as follows:
"<id>|<action>|<score>|<cause>|<text>"
where:Note that multiple messages can be sent at once and should be LF or CRLF delimited. Without customisation zmtrigger.pl is of little use, but if you configure it correctly it can help integrate other systems to generate external triggers that will cause ZoneMinder events.
- 'id' is the id number or name of the ZM monitor
- 'action' is 'on','off' or 'cancel' where 'on' forces an alarm condition on, 'off' forces an alarm condition off and 'cancel' negates the previous 'on' or 'off'. 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.
- '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.
- 'cause' is a 32 char max string indicating the reason for, or source of the alarm e.g. 'Relay 1 open'. Ignored for 'off' or 'cancel' messages
- 'text' is a 256 char max additional info field, currently not used for anything though anything passed in here will get saved. Ignored for 'off' or 'cancel' messages.
Code: Select all
Trigger daemon starting at 05/03/23 00:29:10
Opening source 'S2'
Got input from 1 sources
Got input from source S2 (6)
Got '1|on+10|1|Snapshot|text
' (24 bytes)
Processing buffer '1|on+10|1|Snapshot|text
'
Processing message '1|on+10|1|Snapshot|text'
Found monitor for id '1'
Handling action 'on+10'
Triggered event on 'Snapshot'
Added timed event '1|cancel|Snapshot|text', expires at 1111537795 (+10 secs)
Got input from 1 sources
Got input from source S2 (6)
Got unexpected close on source S2 at /usr/bin/zmtrigger.pl line 210.
Trigger daemon starting at 05/03/23 00:29:45
Opening source 'S2'
Code: Select all
die( "Got unexpected close on source $source->{name}" );
Code: Select all
echo '1|on+1|1|trigger|testing' > named.pipe
...which, I guess, results in the pipe being "closed" at the end of the echo text...lazyleopard wrote:Code: Select all
echo '1|on+1|1|trigger|testing' > named.pipe
Code: Select all
open( *sfh, "+<".$source->{path} ) or die( "Can't open: $!" );