Ad Widget

Collapse

Brakedown snmp value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • galavichid
    Member
    • Mar 2021
    • 40

    #1

    Brakedown snmp value

    Hi,
    I am monitoring 14 HPE 1920 OfficeConnect SW, based on HP Enterprise Switch by SNMP​ template.
    The CPU Utilization OID is not correct. after long search I have found the right one, the problem is the value i get is pretty long

    Code:
    snmpwalk -v2c -c XX 192.168.6.6 1.3.6.1.4.1.11.5.7.5.7.1.1.1.1.4.9
    iso.3.6.1.4.1.11.5.7.5.7.1.1.1.1.4.9.0 = STRING: "    5 Secs (  6.7004%)   60 Secs (  8.776%)  300 Secs (  7.8696%)"
    ​
    There is a way to break it down and get only part of the outcome?

    In addition I would like to duplicate the HP Enterprise Switch by SNMP, when I try to do that, it just changing the name of the current one instead of duplicating it, any idea?

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

    #2
    Preprocessing... regex. "5 Secs \(\s*(.*)%\) 60 Secs \(\s*(.*)%\) 300 Secs \(\s*(.*)%\)" and return value either \1 or \2 or \3, depending on what number you want to save...

    Comment

    • galavichid
      Member
      • Mar 2021
      • 40

      #3
      Thanks cyber

      ***Removing the value and execute fixed the problem***

      When i test the value with the regex, i get the right result.
      but when running i get this error:

      Preprocessing failed for: 5 Secs ( 7.6393%) 60 Secs ( 7.6944%) 300 Secs ( 7.7524%)
      1. Failed: cannot perform regular expression "5 Secs \(\s*(.*)%\) 60 Secs \(\s*(.*)%\) 300 Secs \(\s*(.*)%\)" match for value of type "string": pattern does not match
      Click image for larger version  Name:	image.png Views:	0 Size:	19.9 KB ID:	458121
      Any idea?​
      Last edited by galavichid; 24-01-2023, 00:16.

      Comment

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

        #4
        What's your item type? Set item type to numeric(float) . you need to set it to the value, what is going to be saved.

        Comment

        • macejko
          Junior Member
          • Nov 2021
          • 2

          #5
          Hello, I am trying to make this work but without success...I am getting the following error: Preprocessing failed for: 5 Secs ( 22.1128%) 60 Secs ( 24.9054%) 300 Secs ( 24.6851%)
          1. Failed: cannot perform regular expression "5 Secs \(\s*(.*)%\) 60 Secs \(\s*(.*)%\) 300 Secs \(\s*(.*)%\)" match for value of type "none": pattern does not match

          I set the item type to numeric(float)

          Comment

          • galavichid
            Member
            • Mar 2021
            • 40

            #6
            Try this:
            Click image for larger version

Name:	image.png
Views:	177
Size:	34.7 KB
ID:	488869
            5 Secs \( \s*(.*)%\) 60 Secs \( \s*(.*)%\) 300 Secs \( \s*(.*)%\)
            \3%

            for the first one keep the space at the start

            Click image for larger version

Name:	image.png
Views:	173
Size:	22.5 KB
ID:	488870

            Comment

            Working...