In message <[email protected]>,
Tim Peiffer writes:
>I am trying to set up an active/standby or active/passive SEC pair, and
>use context to indicate which side should be active or passive. I am
>having a problem with the context check, comparing the string of $1
>against %Side, and I am not getting what I would expect.
>
>The exercise creates two questions for me. How do you compare context
>variables in a context expession?
I can't check at the moment, but IIRC perl subexpresions in context are
introduced with =( ...), so
context=ACTIVE_%Side && ("$1" eq "%Side);
should be
context=ACTIVE_%Side && =("$1" eq "%Side"); # not also missing "
>Is there a simpler more elegant way to do active/passive pairing,
>and signal in-band an active/passive switchover?
Whan I was setting up redundant collectors I just used a single rule
at the top that matched everything if the context "STANDBY" was set.
type=single
ptype=RegExp
pattern=.*
desc=capture all events if in standby and do nothing
context= STANDBY
action=none
before this was a rule:
type=single
ptype=RegExp
pattern=HEARTBEAT_FROM_REMOTE
desc=capture all events if in standby and do nothing
context= !STANDBY
action=create 63 STANDBY
where the HEARTBEAT_FROM_REMOTE was generated by a calendar rule in
the master SEC that used netcat to send the appropriate heartbeat
across. If the master SEC went down, the STANDBY context would expire
turning on processing in the standby SEC instance.
[...]
#
# Rule2: use the context to test whether side is active
#
type=single
ptype=RegExp
pattern=test (\S+) side
desc=side $1 active
context=ACTIVE_%Side && ("$1" eq "%Side);
action=logonly this side %Side is active
[..]
--
-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users