Ad Widget

Collapse

Create a trigger based on two elements.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dinao
    Junior Member
    • Apr 2020
    • 9

    #1

    Create a trigger based on two elements.

    Hi,

    I'm trying to monitor several servers on zabbix via SNMP and the BMC IP.
    I managed to get the good MIB from the manufacturer, convert it to a zabbix template via mib2zabbix with some help and now i'm creating the triggers.
    My problem is that i have some datas that are "split" for example : ​As you can see, i have some elements that contains the name of the sensor and some other that contains the value of the sensor.
    My question is : how can i create a trigger (for ex. CPU1 temp over 80°C) using the two elements sensorIDString for 1 and sensorReading for 1 knowing that these values comes from discoveries.
    I made sure that sensorIDString​ and sensorReading always correspond.

    I was wondering if maybe we could link the tho elements into a new one using sensorIDString value as name and sensorReading value as value

    I have about 50 sensors to do like that so if there is a way to link them automatically using the ids of the sensors that would be perfect.

    Thank you in advance for your help.​
  • TheOddPerson
    Junior Member
    • Feb 2024
    • 12

    #2

    Just to clarify:
    You want to create thresholds for the temperatures in the "SensorReading" items based on the string received in the SensorID item?

    ie:
    If SensorIDString1 contains CPU then threshold for SensorReading1 = 80
    If SensorIDString1 contains Intake then threshold for SensorReading1 = 30

    If there might be a way to combine the name and value as part of the item discovery then I would start there, then alter the discovery to have different item prototypes based on what their names are and set appropriate triggers for each prototype.

    Comment

    • dinao
      Junior Member
      • Apr 2020
      • 9

      #3
      Hi,

      The only thing that i want to do is to find a way to link SensorIDStringX with SensorReadingX and SensorIDStringY with SensorReadingY in order to create a new element that has the name SensorIDString and for value SensorReading in order to create trigger based on this item.

      They already correspond using their numerotation. What could be nice is to have as much elements as there is ID with this combination of the two of them.

      I kinda understand what you mean but i have absolutely no idea how to execute it.

      Comment

      • TheOddPerson
        Junior Member
        • Feb 2024
        • 12

        #4
        Take a look at any of the built-in templates that have item discovery and show item names based off the hostname for reference.
        ie: Cisco IOS by SNMP

        the Interface Discovery first "walks" the following OIDs
        walk[1.3.6.1.2.1.2.2.1.8,1.3.6.1.2.1.2.2.1.7,1.3.6.1.2. 1.31.1.1.1.18,1.3.6.1.2.1.31.1.1.1.1,1.3.6.1.2.1.2 .2.1.2,1.3.6.1.2.1.2.2.1.3,1.3.6.1.2.1.31.1.1.1.6, 1.3.6.1.2.1.31.1.1.1.10,1.3.6.1.2.1.2.2.1.14,1.3.6 .1.2.1.2.2.1.20,1.3.6.1.2.1.2.2.1.19,1.3.6.1.2.1.2 .2.1.13,1.3.6.1.2.1.31.1.1.1.15]

        Then when items are found under those OIDs it uses Preprocessing to map the different aspects of each interface to Parameters

        and it has the ability to use Filters to define interfaces to only discover items with parameters which match / don't match the macros you define.

        Still talking about interfaces: we could clone the discovery and have one discovery only include interfaces with the name "Trunk" and the 2nd discovery with interfaces of name "Printer" and each discovery has its own trigger prototypes.
        This same idea could be applied to your situation.

        I as well can't tell you how you would code it but I hope given the built-in examples it helps you get closer to a solution.

        Comment

        • dinao
          Junior Member
          • Apr 2020
          • 9

          #5

          That could be a good idea, but the problem is that the sensors names are all over the place.

          Here is a list of the sensors names that ends up in my list from discovery :
          sensorIDString for 1 CPU1 Temp
          sensorIDString for 2 CPU2 Temp
          sensorIDString for 3 PCH Temp
          sensorIDString for 4 System Temp
          sensorIDString for 5 Peripheral Temp
          sensorIDString for 6 VRMCpu1 Temp
          sensorIDString for 7 VRMCpu2 Temp
          sensorIDString for 8 VRMP1ABC Temp
          sensorIDString for 9 VRMP1DEF Temp
          sensorIDString for 10 VRMP2ABC Temp
          sensorIDString for 11 VRMP2DEF Temp
          sensorIDString for 12 FAN1
          sensorIDString for 13 FAN2
          sensorIDString for 14 FAN3
          sensorIDString for 15 P1-DIMMA1 Temp
          sensorIDString for 16 P1-DIMMA2 Temp
          sensorIDString for 17 P1-DIMMB1 Temp
          sensorIDString for 18 P1-DIMMC1 Temp
          sensorIDString for 19 P1-DIMMD1 Temp
          sensorIDString for 20 P1-DIMMD2 Temp
          sensorIDString for 21 P1-DIMME1 Temp
          sensorIDString for 22 P1-DIMMF1 Temp
          sensorIDString for 23 P2-DIMMA1 Temp
          sensorIDString for 24 P2-DIMMA2 Temp
          sensorIDString for 25 P2-DIMMB1 Temp
          sensorIDString for 26 P2-DIMMC1 Temp
          sensorIDString for 27 P2-DIMMD1 Temp
          sensorIDString for 28 P2-DIMMD2 Temp
          sensorIDString for 29 P2-DIMME1 Temp
          sensorIDString for 30 P2-DIMMF1 Temp
          sensorIDString for 31 12V
          sensorIDString for 32 5VCC
          sensorIDString for 33 3.3VCC
          sensorIDString for 34 VBAT
          sensorIDString for 35 Vcpu1
          sensorIDString for 36 Vcpu2
          sensorIDString for 37 VDimmP1ABC
          sensorIDString for 38 VDimmP1DEF
          sensorIDString for 39 VDimmP2ABC
          sensorIDString for 40 VDimmP2DEF
          sensorIDString for 41 5VSB
          sensorIDString for 42 3.3VSB
          sensorIDString for 43 1.8V PCH
          sensorIDString for 44 PVNN PCH
          sensorIDString for 45 1.05V PCH
          sensorIDString for 46 PS1 Status
          sensorIDString for 47 PS2 Status
          sensorIDString for 48 AOC_NIC_Temp
          sensorIDString for 49 MB/AOM_SAS Temp
          sensorIDString for 50 HDD Temp
          sensorIDString for 51 HDD Status
          sensorReading for 1 57
          sensorReading for 2 40
          sensorReading for 3 50
          sensorReading for 4 32
          sensorReading for 5 44
          sensorReading for 6 50
          sensorReading for 7 33
          sensorReading for 8 48
          sensorReading for 9 48
          sensorReading for 10 37
          sensorReading for 11 37
          sensorReading for 12 6800
          sensorReading for 13 6900
          sensorReading for 14 0
          sensorReading for 15 41
          sensorReading for 16 0
          sensorReading for 17 39
          sensorReading for 18 0
          sensorReading for 19 0
          sensorReading for 20 0
          sensorReading for 21 0
          sensorReading for 22 0
          sensorReading for 23 38
          sensorReading for 24 0
          sensorReading for 25 0
          sensorReading for 26 0
          sensorReading for 27 0
          sensorReading for 28 0
          sensorReading for 29 0
          sensorReading for 30 0
          sensorReading for 31 12.227
          sensorReading for 32 5.014
          sensorReading for 33 3.379
          sensorReading for 34 4
          sensorReading for 35 1.8
          sensorReading for 36 1.791
          sensorReading for 37 1.206
          sensorReading for 38 1.212
          sensorReading for 39 1.206
          sensorReading for 40 1.212
          sensorReading for 41 5.144
          sensorReading for 42 3.395
          sensorReading for 43 1.782
          sensorReading for 44 1.018
          sensorReading for 45 1.038
          sensorReading for 46 1
          sensorReading for 47 1
          sensorReading for 48 58
          sensorReading for 49 51
          sensorReading for 50 27
          sensorReading for 51 1
          This template is used to monitor supermicro servers, i tried it on X11 and H12 series servers and it works fine (some discovery problems on H12 where i will have to open a new topic.) The plan is to share it after i'm done setting it up to the zabbix share page.
          I intend to create triggers on almost all of these sensors.
          What is kinda good with this problem is that all the items are like that so if i can manage to solve this problem for the sensors, i'll be able to do it for all the rest (errors, disks enclosures ...)

          Comment

          • cyber
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Dec 2006
            • 4807

            #6
            Discovery reads sensor names from one OID, creates items, using those names and points items to another OID, which contains values...


            depending on your version....with walk or without...

            Comment

            • dinao
              Junior Member
              • Apr 2020
              • 9

              #7
              Thank you for the documentation.

              So if i understand well, i can create from a discovery an element prototype that is made from two other elements prototypes ?
              I'm sorry but i'm a bit new to the SNMP part of zabbix, i'm more used to the more basic configurations.

              Maybe if you could just give me an example for my case i could understand better.

              I have a discovery that is called sensorEntry Discovery with the OID discovery[{#SENSORIDSTRING},.1.3.6.1.4.1.21317.1.3.1.13,{#EV ENTDEASSERTIONENABLE},.1.3.6.1.4.1.21317.1.3.1.12, {#EVENTASSERTIONENABLE},.1.3.6.1.4.1.21317.1.3.1.1 1,{#UNRTHRESHOLD},.1.3.6.1.4.1.21317.1.3.1.10,{#UC THRESHOLD},.1.3.6.1.4.1.21317.1.3.1.9]

              From there i have several elements prototypes but the ones that interests me are sensorIDString for {#SNMPINDEX} with the OID .1.3.6.1.4.1.21317.1.3.1.13.{#SNMPINDEX} and sensorReading for {#SNMPINDEX} with the OID .1.3.6.1.4.1.21317.1.3.1.2.{#SNMPINDEX}

              If you are interested i linked you the XML for the module template.
              Attached Files

              Comment

              Working...