Ad Widget

Collapse

SNMP Calculated Formula

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gary.W
    Junior Member
    • Aug 2018
    • 29

    #1

    SNMP Calculated Formula

    Hi, I just installed zabbix server for one week. Major goal is monitor near 100 device, including some Router&Switch and few servers.

    I am trying to calculate a item polled by SNMP,

    snmpwalk read value as follows:

    [root@zabbix ~]# snmpwalk -v 2c -c xxxx@wgzx 203.xxx.xxx.xxx 1.3.6.1.4.1.2636.3.60.1.1.1.1.5.519
    SNMPv2-SMI::enterprises.2636.3.60.1.1.1.1.5.519 = INTEGER: -268
    [root@zabbix ~]# snmpwalk -v 2c -c xxxx@wgzx 203.xxx.xxx.xxx .1.3.6.1.4.1.2636.3.60.1.1.1.1.5.519
    SNMPv2-SMI::enterprises.2636.3.60.1.1.1.1.5.519 = INTEGER: -268
    [root@zabbix ~]# snmpwalk -v 2c -c xxxx@wgzx 203.xxx.xxx.xxx enterprises.2636.3.60.1.1.1.1.5.519
    SNMPv2-SMI::enterprises.2636.3.60.1.1.1.1.5.519 = INTEGER: -268

    Then are all reading same object,and I need calculate the value "-268" into "-22.68" ,formula is :-268/100-20='-22.68'

    like when I use this command on router:

    RE0> show interfaces diagnostics optics xe-0/1/1
    Physical interface: xe-0/1/1
    Laser rx power : 0.0054 mW / -22.68 dBm


    I tried the following:

    Name:test
    key:test
    Formula:last("enterprises.2636.3.60.1.1.1.1.5.519" )/100-20

    Name:test
    key:test
    Formula:last(".1.3.6.1.4.1.2636.3.60.1.1.1.1.5.519 ")/100-20

    Name:test
    key:test
    Formula:last("1.3.6.1.4.1.2636.3.60.1.1.1.1.5.519" )/100-20

    Name:test
    key:test
    Formula:0.01*last("1.3.6.1.4.1.2636.3.60.1.1.1.1.5 .519")-20

    Name:test
    key:1.3.6.1.4.1.2636.3.60.1.1.1.1.5.519
    Formula:0.01*last("1.3.6.1.4.1.2636.3.60.1.1.1.1.5 .519")-20

    And this is zabbix_server.log following:

    11179:20180829:011649.657 item "JXQ-960-2:test" became not supported: Cannot evaluate function "last()": item "JXQ-960-2:enterprises.2636.3.60.1.1.1.1.5.519" does not exist.
    11179:20180829:013149.685 item "JXQ-960-2:test" became not supported: Cannot evaluate function "last()": item "JXQ-960-2:1.3.6.1.4.1.2636.3.60.1.1.1.1.5.519" does not exist.
    11181:20180829:013450.345 item "JXQ-960-2:test" became not supported: Cannot evaluate function "last()": item "JXQ-960-2:1.3.6.1.4.1.2636.3.60.1.1.1.1.5.519" does not exist.
    11175:20180829:013801.319 item "JXQ-960-2:test" became not supported: Cannot evaluate function "last()": item "JXQ-960-2:.1.3.6.1.4.1.2636.3.60.1.1.1.1.5.519" does not exist.
    11175:20180829:043632.250 error reason for "JXQ-960-2:.1.3.6.1.4.1.2636.3.60.1.1.1.1.5.519" changed: Cannot evaluate expression: "Cannot evaluate function "last()": item "JXQ-960-2:.1.3.6.1.4.1.2636.3.60.1.1.1.1.5.519" not supported.".
    11175:20180829:051934.377 item "JXQ-960-2:test" became not supported: Cannot evaluate function "last()": item "JXQ-960-2:enterprises.2636.3.60.1.1.1.1.5.519" does not exist.


    Can anyone know how to correct this? thanks!
  • m_d_c13
    Junior Member
    • Jan 2018
    • 23

    #2
    Hi,
    You have to put your item key in the formula instead of OID. Something like: last("ifDescr.519")/100-20

    Comment

    • Gary.W
      Junior Member
      • Aug 2018
      • 29

      #3
      Hi, it's worked! Thanks a lot @m_d_c13

      Comment

      Working...