Ad Widget

Collapse

Extracting a value from an OID - Zabbix 6.0.2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MonZabbix
    Junior Member
    • Dec 2021
    • 19

    #1

    Extracting a value from an OID - Zabbix 6.0.2

    Hello everyone,

    I'm using Zabbix for a couple months now and I'm loving it!

    I'm currently struggling on the making of a template for a Lenovo DS4200 SAN.

    I have got an OID that is giving me mutiples values and I want to only have one of the 3 values that this OID is giving me.

    I tried to find trough the Zabbix forums and documentations but I didn't find anything related to my problem.

    One of the results of my snmpwalk of the OID .1.3.6.1.3.94.1.8.1.6 from the FCMGMT-MIB::connUnitSensorMessage:

    .1.3.6.1.3.94.1.8.1.6.32.128.0.192.255.67.127.117. 0.0.0.0.0.0.0.0.1 = STRING: "CPU Temperature-Ctlr B: 64 C 147.20F"

    The only value I want is the "64 C" from the value "CPU Temperature-Ctlr B: 64 C 147.20F"

    Because right now in Zabbix the value is listed like this:


    Click image for larger version

Name:	chrome_f44SnuKCzY.jpg
Views:	1894
Size:	30.5 KB
ID:	442675

    I did a discovery rule of this OID that is listing me around 40 items and most of them are temperature items.

    What should i do in Zabbix to only have the "C" value for each item in my discovery rule ?

    Thank you everyone.


  • jtnfoley
    Member
    • Mar 2022
    • 76

    #2
    Following, if only because I have similar SANs that will soon be interesting to bring into Zabbix.

    Comment

    • Atsushi
      Senior Member
      • Aug 2013
      • 2028

      #3
      Try using regular expressions in Preprocessing.

      ex.
      pattern:
      CPU Temperature-Ctlr [A-Z]: ([0-9].*) C
      output:
      \1

      Comment

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

        #4
        Yeah.. What Atsushi said...

        Comment

        • MonZabbix
          Junior Member
          • Dec 2021
          • 19

          #5
          Hello everyone!
          Thank you for the quick reply!

          Unfortunately, this doesn't seem to be working...

          Click image for larger version

Name:	chrome_TuQMd6P5JT.jpg
Views:	1726
Size:	24.9 KB
ID:	442745

          Sample of the results of clicking on Test:

          {"{#SNMPINDEX}":"32.128.0.192.255.67.127.117.0.0.0 .0.0.0.0.0.7","{#CONNUNITSENSORNAME}":"CPU Temperature-Ctlr A","{#CONNUNITSENSORMESSAGE}":"CPU Temperature-Ctlr A: 64 C 147.20F"}

          When i go in last value, It is still the same result too:

          Click image for larger version

Name:	chrome_ff1zKyTIJ3.jpg
Views:	1701
Size:	22.2 KB
ID:	442746

          Hope i gave enough information. Thanks for the hint though! I will do some research about the preprocessing rule.

          Comment

          • Atsushi
            Senior Member
            • Aug 2013
            • 2028

            #6
            Did you set the regular expression and then save the setting?

            Comment

            • MonZabbix
              Junior Member
              • Dec 2021
              • 19

              #7
              Originally posted by Atsushi
              Did you set the regular expression and then save the setting?
              Yes I did, i even "executed now" the discovery rule then I executed the Cpu Temperature Ctrl A & B items and yeah still the same results on the last value...

              I will dig and try to find a solution, I will keep you guys updated if I find it, thanks!
              Last edited by MonZabbix; 07-04-2022, 15:23.

              Comment

              • Atsushi
                Senior Member
                • Aug 2013
                • 2028

                #8
                If it is the item to be discovered, set the location to be set in the item prototype of the discovery rule. It is not set for discovery rules.

                Comment

                • MonZabbix
                  Junior Member
                  • Dec 2021
                  • 19

                  #9
                  Originally posted by Atsushi
                  If it is the item to be discovered, set the location to be set in the prototype of the item of the discovery rule. It is not set for discovery rules.
                  Thank you for the information Atsushi, I actually didn't know where to place it so I made the rule on both the discovery rule and the prototype of the item.

                  It is now working , thank you so much Atsushi! I just need to do the preprocessing rule for all of the others items now and I should be ok!

                  Click image for larger version  Name:	chrome_ngLXwXSKwh.jpg Views:	0 Size:	85.8 KB ID:	442761

                  Comment


                  • n.zheleznov
                    n.zheleznov commented
                    Editing a comment
                    Hi, do you still have the template? Can you send me a download link?
                Working...