02-05-2011 12:51 PM - edited 03-06-2019 03:22 PM
In reference to:
In my situation I have a single 8-gig module in each Nexus7k. 10/1 and 10/2 are in PC100 peer-link. 10/3 connects to the core. 10/3 is a vPC102 on Nexus A and B.
Would it be more appropirated to use boolean AND or OR? Documentation states we should use OR, but I think AND makes more sense.
track 1 interface port-channel 100 line-protocol
track 2 interface ethernet10/3 line-protocol
!
track 10 list boolean AND
object 1
object 2
end
!
vpc domain 1
track 10
Solved! Go to Solution.
02-07-2011 06:06 AM
Hi Roman,
To achieve the behavior you described, you will want to use the OR statement as dictated in the configuration guide. Since you are tracking link-status in each object, consider the link up as a boolean 1 and the link down as a boolean 0. The tracking list triggers if it evaulates to 0. Thus:
scenario 1:
object 1 is up, object 2 is up
OR List = 1 OR 1 = 1
AND List = 1 AND 1 = 1
#######################################
scenario 2:
object 1 is up, object 2 is down
OR List = 1 OR 0 = 1
AND List = 1 AND 0 = 0 <---- track list is triggered
#######################################
scenario 3:
object 1 is down, object 2 is up
OR List = 0 OR 1 = 1
AND List = 0 AND 1 = 0 <----- track list is triggered
#######################################
scenario 4:
object 1 is down, object 2 is down
OR List = 0 OR 0 = 0 <------ track list is triggered
AND List = 0 AND 0 = 0 <------ track list is triggered
If the desired behavior is to trigger the track list only when all links go down, then you will want to use the OR operator. I hope this clarifies your question.
-Andy
02-07-2011 06:06 AM
Hi Roman,
To achieve the behavior you described, you will want to use the OR statement as dictated in the configuration guide. Since you are tracking link-status in each object, consider the link up as a boolean 1 and the link down as a boolean 0. The tracking list triggers if it evaulates to 0. Thus:
scenario 1:
object 1 is up, object 2 is up
OR List = 1 OR 1 = 1
AND List = 1 AND 1 = 1
#######################################
scenario 2:
object 1 is up, object 2 is down
OR List = 1 OR 0 = 1
AND List = 1 AND 0 = 0 <---- track list is triggered
#######################################
scenario 3:
object 1 is down, object 2 is up
OR List = 0 OR 1 = 1
AND List = 0 AND 1 = 0 <----- track list is triggered
#######################################
scenario 4:
object 1 is down, object 2 is down
OR List = 0 OR 0 = 0 <------ track list is triggered
AND List = 0 AND 0 = 0 <------ track list is triggered
If the desired behavior is to trigger the track list only when all links go down, then you will want to use the OR operator. I hope this clarifies your question.
-Andy
02-07-2011 12:34 PM
Andrew, thank you, I get it now. I've been confusing it with "match-all" and "match-any" logic. I was seeing "boolean", but not thinking in "boolean". It makes sense now, I do need OR.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide