Ad Widget

Collapse

SNMP dynamic indexes on integers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gaspode
    Junior Member
    • Mar 2010
    • 7

    #1

    SNMP dynamic indexes on integers

    Hi,

    I've been successfully using the SNMP dynamic indexes on several items but recently seem to have hit a roadblock.
    I've got an index which is indexed by integers:

    Code:
    ...
    CPQHLTH-MIB::cpqHeTemperatureLocale.1.1 = INTEGER: ambient(11)
    CPQHLTH-MIB::cpqHeTemperatureLocale.1.2 = INTEGER: cpu(6)
    CPQHLTH-MIB::cpqHeTemperatureLocale.1.3 = INTEGER: cpu(6)
    CPQHLTH-MIB::cpqHeTemperatureLocale.1.4 = INTEGER: memory(7)
    CPQHLTH-MIB::cpqHeTemperatureLocale.1.5 = INTEGER: memory(7)
    ...
    but when I try to use it with the dynamic SNMP index Zabbix reports that it can't find the OID:

    Code:
    Item [server1:hp.temp.max[storage]] error: Cannot find index [1.3.6.1.4.1.232.6.2.6.8.1.3.1] of the OID [.1.3.6.1.4.1.232.6.2.6.8.1.5.1["index","1.3.6.1.4.1.232.6.2.6.8.1.3.1",8]]: NOT FOUND: 1.3.6.1.4.1.232.6.2.6.8.1.3.1[8]
    although when running snmpwalk I can see the item:

    Code:
    [marcus@monitor ~]$ snmpwalk -v 2c -c XXX server1 1.3.6.1.4.1.232.6.2.6.8.1.3.1 | grep 8\$
    SNMPv2-SMI::enterprises.232.6.2.6.8.1.3.1.27 = INTEGER: 8
    [marcus@monitor ~]$
    Is there any kind of workaround to be able to search for integers as well as strings in the index tables?
  • gospodin.horoshiy
    Senior Member
    • Sep 2008
    • 272

    #2
    Same problem here, and also same MIB...
    Zbx 2.0.4 on Debian and MYSQL5 on Ubuntu Server 64bit 8.04,
    200+ Win Agents, 50+ Linux Agents, 150+ Network Devices

    Comment

    • gaspode
      Junior Member
      • Mar 2010
      • 7

      #3
      In case you are trying to monitor HP temperatures as well this is the external script I ended up using to get around the problem (but beware it is rather specific for temperature monitors):

      {code}
      #!/bin/bash

      IDX=".1.3.6.1.4.1.232.6.2.6.8.1.3.1"
      TEMP=".1.3.6.1.4.1.232.6.2.6.8.1.4.1"
      TEMPMAX=".1.3.6.1.4.1.232.6.2.6.8.1.5.1"
      TEMPSTAT=".1.3.6.1.4.1.232.6.2.6.8.1.6.1"

      case $2 in
      "temp")
      OID=$TEMP ;;
      "tempmax")
      OID=$TEMPMAX ;;
      "tempstat")
      OID=$TEMPSTAT ;;
      *)
      echo "Unknown request"
      exit -1 ;;
      esac

      # Note, the cut -d . -f 16 should be more dynamic at some point.

      ID=`snmpwalk -c public -v 2c -On $1 $IDX | grep INTEGER:\ $3\$ | cut -d. -f 16 | cut -d " " -f 1 | head -n 1`

      if [ \! -z "$ID" ] ; then
      snmpget -c public -v 2c -OvQ $1 $OID.$ID
      else
      echo "-1"
      fi
      {code}

      Use it by setting up a external check and call it with hp_temp.sh["tempmax" 11] (for example for Ambient temperatures on my servers at least).

      Comment

      • hostcc
        Junior Member
        • Apr 2011
        • 4

        #4
        Patch submitted

        I've submitted the patch to correct this issue, see http://www.zabbix.com/forum/showthread.php?t=21702 and https://support.zabbix.com/browse/ZBXNEXT-760.

        Comment

        Working...