Ad Widget

Collapse

Discovery Actions not working for hosts discovered with multiple snmp checks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tmroberts
    Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Jan 2017
    • 73

    #1

    Discovery Actions not working for hosts discovered with multiple snmp checks

    First the details: Zabbix 3.4.8 for Zabbix Server and Proxies on RHEL7 with MySQL Backend.
    We have network discovery rules created that are using both sysName.0 and sysObjectID.0 OID's as the checks, and they do work.

    The goal: We are trying to set up discovery actions that use both the sysName.0 and sysObjectID.0 OID from the discovery rule(s) in order to place the discovered host(s) in host groups based on both the environment and device type. A substring of the system name indicates if the device is part of the Corporate, Production or Development environment. The sysObjectID indicates what type of device the discovered host is.

    The issue: While the discovery rule(s) work, the discovery actions are only able to work when we use one OID or the other, not both. We have done snmpwalk's to verify what type of information should/is coming back from the OID's, but even when we set the discovery action to '=' rather than 'like' when both OID's are evaluated, they still do not perform the desired action. If this were working correctly we would see something like:
    returned values like:
    sysName like "ts"
    sysObjectID like "9.1.1732"

    Operation would send host to "Networking/Corp/ASRxxxx" host group, Remove host from "Discovered hosts" host group and apply the "Template X" template.

    What are we doing wrong?
  • aigars.kadikis
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2018
    • 208

    #2
    Hi, all!

    I can relate to this problem. I have created example to classify devices by sysDescr.0 and sysName.0.

    Here is output of snmpwalk
    Code:
    # snmpwalk -v2c -cpublic 192.168.99.1 -On .1.3.6.1.2.1.1.1.0
    .1.3.6.1.2.1.1.1.0 = STRING: "RouterOS RB951G-2HnD"
    # snmpwalk -v2c -cpublic 192.168.99.1 -On .1.3.6.1.2.1.1.5.0
    .1.3.6.1.2.1.1.5.0 = STRING: "MikroTikBroceni"
    Discovery rule:
    Click image for larger version

Name:	1-discover-sysDescr-sysName.png
Views:	2747
Size:	55.6 KB
ID:	357785


    And the rule which combines booth selections together.
    Click image for larger version

Name:	3-not-working.png
Views:	2715
Size:	56.5 KB
ID:	357786

    It almost looks like that condition works like:
    Code:
    echo "output of all OID checks" | grep "$1" | grep "$2"
    I even tried playing with multiline regex like
    .*roc.*\n.*OS
    .*OS.*\n.*roc

    Once I am comparing to singe "Received value" then everything works as expected

    Any workarounds are welcomed.

    Comment


    • tmroberts
      tmroberts commented
      Editing a comment
      Please do let me know if you end up figuring this out. Having to create so many single actions just doesn't seem like the right answer.
  • denisdion
    Junior Member
    • Aug 2018
    • 1

    #3
    Has anyone been able to figure this out yet? It is where I am stuck at the moment.

    Comment

    • Bercko21
      Junior Member
      • Dec 2015
      • 7

      #4
      I'm having the same problem as well. Anyone found a solution so far?

      Comment

      • dimir
        Zabbix developer
        • Apr 2011
        • 1080

        #5
        Change "Type of Calculation" from "And" to "And/Or".

        Comment

        • jdurga
          Junior Member
          • Dec 2018
          • 10

          #6
          Originally posted by dimir
          Change "Type of Calculation" from "And" to "And/Or".
          This doesn't fix the problem. "and/or" calculation works if you would want one value to match. The problem is getting two SNMP values to work together. If SNMP OID is A AND if SNMP OID is B, then apply the action.

          This is very important with SNMP. I want to add radios into Zabbix if they have this SSID. Then it would get assigned to the right group per the actions. For this, I would need to poll 2 SNMP values, one for the model of the radio and one for the SSID.

          https://www.reddit.com/r/zabbix/comm...ing_snmp_oids/
          https://www.zabbix.com/forum/zabbix-...sing-snmp-oids

          Also when I try "Received value contains" and "Discovery check equals(Check of OID of radio model)" it doesn't work, so it's not just comparing 2 SNMP OIDs that arent working but also OIDs with two different conditions.
          Last edited by jdurga; 11-11-2019, 22:12.

          Comment

          Working...