Ad Widget

Collapse

SNMP MIB needs additional formatting

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • handsy
    Junior Member
    • May 2019
    • 8

    #1

    SNMP MIB needs additional formatting

    I have a MIB value that gives me:

    VENDORX-SNMP-MIB::temperatureSensors.0 = STRING: "[Card-1 Intake : 30 C] [Card-1 Exhaust : 35 C] [Card-1 CPU : 37 C] [Card-1 Switch CPU : 46 C] "

    ...and I want to extract both the "Card-1 Intake" and "Card-1 Exhaust" values. How do I do this in Zabbix?
    Ideally the vendor's MIB would have had each value as a unique OID but it doesn't
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    Use dependent items with regex preprocessing

    Comment

    • handsy
      Junior Member
      • May 2019
      • 8

      #3
      Originally posted by Hamardaban
      Use dependent items with regex preprocessing
      https://www.zabbix.com/documentation...ependent_items
      Thanks I'll take a look

      Comment

      • handsy
        Junior Member
        • May 2019
        • 8

        #4
        OK so I have created a template with a Master Item as Type 'text' as I'm pulling back a string. I then created 2 dependent items to pull back specific characters using REGEX. The problem I now have is that I cannot graph those dependent item values as they have to be Type 'text' like Master
        Is there a way of converting my dependent item values in to numerics?

        Comment

        • Hamardaban
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • May 2019
          • 2713

          #5
          Does the regular expression extract only digits?
          If yes - just change the type of the dependent data elements to numeric.
          Last edited by Hamardaban; 30-04-2020, 07:14.

          Comment

          • handsy
            Junior Member
            • May 2019
            • 8

            #6
            Awesome thank you. All sorted.
            For anyone else who needs to do regex like this in the future, here's what I did:
            • Name - Regular Expression
            • Parameters - (Exhaust : )([0-9][0-9])
            • Output - \2
            I basically used regex groups and selected group 2 of 1 for my output.

            Comment

            Working...