Ad Widget

Collapse

Received value not like Cisco in discovery action

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Linwood
    Senior Member
    • Dec 2013
    • 398

    #1

    Received value not like Cisco in discovery action

    Can someone confirm how the "Received value not like" should work when there are numerous checks in the discover rule, some of which may return the field and some may not.

    Specifically I query both sysDescr and sysName, and do it with both SNMPV1 and V2C (I have a few old devices that only do V1). On a particular device where my problem occurs, two of them include the word "Cisco" and two do not.

    My discovery action is:

    Received value not like Cisco
    And
    Discovery status = Up
    And
    Service type = SNMPV2 Agent


    My expectation is that this would FAIL and not execute the operation, as two of the four string values returned do contain Cisco. But it does execute the operation (and links a template I did not want). I've removed them and rerun.

    I'm going to try debug but that's always like drinking from a fire hose. I was hoping if anyone might be able to confirm is my interpretation right? That "Not like" has to be true on ALL returned values to yield true?
  • Linwood
    Senior Member
    • Dec 2013
    • 398

    #2
    Well, after pouring over debug logs (love that module specific logging level) I can only conclude that the "not" version of like is evaluated the same as the positive version, which frankly I think is incorrect.

    So if you have multiple received values, and do a

    received value not like X

    Then if any one of the received values does not have an "X" it will perform the operations (assuming any other conditions evaluate as true of course).

    I find this inappropriate; I think it makes sense that a "any like X" is evaluated as any one of (essentially an "OR" between each condition), but for the "not" version I would expect it to be "Not any like" wish is logically an "AND".

    To work around this I had to remove all the places (in this case) that could return a value which did not contain "cisco" which then causes a cascade of other issues in trying to do a general purpose discovery + actions.

    Comment

    Working...