Ad Widget

Collapse

Zabbix string based trigger with 'AND'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • boomchke
    Junior Member
    • Sep 2016
    • 3

    #1

    Zabbix string based trigger with 'AND'

    Im pulling my hair out trying to write a trigger that I believe should be rather simple. I have two item keys that Im trying to check values on. Independently, I can evaluate either of them and the trigger works as expected. For instance, I can do this...

    {router1:ssh.run[int0.5].regexp(ONLINE)}=0
    <Trigger trips when the key returns something other than ONLINE>

    or

    {router1:ssh.run[int0.20].regexp(OFFLINE)}=0
    <Trigger trips when the key returns something other than OFFLINE>

    These work well and the value being returned by those keys is of type 'text'. However, what I really want to do is write an expression that looks like this...

    {router1:ssh.run[int0.5].regexp(ONLINE)}=0 and {router1:ssh.run[int0.20].regexp(OFFLINE)}=0

    So if for instance, the key int0.20 changes to something other than offline, I would expect the trigger to fail. However, that's not happening at all. For some reason, when the int0.20 key changes the trigger doesnt trip.

    I've tried changing regexp to str and that doesnt seem to help either.

    Any ideas? I cant sort out what Im doing wrong here.
  • glebs.ivanovskis
    Senior Member
    • Jul 2015
    • 237

    #2
    Learn how "and" operator works: https://en.wikipedia.org/wiki/Logica...on#Truth_table

    "A and B" is "true" if and only if both A and B are "true".

    Comment

    • boomchke
      Junior Member
      • Sep 2016
      • 3

      #3
      Im confused. The trigger is checking for one item being 'ONLINE' and the other being 'OFFLINE'. In normal operation, this is what the values are so the trigger wont trip. And the expression would evaluate as true

      I want the trigger to trip if one of the values changes. So is they both read OFFLINE one of the items would be wrong so the expression would evaluate to false right?

      Comment

      • boomchke
        Junior Member
        • Sep 2016
        • 3

        #4
        Any other ideas? Im really banging my head on the desk here. It seems to be the 'and' operator that's causing these problems.

        Comment

        Working...